iOS custom font path for UIWebViews

后端 未结 4 842
陌清茗
陌清茗 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:49

    First of all, add filed "Fonts provided by application" in your info.plist. It will be an array like

    item0 myFont.otf
    item1 anotherFont.ttf
    

    or something.

    In HTML use font-face to add a font. And place your font files in the same directory with html file. If HTML is generated dynamically and not shown from bundle then you should copy font .

    Good luck.

提交回复
热议问题