Russian Text Rendering in Review Window

My setup: Arch Linux, Window managers: sway, i3, Anki 2.1.35.

I’ve never had font rendering issues before but I just created a Russian deck and began adding some facts. In the card edit window the text renders fine, but during the review (and preview) some glyphs are rendered wrong. But if I copy from the review window and paste elsewhere, like in Emacs, the pasted text renders correctly.

As an example, the word там renders as mам (that is with an m from the Latin alphabet).

The text comes from various sources, such as wordreference, tatoeba, etc. I would have thought there might be something strange with Qt font rendering for Russian, but in that case why doesn’t it also get messed up in the add/edit window?

Some updates: I tried downloading a few extra fonts that I found in the AUR, just to see if that would make a difference. It didn’t. I’m curious as to why the text is rendered correctly when I edit a card, but not when I review it and why this only happens in my Russian deck.

If it were a font or a text encoding issue, I would have expected consistent behavior. In addition this is one application that uses a specific toolkit, namely Qt, so I would further expect that the way it looks up fonts will be consistent.

I’ve of course searched around a bit but not been able to find anything that seems to apply to me. AFAIK, all the text I’m adding is UTF-8 encoded, but I may be wrong. Is there an easy way I can check this? Could this be my issue? I’m grew up and learned how to program purely with ASCII, so all these text encoding things are little bit of “you kids of today” to me.

I really hope somebody can point in the right direction. This disturbs me to no end, because I can’t really add new cards to the Russian deck as things stand now. Thanks in advance.

Maybe install the AnkiWebView Inspector add-on or set the env var QTWEBENGINE_REMOTE_DEBUGGING to 8080 prior to starting Anki.

Then take a look with Chrome DevTools and compare Rendered Fonts for the word там in the review window and the edit window.


Interesting, I wasn’t aware of this add-on, I’ll have to give it a try. Thanks a lot!

That worked perfectly Thanks so much for this!

So in the edit window the font used is “Sans Serif”, but in the preview window (and I assume, the review window) is ‘arial’. When I change the font in the inspector, the Russian text is rendered properly.

Now, the question is how to fix this? I don’t create card types for each deck. If I did, I could have forced the font via CSS for the Russian card type. Surely there must be a simpler solution? I’m really bad at fonts, but I guess I have to look into how Qt selects fonts.

OK, so now I have it working across decks simply by changing the CSS of the card type to font-family: ‘sans’. Not really what I wanted, as I don’t like sans serif fonts, but I’m way too lazy to figure out the right way to do it at this point.

I would have like to use something like the Noto Serif fonts, but I’m not sure how to do that without having to create a set of card types for each language, something that would involve way too much work.