Jitai (字体): The font randomizer that fits

I see, that’s interesting! I’ve still disabled the font for now as I don’t know if it’s a great use of time to learn too many kanji variations at this stage of my learning. I don’t mind the ones that look “messy” as long as the individual radicals are recognizable, but this one threw me for a loop.

2 Likes

Yeah, that is certainly valid.

On the site you can also see at which level you would have to know the Kanji variant in the 漢検 (a test for Kanji for Japanese people) and apparently it only becomes relevant around 準1 which is a level ordinary Japanese can’t pass without study. So I think your way is the way to go ^^.

2 Likes

栄 is the 新字体 (shinjitai, new character body) of 榮 (旧字体, ancient character style).

Other than in old printed texts you may find the ancient forms in calligraphy or signs.
Note the new form are just an adaptation in printed typefaces of centuries old semicursive (行書) handwriting.

It is quite consistent.
榮螢營勞 => 栄蛍営労.
Note that those “three dots on roof” can have a different origin:
學覺 => 学覚
( In simplified Chinese they adapted to printed typefaces the centuries old cursive 草書 handwriting style, and kept the distinction of those series:
榮螢營勞 => 荣萤营劳
學覺 => 学觉 )

You don’t need to “learn different kanji (variations)” but only the variation of a single component, and it can be applied to all kanji using it.
Remember, only a few kanji are actually whole units, the overwhelming majority are just compositions of smaller components.
I don’t think you need to “study” it, having seen it thanks to that font, and with the explanations in this thread, I am quite sure you will now be able to recognize any ancient variant of a kanji using those components that you already know.

5 Likes

Thank you :slight_smile: It didn’t work at first, but then closed and reopened and it worked. Thx! :slight_smile:

Which WaniKani app for iOS ships with Jitai? Does it work on iPad?

I posted about this here in the Item Inspector thread, but it really impacts Jitai: it seems that you simply cannot access locally-installed (non-system-standard) fonts in Safari/WebKit anymore without defaults modifications (though if you followed a macOS upgrade path, you may have had that turned on for you). Just webfonts and system-default fonts. And to subvert “font fingerprenting attacks”, this issue is going to spread to other browsers soon, too.

That would make Jitai in its current incarnation much less useful: Windows, macOS and most Linux and mobile distributions come with a Mincho, a Gothic, and a Rounded font, but beyond that you’re out of luck.

It seems like the longer-term solution is to support webfonts. Since we can’t upload webfonts to WaniKani, they would have to be in a public repository like Google Fonts.

1 Like

I’m clicking install and nothing happens, i dont have this issue with other scripts :frowning:

There is already a script that does this:

1 Like

I feel like I need to learn JavaScript (well, DOM manipulation; I know some JavaScript and enough other languages that the JS itself isn’t an issue) to pull these features together; I vastly prefer Jitai to the webfont script and it feels like Jitai should be modifiable…

Oh well, Mincho + Rounded + the standard Gothic is probably good enough, at least until I’ve gotten on in levels enough to want to learn to read bushed/semi-cursive versions of complex characters. (I took a Japanese calligraphy class once, so weirdly I can read full cursive better than printed brushlike or semi-cursive!) Like, I was at one time befuddled in telling, for instance, the “tsunami” radical from the “ice” radical in Mincho, but now I’ve seen them enough in WaniKani + Jitai that it’s no issue anymore—like knowing ‘a’ (assuming your font here shows ‘a’ as the “double-storey” type) and ‘ɑ’ as two ways to write the same English letter.

Still, I’ll try my Google contacts to see if they can find someone who could suggest how the stroke-order font might be added to their public repo.

2 Likes

does anyone know the font used in Genki books and if it is available for download?

1 Like

There is a font called “kyokasho font” which you can download (just google that term and you’ll find plenty). I am not 100% sure that Genki actually uses that font, but I would be surprised if they didn’t, as that’s what it’s made for, as the name says :wink:

1 Like

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?