Forum Bugs

Certain Cyrillic letters are not rendered with specified font

daneren2005
If you try to render the text ВЫПУСКНИКИ with the Google Font Rubik Mono One it won't render it with that font. It works fine in Chrome but renders with a different fallback font with Prince. Looking at the fonts embedded in the output.pdf I attached it is using DejaVuSerif instead to render it.
  1. output.html0.9 kB
    Sample HTML
  2. output.pdf11.8 kB
    Sample output
daneren2005
I tried a few other Google Fonts and none of them printed correctly with Prince, so I am guessing it is an issue with these characters
daneren2005
So this wasn't specifically a issue with Prince. Prince appears to be grabbing the tff versions of the fonts, which default to only latin subsets. For browsers like Chrome, that same link to the fonts grabs woff2 versions of all supported unicode ranges so it only needs to download the ones it needs.

You can reproduce with curl https://fonts.googleapis.com/css?family=Rubik+Mono+One:
@font-face {
  font-family: 'Rubik Mono One';
  font-style: normal;
  font-weight: 400;
  src: local('Rubik Mono One Regular'), local('RubikMonoOne-Regular'), url(https://fonts.gstatic.com/s/rubikmonoone/v8/UqyJK8kPP3hjw6ANTdfRk9YSN983TKA.ttf) format('truetype');
}


Loading it in your browser on the other hand will give:
/* cyrillic */
@font-face {
  font-family: 'Rubik Mono One';
  font-style: normal;
  font-weight: 400;
  src: local('Rubik Mono One Regular'), local('RubikMonoOne-Regular'), url(https://fonts.gstatic.com/s/rubikmonoone/v8/UqyJK8kPP3hjw6ANTdfRk9YSN98zTKUbcw.woff2) format('woff2');
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin-ext */
@font-face {
  font-family: 'Rubik Mono One';
  font-style: normal;
  font-weight: 400;
  src: local('Rubik Mono One Regular'), local('RubikMonoOne-Regular'), url(https://fonts.gstatic.com/s/rubikmonoone/v8/UqyJK8kPP3hjw6ANTdfRk9YSN985TKUbcw.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Rubik Mono One';
  font-style: normal;
  font-weight: 400;
  src: local('Rubik Mono One Regular'), local('RubikMonoOne-Regular'), url(https://fonts.gstatic.com/s/rubikmonoone/v8/UqyJK8kPP3hjw6ANTdfRk9YSN983TKU.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


I have found a fix that is to explicitly put &subset=all in the stylesheet so it grabs the full tff which contains the exact same fonts it will load in the browser. It would probably be optimal if Prince were only downloading the required woff2 fonts instead of requiring the entire set in one tff, but this works for now:
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Rubik+Mono+One&subset=all"/>
mikeday
Unfortunately Google Fonts does user-agent sniffing and serves Prince (and curl, and wget) a different CSS file to the browsers.
daneren2005
Yes, I noticed that as well. At least there is a solution here now if anyone else comes across the same issue.