WaniKani random font

mungouk said... I'm also seeing text in the answer field being changed to something pretty crummy -- is it using the same font as the Kanji?  (ie. the question, big character)

Or do we have to experiment to find script-type fonts that also have decent Roman glyphs?

Thanks
Yes, the script will change both the kanji prompt and the text in the answer field to the same font.  Unfortunately, as you've seen, a lot of them have pretty poor support for Latin characters.  You could experiment with fonts, but it's time consuming and your options become somewhat more limited when you need to find those that are legible in both English and Japanese.  

If you're fine with making a small edit to the script, you can keep the answer field in the default language but keep the randomized kanji appearance by opening up the script and removing ", #user-response" near the bottom of the script.  By doing that, you can choose whatever fonts you like without worrying about whether or not you'll be able to read your answers as you type them.

Hope that helps.

The script isn’t working for me either. I’ve made sure the fonts are written correctly and I’ve also tried disabling all my other scripts but there doesn’t seem to have been any conflicts.

It works and is really good.
Just to clarify to the people that say it doesn’t work. It doesn’t change all the time. I think it changes once every 3-5 kanji.

I am currently looking for a font to simulate the more handwritten style you find in manga’s.
Any suggestions are welcome.

It changes the font every 60 seconds and if the font listed in the script is nowhere to be found on the computer then it shows the default font. In other words if there are listen 10 fonts and you have only two, the default font will be displayed for a long time. Maybe that’s why people seem to think it doesn’t work. Time can be easily edit in the script.

embe said... It changes the font every 60 seconds and if the font listed in the script is nowhere to be found on the computer then it shows the default font. In other words if there are listen 10 fonts and you have only two, the default font will be displayed for a long time. Maybe that's why people seem to think it doesn't work. Time can be easily edit in the script.
Maybe for some but in my case that's definitely not it since I've made sure I do have all the fonts I have listed and have been doing WK so much lately that even if I were missing all but one, the last one should have appeared at least once by now. :x

Can someone make a mirror link? The website seems to be down.

Please somebody, this site is no longer working. Would like to use this.

The link in the OP seems to be down. After @GangsterOfBoats reposted the script in the Complaints thread, I decided to host it on Greasyfork.

https://greasyfork.org/en/scripts/16567-wanikani-random-font


I installed it, and I think it is technically working, the font is changing in the input box, and I can see it changing when I inspect the page, but the kanji itself is not changing. Anyone else having this issue? I turned off all other user scripts as well.

I think the problem is for some reason I cannot effect the Japanese on the page, I applied everything to the body, all of the English is changing, but the Japanese will not change. I even copy and pasted this into a .htm file and it works. No other user scripts running I am using chrome windows 7 and taper monkey, I give up

      <span lang=“ja” style=“font-family: ‘EPSON 正楷書体M’;”>さ暗記</span>

It works fine in firefox, i hate evertyhing

Aw, that really sucks. I looked and it’s working for both Firefox and chromium on my end.

At first I thought it wasn’t working as well, but I updated Firefox and then everything was fine.
Keep in mind I only included three fonts, which your computer may not have. I simply cannot test it because I don’t use Windows (or the real Chrome).

I’ll update it now with more fonts and a shorter interval time, so that font changes are more frequent.

All Windows users should read the previous pages for all fonts working on their system (and how to download new ones)!

https://greasyfork.org/en/scripts/16567-wanikani-random-font

Heh, half an hour ago I look and the font doesn’t change and I think what the hell?! It always worked… then I look at the code and see that my fonts have been replaced.  :P

Following somebody’s tip I have removed ‘user-response’ from the script, but the script still changes fonts there. Any other way to disable it?

embe said... Following somebody's tip I have removed 'user-response' from the script, but the script still changes fonts there. Any other way to disable it?
 Yea, removing 'user-response' will only make the meaning show up normal. But when you need to give the reading, that's still in Japanese (selected by
[lang="ja"] ).

If you only want the font of the question to change, replace line 27 (the same one where you deleted 'user-response') with

$('#character span').css('font-family', chosen).hover(function() {
(changes are in bold)


I’d need a guide for how to install it to Tampermonkey, how to Tampermonkey, how to use script. A detailed guide for someone who has never touched a PC.

/t/Visual-Guide-on-How-To-Install-A-Userscript/12136/1

I am really liking this script but i was curious if there is a way to adjust the font size?

You can change the size of the font by installing the extension Stylebot (Google Chrome), then:
Click Stylebot icon > Open Stylebot > select part of the screen you want to change > in the bar on the right change the font size

I had to replace #user-response with #character.kanji in the script in order for it to work…
But other than that: Great!
Thank you so much! :slight_smile:


Assirra said... I am really liking this script but i was curious if there is a way to adjust the font size?
What do you want to adjust the size of?  I'm assuming it's the question kanji.  If that's the case, and you don't want to install a separate extension, you can edit the random font script in greasemonkey/tampermonkey, adding this:

$('#character').css({ 'line-height': 2, 'font-size': 200 });
on its own line after "setInterval(randomFont, interval * 1000);" but before the "});" at the very end of the script).

To explain that line, it finds the UI element that contains the vocab/kanji/radical prompt and sets its font size to 200 pixels, while making the whole element twice as tall as the text it contains.  The text stays centred right in the middle.  

Changing the number after "line-height" will adjust the height of the prompt area (the part with the coloured background) proportional to the text it contains, such that that area is roughly font-size x line-height pixels tall.  Tweak this if you want to make that whole area larger or smaller.  

Changing the number after "font-size" will, you guessed it, change the font size.  Play around with it until you find the size you're looking for.  For a rough guide, 200 is more or less double the default size for vocab questions.

You can adjust the sizes of different item types independently by adding a few different lines like that one above using "#character.kanji", "#character.vocabulary", or "#character.radical"* in place of "#character".

Sorry for the wall of text but, I hope that helps.


* Citation needed on this one, since I don't have any radicals to review to check it, but it should be correct.

Thanks for that, it worked perfectly.
Did lower the font to 30 to make it still readable but more comparable to real world text.

I found that even tough i knew the kanji when huge on my screen i had troubles distinguishing it on smaller text.