Helvetica Neue Bold Identifier

时间:2014-04-19 19:00:07

标签: uifont

Helvetica Neue Bold中使用UIFont的标识符是什么?我知道@"Helvetica Neue"Helvetica Neue的正确标识符,但那是Helvetica Neue Bold的标识符吗?

这是实现这种字体标识符的地方。如果您尝试找不到任何引用的标识符,它会将单元格字体设置为默认字体和字体大小。

UIFont *cellFont = [UIFont fontWithName:@"Helvetica Neue" size:12.5];

1 个答案:

答案 0 :(得分:6)

HelveticaNeue-Bold 是标识符。以下是可用于列出所有可用字体的代码片段:

NSArray *familyNames = [[NSArray alloc]initWithArray:[UIFont familyNames]];
for (NSString *familyName in familyNames) {
    NSLog(@"%@", familyName);
    NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName];
    for (NSString *fontName in fontNames) {
        NSLog(@"\t%@", fontName);
    }
}

*编辑:Swift 3.0

for familyName in UIFont.familyNames {
    for fontName in UIFont.fontNames(forFamilyName: familyName) {
        print("\(familyName) \(fontName)")
    }
}