我找不到 Lucida Grande 粗体字体的名称系统名称,我需要在 [UIFont fontWithName:size:] 中使用它。谁能给我确切的名字?在互联网列表中找不到它。
天呐!
问问题
2952 次
2 回答
1
您找不到它,因为它在系统上不可用。您需要选择不同的字体。
于 2011-08-17T15:03:43.993 回答
0
与许多其他字体一样,该字体无法在 iOS 中使用。要获取可用字体的列表,请使用:
NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];
NSArray *fontNames;
NSInteger indFamily, indFont;
for (indFamily=0; indFamily<[familyNames count]; ++indFamily)
{
NSLog(@"Family name: %@", [familyNames objectAtIndex:indFamily]);
fontNames = [[NSArray alloc] initWithArray:
[UIFont fontNamesForFamilyName:
[familyNames objectAtIndex:indFamily]]];
for (indFont=0; indFont<[fontNames count]; ++indFont)
{
NSLog(@" Font name: %@", [fontNames objectAtIndex:indFont]);
}
[fontNames release];
}
[familyNames release];
http://ajnaware.wordpress.com/2008/10/24/list-of-fonts-available-on-the-iphone/
另请注意,字体列表可能会随着 iOS 更新而改变。
于 2011-08-17T15:04:29.553 回答