1

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 = CTFontCreateWithName((__bridge CFStringRef)(name), size, NULL);

// Font names I use to create a font 
[UIFont familyNames];

Is it safe to assume that if I remove all spaces in any of the font names taken from [UIFont familyNames] it'll be the expected font-name by core text?

aryaxt
  • 76,198
  • 92
  • 293
  • 442
  • Yes, but I'm not sure what this has to do with programming. There's a good list of PostScript font names here if you want to flesh out a pattern: http://www.tug.org/fontname/html/Standard-PostScript-fonts.html – CodaFi Aug 17 '13 at 18:20

1 Answers1

5

Ended up converting full name to postscript name when creating the font.

+ (NSString *)postscriptNameFromFullName:(NSString *)fullName
{
    UIFont *font = [UIFont fontWithName:fullName size:1];
    return (__bridge NSString *)(CTFontCopyPostScriptName((__bridge CTFontRef)(font)));
}
aryaxt
  • 76,198
  • 92
  • 293
  • 442