B4J Question [BANano] Google Font Reference not found when running Inspect > Page Source

Mashiane

Expert
Licensed User
Longtime User
Hi

I have added a font with

B4X:
BANano.Header.AddCSSFile("https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900")

and my UI is not showing the expected look, so after running a page inspect I notice that there is no reference to the font. Perhaps this is normal behaviour, please advice.

Thanks in advance.
 

alwaysbusy

Expert
Licensed User
Longtime User
Yes, this is expected behavior as this is no css file.

Try (font-family may need !important if some other css is already setting the body font-family):
B4X:
#if CSS
    @import url('https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900');
    body {
          font-family: 'Roboto';
    }
#End If

Alwaysbusy
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Thanks, strange because this is the link from the Vuetify site..

B4X:
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">

I have just tried your suggestion, sadly same behavior. For now I will just refer to Assets folder resource. You said...

this is no css file.
and used @import, so its a module? wow!
 
Upvote 0
Top