Reputation: 733
I upgraded lately to ionic 3, in my new project i use custom font when i use ionic serve
it copy the fonts from src/assets/fonts
to www/assets
and it works well.
But when i run it on android using ionic cordova run android
the font files inside www/assets
disappears and it run on my device with no fonts.
my ionic info:
@ionic/cli-utils : 1.9.2
ionic (Ionic CLI) : 3.9.2
global packages:
Cordova CLI : 7.0.1
local packages:
@ionic/app-scripts : 2.1.3
Cordova Platforms : android 6.2.3
Ionic Framework : ionic-angular 3.6.0
System:
Android SDK Tools : 25.2.5
Node : v6.10.3
npm : 3.10.10
OS : Windows 10
Upvotes: 3
Views: 720
Reputation: 31
It is something weird with the latest version of ionic cli 3.9.2 or webpack (not sure). Fonts with WOFF extensions only are copied
I tried using WOFF format instead of TTF and it works.
Upvotes: 2
Reputation: 4848
try running ionic cordova build android
before running ionic cordova run android
.
Upvotes: 0
Reputation: 21
You should be placing the asset into your WWW folder before the build. if you add a fonts folder to your www it should place it in your platforms when you add the platforms and emulate, if not you will need to add the font to your platforms folder for it to emulate and be in your builds
yourapp/platforms/android(or ios)/assets/www/font
Upvotes: 0