Right click on the TTF -> Get Info
"Full Name" is what you're looking for.
That's what worked for me with TTFs.
Edit:
I just used a font that had a different name from the "Full Name" in Get Info.
For the compilation of this answer, If the quick check above doesn't work, run this code in your project:
for (NSString *fontFamilyName in [UIFont familyNames]) {
for (NSString *fontName in [UIFont fontNamesForFamilyName:fontFamilyName]) {
NSLog(@"Family: %@ Font: %@", fontFamilyName, fontName);
}
}
And search for the correct name of the font you want to use.
Swift 3.0 code:
for fontFamilyName in UIFont.familyNames{
for fontName in UIFont.fontNames(forFamilyName: fontFamilyName){
print("Family: (fontFamilyName) Font: (fontName)")
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…