add custom font to a cordova project -
i have custom fonts use in app.
the font name myfont , files extension (myfont.eot,.myfont.svg,myfont.ttf,myfont.woff,myfont.woff2) , copied ios , android asset folder when cordova build. however, when open app on device don't see new font display.
i see new fond display when run app safari browser on mac.
here snippet css file
html, body { overflow-x: hidden; -webkit-tap-highlight-color: rgba(0,0,0,0); font-family: 'myfont'; font-size: 16px; }
is there else need in order see new font on android , ios device
thanks
use @font-face
in css.
@font-face { font-family: "my-font"; src: url("../assets/myfonts.ttf"); // give relative path css file. }
add code css file @ top. , can use font-family my-font
need it.
example:
css
.class-myfont { font-family: my-font; }
html
<span class="class-myfont">hello there</span>
Comments
Post a Comment