Multiple Languages Font Menu
Multiple Languages Font Menu
- Subject: Multiple Languages Font Menu
- From: Johnny CN Lee <email@hidden>
- Date: Tue, 27 Nov 2001 15:10:01 +0800
Hi,
I want to create a NSComboBox which contains font names for the user to
select. I use the following code to do it:
NSComboBox *fontMenu;
.
.
.
menu = NewMenu(kMenuStdMenuProc, "\pFonts");
osStatus = CreateStandardFontMenu(menu, 0, NULL,
kNilOptions, &outHierMenuCount);
if (noErr == osStatus)
{
long menuItem;
for (menuItem = 1; menuItem <= CountMenuItems(menu); menuItem++)
{
Str255 itemString;
NSString *fontString;
GetMenuItemText(menu, menuItem, itemString);
itemString[itemString[0] + 1] = 0;
fontString = [NSString stringWithCString:&itemString[1]];
[fontMenu addItemWithObjectValue:fontString];
}
}
DisposeMenu(menu);
All fonts with English names are displayed correctly, but not for Japanese
font names. All Japanese characters are displayed as Latin characters.
Have I done anything wrong?
Thanks,
J Lee