Try ERPNext Buy Support Partners Foundation Foundation Members

Print format templates won't load external fonts

Hi,
I’ve created a print format template with the following stylesheet font import.

@import url("https://fonts.googleapis.com/css?family=Anonymous+Pro:400,700|Cousine:400,700|Source+Code+Pro:400,700&display=swap&subset=greek");

However the font is not being loaded in the HTML preview. However when I print the file as PDF it renders it correctly because the font is already installed on the server.

Any ideas how to properly include custom fonts?

Never mind I found a workaround for this. The problem occurs because the style section is included as inline style instead of a temp css file. Thus imports won’t work.

The workaround is to use JS for including the external css.