1

Recently I'm working on Carbon to Cocoa transition for my App.

The font my App used is "LucidaGrande", I got it from this method:

myUIFont = [NSFont systemFontOfSize: [NSFont systemFontSize]];

Sometimes my app want to show italic style font in its UI, so I call this:

myUIFont = [[NSFontManager sharedFontManager] convertFont:myUIFont toHaveTrait:NSItalicFontMask];

But this conversion failed. I found that it's because that there is no italic style for "LucidaGrande" font. I can verify this by calling:

NSArray* availableNames = [[NSFontManager sharedFontManager] availableFontNamesWithTraits:NSItalicFontMask];

There's no "LucidaGrande" in availableNames. It is very curious because I can use italic "LucidaGrande" font in my Carbon App. Is there any solution to get a italic "LucidaGrande" font for Cocoa App? Or how can I get a similar italic one?

Thanks very much!

fang
  • 35
  • 1
  • 4

1 Answers1

0

There is no italic version of Lucida Grande per se. Carbon text APIs fake it by slanting the regular version. Lucida Sans and Lucida Sans Unicode (regular) are identical in their Latin subsets, and have italic versions, but do not ship with the OS.

Jens Ayton
  • 14,532
  • 3
  • 33
  • 47
  • 1
    Note also that WebKit, if asked to display italic Lucida Grande will sub in Helvetica Italic instead. – Mike Abdullah Dec 16 '10 at 23:53
  • Thanks! Now I know why Carbon App can have italic LucidaGrande font. I also found this link which is very useful for me: http://stackoverflow.com/questions/1724647/how-do-i-get-lucida-grande-italic-into-my-application – fang Dec 17 '10 at 03:01