How to use custom font in Cordova?

2019-09-14 17:29发布

问题:

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.

回答1:

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 fonts