Nativescript-angular: Fonts not loading

Created on 9 Nov 2018  路  6Comments  路  Source: NativeScript/nativescript-angular

I'm using a blank ng template and it seems it's not possible to use custom fonts. I've tried to place the "fonts" folder under /my-project/src/app/fonts and /my-project/fonts, and I've also named the font family after the file's name.

In order to reproduce, install the blank ng template
tns create my-blank-ng --template tns-template-blank-ng
and try using a custom font.

Most helpful comment

@SkupeZZ the location of fonts directory should be /my-project/src/fonts

All 6 comments

@SkupeZZ the location of fonts directory should be /my-project/src/fonts

That solved it, thanks 馃憤

I got this issue too. I tried for a week but it doesn't work.

2019-01-13_10-34-31
2019-01-13_10-35-36
2019-01-13_10-38-02

HI @pisitch,
Can you send us a sample project, which can be used for debugging?

Hi @tsonevn
I have solved this problem. The problem is that Android is required to exactly use font file name in CSS file ,whereas IOS is required to exactly use font name that is needed to open the font file to see it.

I just put font file name and font name in the CSS file like this.

.rsu{
   font-family: 'RSU', 'RSU_Regular';
}

Fabulous. It worked. Thanks.

Was this page helpful?
0 / 5 - 0 ratings