iOS custom font path for UIWebViews

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

    Add your custom font in your project. Then

    Get font name

     UIFont *font = [UIFont fontWithName:@"Your-Custom-font" size:20];
    

    Then create html string

    NSString *htmlHeader=[NSString stringWithFormat:@"HI",cssPath,font.familyName];
    

    Good luck.

提交回复
热议问题