Questions tagged [ctfontref]
11 questions
13
votes
4 answers
(NSCFType set) - Unrecognized selector in iOS 6
I'm using the great TTTAttributedLabel (https://github.com/mattt/TTTAttributedLabel) which works fine under iOS 5. Under iOS 6 however, I get the error:
-[__NSCFType set]: unrecognized selector sent to instance 0x200020e0
*** Terminating app due to…

rwbutler
- 387
- 1
- 4
- 19
3
votes
2 answers
Giving Framesetter the correct line spacing adjustment
Several posts have noted difficulties with getting an exact height out of CTFramesetterSuggestFrameSizeWithConstraints, and here, (framesetter post), @Chris DeSalvo gives what looks like the definitive fix: add a paragraph style setting with the…

Wienke
- 3,723
- 27
- 40
2
votes
1 answer
FontName from CTFontRef
I've a CTFontRef variable.
CTFontRef aFontRef;
Getting Size of Font was easy :
CGFloat aFontSize = CTFontGetSize(aFontRef);
Please help me in retrieving the FontName.
I'm expecting the FontName to be something like MarkerFelt-Wide.
But, when I…

Roshit
- 1,589
- 1
- 15
- 37
2
votes
1 answer
Memoryleak due to CTFontRef
I am generating a PDF using the below code but it leads to memory leak can anybody help ?
the code is given below.
- (void)drawText:(NSString*)textToDraw inFrame:(CGRect)frameRect {
NSMutableAttributedString *string =…

Vinay Chopra
- 593
- 3
- 17
2
votes
0 answers
Differences between CTFontRef and UIFont
So I just spent several hours beating my head against the wall because my CoreText project wasn't working properly. I found the issue, and it was odd. I'm hoping someone here can help me understand why the font characteristics of the same font of…

Chris
- 1,013
- 1
- 15
- 35
2
votes
1 answer
iPhone iOS UIFont conversion to CTFontRef causes size misalignment
I know that UIFont and CTFont are different things, but I was able to kinda make it work.
I'm trying to generate a PDF and use a UIView as a template, however to draw editable PDF, I need to have a CTFontRef render itself in a certain frame. Below…

Alex Stone
- 46,408
- 55
- 231
- 407
1
vote
1 answer
Objective-C - CTFont change font style?
I have a CTFont that contains a font style, and sumbolic traits.
I want to create a new font with a new style that inherits the symbolic traits of the first font.
How can I achieve this?
CTFontRef newFontWithoutTraits =…

aryaxt
- 76,198
- 92
- 293
- 442
1
vote
1 answer
CoreText - Performance warning when creating a CTFont?
I get the following warning when creating a CTFont.
CoreText performance note: Client requested font with PostScript name "ArialRoundedMTBold" using name "Arial Rounded MT Bold" instead.
// Creating Font
CTFontRef fontWithoutTrait =…

aryaxt
- 76,198
- 92
- 293
- 442
0
votes
1 answer
CTFontCopyName Returns null for the kCTFontSampleTextNameKey
I am trying to get the Sample text of a font.This is my coding.
NSString *fontFilePath=@"/Volumes/Work/Mac/Fonts/FONT FOLDER/Times New Roman Bold.ttf";
CFStringRef aCFString = (CFStringRef)fontFilePath;
CTFontRef fontRef =…

Aravindhan
- 15,608
- 10
- 56
- 71
0
votes
2 answers
What a difference between NSFont and CTFont and why CTFont hangs-up NSTextFieldCell?
I want to show fonts in NSTableView. If I use fonts inited by NSFont(name: fontName, size: size) everything is OK. But In this case I can use only fonts installed in system. So I made an NSFont Extension:
public extension NSFont {
static func…

Łukasz
- 773
- 5
- 23
0
votes
1 answer
Memory Leak due to CTFontRef
I am generating a PDF using the below detail , in Instrument i am getting memory leak, can any one have idea why the instruments point to the CTFontRef to 100 perc leak.?
NSMutableAttributedString *string = [[[NSMutableAttributedString alloc]
…

Vinay Chopra
- 593
- 3
- 17