Problems displaying custom cyrillic font with font

2019-07-25 09:46发布

问题:

I used fontsquirrel generator to generate font-face contents for Thonburi and Thonburi bold fonts. They display fine in English, but not in Cyrillic (Russian). Instead the site displays Times New Roman as default fallback font. I used advanced settings to specifically include cyrillic characters in font files. Kindly check: http://www.mastersofbackgammon.net/site/index_ru.html You can even see that Latin characters are displayed in Thonburi, while Russian is TNR.

It displays fine in English version: http://www.mastersofbackgammon.net/site

Do you have any ideas what could be the root of this problem and how to resolve this?

It displays fine at home, but there I have the fonts installed on Windows. Whenever I open site for the first time on another computer, the RU version gets the Times New Roman font and not Thonburi.

回答1:

The Thonburi and Thonburi Bold font as specified on the page have no Cyrillic letters (I checked this using OTMaster Light). This explains why Cyrillic letters are displayed using a fallback font, which is typically Times New Roman by default.

To generate adequate font files using the FontSquirrel generator, select “EXPERT...” and then in “Subsetting”, select either “Custom Subsetting” and required languages or “No Subsetting”. The default there in “Basic Subsetting”, which includes “Western languages” only!

P.S. The question was first asked as Font not displaying correctly in cyrillic on some occasions, which was closed as “too localized”. So I have copied my answer and an added comment.

P.S.2. The reason why it works for you at home is that the CSS code contains src: local(Thonburi), url("fonts/thonburi-webfont.ttf"), giving preference to a locally installed font, which apparently contains Cyrillic letters too.



标签: html css fonts