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

前端 未结 15 1661
-上瘾入骨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 03:56

    Another "quick, practical" hack that doesn't involve scanning through all the default fonts that exist on either the emulator or device is to use the font for something in your storyboard. Then if you edit the storyboard with a text editor (open as source code), you can see the fonts used with "internal" names if you search for the "customFonts" tag:

    
        
            AvenirNextLTPro-Bold
        
        
            AvenirNextLTPro-Regular
        
        
            TradeGothicLTPro-BdCn20
        
    
    

提交回复
热议问题