Custom fonts in hybrid mobile app (phone gap) UI

社会主义新天地 提交于 2020-01-17 09:09:08

问题


I have used few custom fonts in my first hybrid mobile app (in phonegap) using @font-face rules. Font files with different extension were packing with app and called them using CSS. And it rendered perfectly.

But doubtful on this method and would like to know is this a right approach? Please guide me.

Thanks!


回答1:


I've been using Cordova and that approach for some time now, and never had problems with it. Provided that this is what you're doing...

@font-face
{
    font-family: dinpro_black;
    src: url('../fonts/DINPro Black.otf');
}

.font_black {
    font-family:dinpro_black;
}



回答2:


You are creating an web application in native web view. Web Aplication, so when you using font-face you are using css technology, and is good approach in that kind of apps.



来源:https://stackoverflow.com/questions/28541323/custom-fonts-in-hybrid-mobile-app-phone-gap-ui

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!