Question 2:
if i set it to a custom font, will it be okay on Android, iOS, wp8 platforms?
My custom font works when I test on browser with ionic serve but not on emulator/device, is there any additional step to make a custom font work on these platforms?
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
Like @lkpttrsn says, you can just add the font folder for your custom font in the www folder and refer to it in your sass above. You can use this link to generate a set of font and css files to include in your project if you wanted to embed the font files, alternatively you can use the google fonts method above and itâll load it from the internet.
// The path for our ionicons font files, relative to the built CSS in www/css
$ionicons-font-path: "../lib/ionic/fonts"; //!default;
@import url(https://fonts.googleapis.com/css?family=Arima+Madurai|Lato|Pacifico);
// Include all of Ionic
@import "www/lib/ionic/scss/ionic";
// $font-family-base: "Lato", sans-serif !default;
// $font-family-base: "Arima Madurai", cursive !default;
$font-family-base: "Pacifico", cursive !default;
I could only get this working by downloading the font from google and storing it my app, which tbh is probably better for app load time. Then in your scss file:
I hope, you have figured it out by now. Just in case, if others too are wondering how to get forms and headers updated, you can just add ion-title, ion-item elements too, like so:
In case anyone using Ionic 4/5 comes across this,
Set the --ion-font-family in root: after youâve loaded the font face.
You can also change the text colour for the app if needed at the same time