After QWebView for hours and hours, I finally noticed that Font Squirrel amazingly rendered the external font. I highlighted letters many times and sat there in fear, smiling.
In any case, it seems to make this work with QWebView :
@font-face { font-family: 'Terminal Dosis'; font-style: normal; font-weight: 400; src: local('Dosis Regular'), local('Dosis-Regular'), url('../fonts/terminal-dosis-regular.woff') format('woff'); }
I had to do it like this:
@font-face { font-family: 'Terminal Dosis Regular'; src: url('../fonts/terminal-dosis-regular.ttf') format('truetype'); }
Please note that QWebView does not like WOFF fonts. I had to convert my version to TrueType through Font Squirrel .
In short:
- Make sure your fonts are TrueType fonts.
- No
local() . - It looks like
font-style and font-weight ignored. You must create different font families for each style of each font (for example, Terminal Dosis Bold ).
source share