iOS custom font path for UIWebViews

后端 未结 4 843
陌清茗
陌清茗 2021-01-03 06:20

I have a UIWebView and I have a custom font I want to load into an editable html document that I will be displaying through the UIWebView. In my SupportingFiles (resources)

4条回答
  •  误落风尘
    2021-01-03 06:51

    I got a working html code example here.

    
    
        
    
    
        

    Nosifer ABCabc

    As you can see I used a css class to define the font more easily. I'm not sure what all that CSS code within font-face means, but it seems to work.

    I confirmed that you NEED to add "Nosifer-Regular.ttf" to the array of fonts provided by the application in the *-info.plist file (key: Fonts provided by application). Btw I googled Nosifer-Regular.ttf and found it on a noisy site here. It really worked though: http://www.ffonts.net/Nosifer.font.download

    Then, I was also able to load an OTF that I'll be using in my case. In the CSS I changed format from truetype to opentype.

提交回复
热议问题