Jitai (字体): The font randomizer that fits

1 Like

didnt find this one for download.

It’s an Adobe font you can see here, but unless you have an Adobe Creative subscription, you won’t be able to download it without buying it.

In any case, as I wrote earlier, over the next few months all the major browsers will follow Safari in disallowing external sites from accessing your local non-system fonts, so I wouldn’t pay for it for this purpose, even though it’s fairly cheap to get a personal license.

Also, here is the Google Fonts link for fonts supporting Japanese—there are hundreds of them and the search methods for Latin fonts don’t really translate well to Japanese, but at least you could scroll through when you’re bored…

(Note that the “handwriting” filter isn’t great here; it gives you three fonts, but there are others, like Kiwi-Maru, that is obviously handrwriting-style but is filtered out if you select handwriting.)

2 Likes

And here’s a link to at present ~60 Google fonts, along with a specimen with nonsense mixed kanji/hiragana/katakana text you can use.

2 Likes

Thank you for creating this! Fyi there are a couple dead links in the font list at the moment, the one for the EPSON fonts, which should point here:

https://www.epson.jp/dl_soft/readme/27767.htm

(Note that if your Windows PC is not set to Japanese language, you may not be able to run the EPSON EXE file, but I was still able to extract it as an archive using 7-Zip and get the TTF files out and install them manually with no problem.)

The link for HakusyuKaisyoExtraBold_kk is also dead (the download links on its page are broken), but I found it over here:

https://www.onlinewebfonts.com/download/a8a9b098d0e2133272bcc9d5e0162f7d

There is probably a better source than this.

Also a Safari user here. That issue was really annoying for me and my learning process, and I didn’t want to change browsers.
I made a quick workaround for Safari to use the webfonts that also the [Read that if you can] script uses. Maybe it will be helpful also for others, so I’ll post it here:
Jitai-Webfonts-Fix

Though, note that it is a quick&dirty workaround. It increases the starting time of the review session noticeably since it first loads all fonts. But once all fonts have been downloaded, it works like a charm.
If someone is more fluent in JS you can definitely optimize it, but for now its enough for my purpose.

1 Like

Awesome, thanks! I would miss the notification of this until a moment when, for the first time in probably a week, I have nearly 18 hours until my next review to see if it works, right?

Would using it in self-study sessions as well be as simple as changing the regex in the @include line to also include those URL’s? The iOS script manager will only install scripts from websites, not files, but I could maybe use Github—I’d need to try it. But maybe since you already have a GreaseMonkey account with the upload, that change would be easy for you?

I made a few changes since my last update. Here again is the link: Jitai Webfonts Fix

  • It loads now (dramatically) quicker
  • Made it easier to add your own fonts. I wanted to mainly focus on difficult fonts (handwritten, pixel-style, …) that challenge me like the ArmedBanana font, and removed fonts from the “Read that if you can script” that didn’t really work for me.
  • Also now works in Self Study Session

I agree about your comment that GitHub would be nice to host the script (like the Niai script and others do), rather than GreaseMonkey. Then people could actually contribute to it and make the script better / send in bug fixes to address issues as we had now. The last time this script was officially updated is a few years ago.
Btw, I am still looking for a hosted ArmedBanana font. I’d really like it to include in the Webfont fix. Maybe hosting it on my GitHub account together with the script might be an option, but since it’s the legal property of another person… not sure how to deal with that.

2 Likes

Agreed on all counts, and thanks for doing that!

(To be perfectly clear, I’m just brainstorming below; I have no real “complaints”, because this is strictly better than the old script!)

There’s something that goes way beyond a quick kludge I think (maybe it’s time for me to finally learn JavaScript and DOM programming, I’ve always worked exclusively server-side), but a “nice to add” in a hypothetical future version:

There are a couple Google fonts that are just totally illegible at the default size/weight on my primary device, and not in a fun or “good to stretch yourself” way—like Dela Gothic One, in which complicated kanji can render as a solid irregular polygon with a little hole or two.

To exclude them now you have to

  1. Figure out the illegible font’s name
  2. Make a private copy of the script
  3. Edit it to remove the name from the fonts list
  4. Plus—for browsers that won’t load local userscripts (like, Safari on iPad)—upload your own version somewhere
  5. Reinstall the script
  6. Notice any time there’s an update, and merge it with your mods to fonts.

which is all a bit of a pain.

I’m sure I’m in the distinct minority here given my skillset, but for me the most annoying bit is actually #1 — I have to open the Web Inspector (which is super-fiddly on iPad), find the main question <span>, and get the name from there. I’m wondering if I could (or should) just stick a console.log(currentFont) in there so I can just check the console when it gives me one?

(But it’s nice that you did it by rewriting the span element to include a style="font-family: "$fontname";";¹ attribute—if you’d done it as a pure style, it would’ve been even harder to find the font name!)

But that’s just me—I think for most potential users, #3–6 are the items that will get them hung up.

