I want to change the font family used in my custom Print format. The font family I want to use is on my Windows machine, it is exactly XXIINeueNorm-CndBlack and it is in TrueType format.
My question is: how can I load that font into ERPNext and use it in my custom Print format?
I have been trying to do this several times, following these links, but I have not been able:
I think something was missed to me, there is no way to change it and I need to be able to do this.
Put font file in app_name/public/font folder.
Your font should be accessible from http://localhost:8000/assets/app_name/font/Laksaman.ttf or http://yourwebsite.com/assets/app_name/font/Laksaman.ttf or something like that.
Use these css. (Mine use Laksaman font, you should change it to XXIINeueNorm-CndBlack)
Odd thing is frappe.utils.get_url() will return http instead of https and will ending with :8000 (atleast for me, I might config something wrong) Which won’t work in production setup.
But this won’t work with wkhtmltopdf.
If printing pdf is more important you could install font on your server and simply use
Thanks for your response @pipech.
My font is accesible from http://ipv4_address:8080/assets/app_name/font/XXIINeueNorm-CndBlack.ttf, but, I received the error net::ERR_CONNECTION_REFUSED when I load the custom Doctype and see Print format.
Finally, I could solve it @pipech.
The problem is that the frappe.utils.get_url() function only returns the host name or IPv4 address, not the port used, so it received the error net :: ERR_CONNECTION_REFUSED.
That seems like a bad idea, it will cause error in production environment.
Because it’ll tried to access http://your_site_name.com:8080 which did not exist and will cause the same error.
Exactly, unless you use an IP address to access your site, http://your_site_name.com:8080 will not work correctly, but, by now, I am using an IP address.