How do I get the font name from an otf or ttf file?

前端 未结 15 1660
-上瘾入骨i
-上瘾入骨i 2020-11-28 03:44

I have used a custom font in my previous app.

The file name was \"ProximaNova-Regular.otf\" and to load the font I just used...

[UIFont fontWithName:         


        
15条回答
  •  感情败类
    2020-11-28 04:10

    Log familyNames of font file and then access the fonts:

    // You can log all font family names suing **fontNamesForFamilyName**
    
    NSLog(@" font name %@", [UIFont fontNamesForFamilyName:@"the file name"]);
    

    Hope it helps you.

提交回复
热议问题