Unfortunately, right now Jitai is simpler than many WaniKani userscripts for not having to have any local persistent storage—and I don’t see any way to avoid that if you wanted to add a font inclusion/exclusion interface.


¹ A bit off-topic, but I’m curious, since (as I wrote above) I don’t know anything about DOM manipulation… but why does this even work? Like, in
<span lang="ja" style="font-family: "Kaisei HarunoUmi";">最終</span>

the tag’s style attribute seems to have double quotes inside double quotes?

Actually, a little injection so that there was, like, a small italic

Kaisei HarunoUmi

in one of the corner text elements might be sufficient for the font-identification thing. (And it would make it easier to notice you like a particular font and to download it if you want to use it yourself!)

I shouldn’t say anything since I’m not the maintainer of this script, but I imagine it wouldn’t be too difficult to add a button which adds the current font to a local blacklist

The inner quotes are actually escaped, it just doesn’t show in the DOM

2 Likes

Indeed, I agree with your proposed ideas. I may eventually work on it over the next few days. I guess I’ll also make a GitHub repo of it, so people can easily contribute fonts and make other improvements. Please give me a while to finish my work (busy week ahead) :nerd_face:

I’ve found there is a weird interaction between this webfont mod of the Jitai script and the Double-Check 2 script I just installed: until you use the Double-Check feature in a session to retry a response, the webfont-enabled Jitai works— mostly normally.

But once you use it (by pressing +, - Esc or clicking the button):

  • all items following in the same session will only use the locally-installed fonts;
  • if the randomizer chooses a webfont, you get a delay (around 1.5 seconds?) on each new screen with no visible character,
  • and then (after a timeout, I assume) the character appears in a locally-installed font substitute (usually the default font, but sometimes the built-in Mincho font—or maybe also the Rounded font, I’m not 100% sure).

Also, simply having the Double-Check script active, for all characters after the first character, there is a delay before a webfont character appears, but it’s shorter (maybe ~0.75 seconds).

During either of these delays, you can hover over the blank space where the character should be to see it in the default font.

Any idea what could be going on here? I’ve verified through isolation that it’s an interaction between these two scripts alone (or one of their dependencies). I’m mystified.

@marciska, let me know what events you are triggering on, and maybe I can make Double-Check more compatible with what you (and others) are doing.

1 Like

Sorry for my late reply. I started already working on your previous post’s suggestions, but didn’t had yet the time to finish it up. Currently focusing on submitting my doctor thesis and a friends wedding coming up soon in Korea, so I guess I’ll first let that pass and be able to work on it in April :sweat_smile:

Oh that’s indeed mysterious. I tried to reproduce the bug but it didn’t appear. I remember you were doing your reviews on an iOS device using Safari, wasn’t it? Have you tried it on another device and/or browser? Please also tell me your exact setup (iOS version, device, browser, scriptmanager). It’s easier for me to find the cause if I can reproduce it :slight_smile:

Funny thing, while trying to reproduce it, I noticed another bug: If you just press enter with an empty answer field, the hovering-effect is inverted :nerd_face:

That problem has me also already puzzled, but slightly different:

  • sometimes the whole word is invisible and then pops in after ~0.75s
  • sometimes it is just one character that is missing, but if so it is always the last character in the word
  • if it appeared during one of meaning/reading, and then you get the word again during the same review, then that problem sometimes occurs again but not always

This problem doesn’t appear very frequently, though. And I got the impression that I didn’t see it for a while happening again (maybe because I got good at ignoring it :sweat_smile:).
I’m not sure if it’s because of the Double-Check script. Didn’t pay that much attention to it, so I don’t really know why it disappeared recently. I always do my reviews on a MacBook 2019 with latest OS Ventura 13.2.1 in Safari with TamperMonkey. If I had to guess, I think it disappeared since I stopped doing my reviews at Uni (working recently mostly from home). So maybe Internet speed may be a factor since the fonts are loaded only if needed?

i have years ago made my own version of this that fixes font issues seemlessly on firefox and it has always worked great for me. mind you that i man using a different set of fonts tho!
https://gist.github.com/sirati/3fa326ec9ef7461a4453f2a51c10abd7/raw/jitai.user.js

mind you this also may be a very old version but works for me

1 Like

Does it still work with the UI update?

I’m trying to get it to work, but it does nothing. I installed it using tampermonkey (v4.18.1 if that helps), and it doesn’t show up during reviews, while my other scripts do. Can anyone help with this?


Hey there!
There was a UI update last night, meaning userscripts are a bit mangled right now, usually developers don’t take too long before getting things in order, but it won’t work for the moment!

1 Like

OP isn’t here and the first post can’t be edited. Perhaps the latest one is by @marciska?

At least jQuery would need to be removed. Not sure about the CSS selector.

Also, maybe a new maintainer would want to ask Mod to change the first post into Wiki, or create a new thread?