Reputation: 383
I want to use Font Awesome 5 in my Nativescript-Angular app. I followed below article and did everything same but I always getting icon as "?" for iOS and "X" for android.
Nativescript Version - 6.5, Angular Version - 8.0
https://medium.com/alexonozor/fontawesome-5-and-nativescript-4-2-angular-ca29826f9346
Steps followed:-
/*app.css*/
.far {
font-family: Font Awesome 5 Free, "fa-regular-400";
font-weight: 400;
}
.fab {
font-family: Font Awesome 5 Brands, fa-brands-400;
font-weight: 400;
}
.fas {
font-family: Font Awesome 5 Free, fa-solid-900;
font-weight: 900;
}
/*html*/
<Image src="font://" stretch="none" class="fas"></Image>
<Label text="" class="far"></Label>
<Label text="" class="fab"></Label>
It is not returning the actual image. If I follow the same steps in Nativescript Playground then it is working fine but I cant make it work in VS Code.
Please help me here.
Upvotes: 1
Views: 1641
Reputation: 141
Try to add double quote around the font names and filenames.
/*
File name: fa-solid-900.ttf
Font name: Font Awesome 5 Free
*/
.fas {
font-family: "Font Awesome 5 Free", "fa-solid-900";
font-weight: 900;
}
If it still does not work you should consider using the nativescript-fonticon
located here. It makes it easier to use, same way as the Web way.
Upvotes: 2