Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
1015 Переглядів

I tried several times to include a custom font to the web​ module.
This is what I have done to add the custom font

in the dir /addons_price/web/static/fonts​ there is an already existed file fonts.scss​ which is responsible for including the already-existed font in the /fonts​​ dir (e.g google, lato, sign, etc...).

Now in the dir /fonts​ (where the already-existed fonts folders are) I tried to add a new font dir called Noto_Sans_Arabic​ and the structure of this font folder is like this: 

Noto_Sans_Arabic/

  /static

​NotoSansArabic_Condensed-Black.ttf
​NotoSansArabic_Condensed-Bold.ttf
​etc...


Now let's go to the including step after we added the font dir /Noto_Sans_Arabic​ to /addons_price/web/static/fonts


1- go to the fonts.scss​ file because it already contains the code to include the already existed fonts, so I added this code to it: 
@font-face {
​font-family: 'Noto_Sans_Arabic';

​src:​url('web/static/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Black.ttf') format('truetype'),
​url('web/static/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Bold.ttf') format('truetype');    font-weight: normal;    font-style: normal;    }        

----------------
but it produces this error in the console (I even restarted the server): 
GET http://localhost:8068/web/static/fonts/Noto_Sans_Arabic/static/NotoSansArabic-Black.ttf 404 (NOT FOUND)

GET http://localhost:8068/web/static/fonts/Noto_Sans_Arabic/static/NotoSansArabic-Bold.ttf 404 (NOT FOUND)

----------------

I tried to add the font to the __manifest__.py​ file but it didn't work also or maybe I didn't include it there in the right way.

Please If anyone knows how to solve this help me

Аватар
Відмінити
Автор Найкраща відповідь

Hello Yatrik, Thanks for your reply.
The copied error was a wrong one because I was trying different things and forgot to copy the correct error. Here below are the updated code and its corsspending error:
``` @font-face {    
font-family: 'Noto_Sans_Arabic';    
src: url('web/static/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Black.ttf') format('truetype'),    url('web/static/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Bold.ttf') format('truetype');    
font-weight: normal;    font-style: normal;    
}


    * { font-family: 'Noto_Sans_Arabic' !important; 


Error: 
* { GET http://localhost:8068/web/static/fonts/web/static/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Black.ttf net::ERR_ABORTED 404 (NOT FOUND)

point_of_sale.assets_prod.rtl.min.css:1 

GET http://localhost:8068/web/static/fonts/web/static/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Bold.ttf 404 (NOT FOUND) }

Аватар
Відмінити
Найкраща відповідь

Hello,

I've noticed in the error message that the file "NotoSansArabic-Black.ttf" is not found in the specified location. However, the actual file name is "NotoSansArabic_Condensed-Black.ttf".

This suggests that there might be an error in the file path specified in the manifest. Could you please check and confirm why the file names are mismatched?

I hope this information is helpful.

Thank you & Best Regards,

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
7
квіт. 25
7287
1
лист. 23
4789
1
серп. 20
1482
2
лют. 24
1683
1
лист. 23
1786