Jitai (字体): The font randomizer that fits

SETUP FOR CALLIGRAPHY PRACTICE
Seeing brush stroke types and stroke order in reviews

In Jitai, I only include the Yu Mincho font to see the brush stroke types in my reviews. I also added a hotkey that was suggested by another user’s comment to cycle between Yu Mincho and the KanjiStrokeOrders font (supplied here [Userscript] An Unobtrusive Kanji Stroke Order):

init: function() {
        window.addEventListener("keydown", event => {if(event.key == 'Ctrl') jitai.$characterSpan.css('font-family', 'KanjiStrokeOrders');});
        window.addEventListener("keyup", event => {if(event.key == 'Ctrl') jitai.$characterSpan.css('font-family', 'Yu Mincho, YuMincho');});

With that setup, I see the brush strokes in my reviews by default and can hold Ctrl to see the stroke order. I then write out all reviews with a brush pen.

EDIT: For some unknown reason, the hotkey stopped working the other day, so I changed the setup to showing Yu Mincho per default and the KanjiStrokeOrders per mouseover hover. I did a quick&dirty implementation in Jitai, but since there are no complicated functions, it should not cause any errors - just lots of redundant code.

setToDefaultFont: function() {
        jitai.setHoverFont(jitai.currentFont);
        this.$characterSpan.css('font-family', 'Yu Mincho, YuMincho')
    },

setHoverFont: function(fontName) {
        this.$hoverStyle.text("#character span:hover {font-family: KanjiStrokeOrders !important;}");
    },
3 Likes