Page 1 of 1

CSS HTML5 PDF - can't import google font

Posted: Tue Aug 14, 2018 2:32 am
by mdslup
According to this site on fonts,

https://www.oxygenxml.com/doc/versions/ ... asic_fonts

I should be able to put

@import url('https://fonts.googleapis.com/css?family ... 0,500,700i');

at the top of my css file. However, doing this causes my entire CSS file to be ignored...none of the rules apply. When I remove the import statement, then everything works normally.

Am I missing something? Feels like this should be simple.

Re: CSS HTML5 PDF - can't import google font

Posted: Tue Aug 14, 2018 12:56 pm
by Costin
Hello,

When using remote fonts (like the Google fonts from https://fonts.googleapis.com), in case there is any connectivity issue (you have an incorrect proxy configuration in oXygen or system, any other incorrect network settings configuration in oXygen, or if the server that oXygen tries to reach is down), such issues may occur.
When the connection fails, it breaks further parsing of the document, hence the styles are no longer applied.

As a workaround, you should:
- remove the font import at the top of the CSS file
- if you specifically need that font from Google, just download it locally (Montserat font is available at https://fonts.google.com/specimen/Montserrat - select this font > Download), save it in the same folder with the CSS and define a font-face for it (https://www.oxygenxml.com/doc/versions/ ... aid-title6)

Regards,
Costin

Re: CSS HTML5 PDF - can't import google font

Posted: Tue Aug 14, 2018 11:07 pm
by mdslup
I was able to solve this by going to Options > Preferences > Proxy and changing to "Direct Connection".