Variable font-family for kanji cards

I have created a deck for refreshing my kanji knowledge. As experience shows it is a good idea that I review kanji in several different fonts, as often a kanji that is immediately recognizable in a non-serif font (say) may require some serious brain racking when presented in a serif or somewhat calligraphic font.

What I found so far is that I can change the font by adding, say,
font-family: 'YuMincho';
in the .main_wrap element of the css code for the layout. This allows me to have the same kanji in several different fonts on the card (e.g. one on the front, one on the back), create copies of the deck that use different fonts, or change the font manually from time to time by changing it in the layout.

This is already quite nice, but not yet ideal. Given the impressive functionality we have available for deck design in Kitsun, I wonder if we can do more… Would it be possible to make the font of the kanji on the front of the card depend on the SRS stage? (Is there a variable I can query that gives me the SRS stage? If so, can I work around the fact that there is no if/then in CSS?). If not, is it possible to make the font-family more variable in any other way (dependent on something else or a random value)?

1 Like


Technically speaking it would be possible to add classes to the review/lesson wrappers so that you can add custom fonts based on that, if that’s what you’d like to have then I can add it to the to-do list :slight_smile:

Just a small note regarding fonts in general, the way you are doing it would require you to have the fonts installed on your own computer, which would work just fine for a personal deck, but perhaps not when sharing the deck (you’d have to mention that they need certain fonts installed on their devices).

1 Like

Just to be clear: you mean classes depending on the SRS stage, right? That would be really great! :grinning_face_with_smiling_eyes:

Thanks for the note regarding the fonts. So far it didn’t even occur to me to share my deck at some point, but if I ever do, I’ll make sure to mention the font requirements.

1 Like

Yep! :smiley:

I’ll let you know once it’s been added.