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

前端 未结 3 1167
攒了一身酷
攒了一身酷 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;
    

提交回复
热议问题