Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
5445 Zobrazení

I am trying to set the Poppins font for all of my .pdf reports. 

In the head of web.report_layout just before I have added the font. 

Whenever I use the styling in the reports it does not work, I have to add the in the parent div then it works. But this will download 3-5x the font to render 1 report. 

How to set a font globally for all reports? I also tried to set the style for all elements in the

which does not work either. 

Avatar
Zrušit
Nejlepší odpověď

Hi,
For this you need to create a custom module and add the fonts and scss. Let us walk you through the process.
Here, A new module is created and it's named custom_font. Don't forget to add the __init__.py file and manifest.py file. 


Inside the static -> src -> create 2 folders named fonts and scss to load the fonts and scss.
Go to https://fonts.google.com/specimen/Poppins this link and download all the poppins fonts.
Copy that to the fonts folder.


Next you need to create an scss file. 
Here, it is named custom_font.scss and you have to load the font file that you want to use in font-face and give font-family to the elements you want it to be applied to.


Next you need to mention the scss file in the report asset bundle in the manifest file.


That's all for development.
Add the module in the addons directory and install it and all the reports will be poppins.



Hope it helps

Avatar
Zrušit