Getting web fonts to work with phonegap and android - how?

前端 未结 3 1157
攒了一身酷
攒了一身酷 2021-02-19 08:21

Does PhoneGap support web fonts, and if so how do you use them. I\'ve currently got this code in my page, but it doesn\'t work when loaded into the emulator (inside an android a

相关标签:
3条回答
  • 2021-02-19 08:30

    I've had no problem getting PhoneGap to recognize web fonts. If WebKit will do it then Android and iOS will do it. In a project I'm working on now, currently only tested on Android:

    @font-face{
     font-family: MyFont; 
     src: url('../fonts/my_font.ttf') format('truetype');
     src: url('../fonts/my_font.otf') format('opentype');
    

    then on a style as

    font-family:MyFont, arial, sans-serif;
    
    0 讨论(0)
  • 2021-02-19 08:42

    Webfonts are broken in android 2.1, it's a known bug, unfortunately.

    0 讨论(0)
  • I had a problem with using a custom font in the Woff format. Then I converted it from Woff to Ttf and it worked on my Android device. So there might be a problem with using Woff format.

    So, conversion from .woff to .ttf might solve the problem.

    0 讨论(0)
提交回复
热议问题