65
Views
6
Comments
custom font
Application Type
Reactive

Hello,

I'm attempting to implement a custom font for my application, but for some reason, it's not functioning properly.

This CSS code successfully applies the Montserrat font:



@font-face {

    font-family: 'Montserrat';

    src: url(/fontapp/Montserrat-VariableFont_wght.ttf) format('truetype');

}


* {

    font-family: 'Montserrat';

}


However, I'm encountering issues when trying to apply the Jannat font: 

@font-face {

    font-family: 'A Jannat LT';

    src: url(/MinistryofHealth_CA/AJannatLT.ttf) format('truetype');

}


* {

    font-family: 'A Jannat LT';

}

Regards
bala

2021-03-05 13-56-11
Ricardo Pereira
 
MVP

Hi,

Did you already checked if the source URL for the font is correct in the 'A Jannat LT' font? 


Hope this can help.


Best regards,

Ricardo

UserImage.jpg
Bala Murugan

Hello @Ricardo Lopes,

I'm encountering an error when I include spaces in the URL.

Regards, Bala

2019-01-07 16-04-16
Siya
 
MVP

Replace space in your URL with %20. For example, if your URL is http://example.com/new page, it should be encoded as http://example.com/new%20page.

2025-05-28 14-01-18
Rishabh Gupta

Hi, 

I am assuming that you have downloaded and are calling the font file from the local resource folder,

but if you haven't done that then I recommend that you do that first as that will be better that calling some online 'url' that can be volatile, then you can just copy the runtime path of the said file and you will be good to go.

Hope it helps.

Regards

UserImage.jpg
Bala Murugan

im using  from resource folder

2022-09-05 08-23-51
Naveen N

Hi @Bala Murugan ,


The code you provided for the Montserrat font looks correct, and it's good that it's working as expected. There could be a few reasons why the Jannat font isn't working properly. Here are some things to check:


Font File Path: Double-check the path to your Jannat font file (AJannatLT.ttf). Make sure it's spelled correctly and that the folder structure (/MinistryofHealth_CA/) exists on your web server.


Font File Format: While you've specified format('truetype'), some fonts might require different formats like woff2 or woff. You can try including additional formats like this:


CSS

@font-face {

  font-family: 'A Jannat LT';

  src: url(/MinistryofHealth_CA/AJannatLT.ttf) format('truetype'),

       url(/MinistryofHealth_CA/AJannatLT.woff2) format('woff2');

}


I hope this helps! 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.