如何在Cordova中使用自定义字体? [英] How to use custom font in Cordova?

查看:279
本文介绍了如何在Cordova中使用自定义字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在cordova中,我使用的是通过p标签或h1标签等书写的正常字体。

我想写一个像BROADWAY或CASTELLAR这样的时尚字体,在Microsoft Office中可用,也可以在线查找为tff文件。
有没有一种方法可以在Cordova中使用任何自定义字体。



==>通过自定义字体我的意思是除默认字体以外的任何字体。

解决方案

是的,这是可能的。



将这些文件放在.css文件中:

  @ face- face {
font-family:'font name';
src:url(font address);

$ / code>

然后使用 font-family:'font name' ; 在您的css代码



希望这个帮助。

In cordova I am using the normal font which is written through p tag or h1 tag etc.

I want to write in an stylish font like BROADWAY or CASTELLAR which are available in Microsoft Office and can also be found online as tff file. Is there a way by which I can use any custom font in Cordova.

==>By Custom font I mean any font other than the default font.

解决方案

Yes it is possible.

put these in your .css file:

@face-face {
    font-family: 'font name';
    src: url("font address");
}  

then use font-family: 'font name'; in your css code

Hope this help.

这篇关于如何在Cordova中使用自定义字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