Hi coders,
I am new to ionic.
Please help me to solve the below problem.
How to import and apply Google Roboto regular and Roboto medium fonts to ionic 3?
Hi coders,
I am new to ionic.
Please help me to solve the below problem.
How to import and apply Google Roboto regular and Roboto medium fonts to ionic 3?
Hello,
something like
@font-face {
font-family: 'Archistico';
src: url('../assets/fonts/Archistico-Bold.woff') format('woff');
font-weight: bold;
// font-style: normal;
}
@font-face {
font-family: 'SketchyTimes-Bold';
src: url('../assets/fonts/SketchyTimes-Bold.woff') format('woff');
font-weight: bold;
// font-style: normal;
}
h1 {
font-family: 'Archistico';
font-size: 2em;
color: darkblue;
}
h2 {
font-family: 'SketchyTimes-Bold';
text-align: center;
color: indigo;
}
Take care of proper paths. Paths must always seen from www folder. If you use assets folder in src, then it will not work on device, because there is no src anymore.
Best regards, ana-liebt
Roboto should already be defined by Ionic, so there is no need to add it yourself. If looking at your app on iOS, it will not use it (by design).
If you want to universally change the font you can define these SASS variables:
$font-family-md-base: “Roboto”;
$font-family-ios-base: “Roboto”;
This is a good thread to read about this:
Yeah…you are right…while checking in main.css i got to know that Roboto family is already added by Ionic…but if i try to apply its not getting applied.
To get the confirmation, i have added Roboto-Medium to Username and Noto-Sans-Bold to password field. But both font-families are not applied.
Both have same default font-family
PFA screenshot