Jitai (字体): The font randomizer that fits

Just reporting back after a few days and several hundred reviews, I’m really happy with this. I now need to find more fonts that would be a little more challenging. :slight_smile:

eninny said... Just reporting back after a few days and several hundred reviews, I'm really happy with this. I now need to find more fonts that would be a little more challenging. :)
 Idk, I thought this was pretty challenging: =\


ToastDefender said... Does anyone know which of the fonts this one is? I don't have a Japanese IME installed on this work computer so I can't test out my installed fonts in Word -_-

http://prntscr.com/af7gxf

I like most of the ones from the GitHub list, but I just really hate this one.
That's nagurigaki / nagurigaki-P. It's pretty gosh-darn ugly, actually, you're right... maybe I should remove it from the list.
eninny said... Just reporting back after a few days and several hundred reviews, I'm really happy with this. I now need to find more fonts that would be a little more challenging. :)
Thank you so much! I'm super happy you like it!

 
kurseddragon said... Idk, I thought this was pretty challenging: =\


 ARMED BANANA

Sankyu!!

obskyr said...
ToastDefender said... Does anyone know which of the fonts this one is? I don't have a Japanese IME installed on this work computer so I can't test out my installed fonts in Word -_-

http://prntscr.com/af7gxf

I like most of the ones from the GitHub list, but I just really hate this one.
That's nagurigaki / nagurigaki-P. It's pretty gosh-darn ugly, actually, you're right... maybe I should remove it from the list.
 Awesome, thanks! Great job on the script btw. Heading to Japan at the end of the month and I just realized about a week ago that different fonts mess me up really badly. Your script is a godsend! 

Ahh… I do not have armed banana installed. I guess my computer decided to stay classy. :wink:

I’m looking forward to giving this a try. I downloaded some really random Japanese fonts recently (from a link somwhere here that had fonts made from storefronts, it’s a pretty cool project and they had a video on YouTube) as well as from japanesefonts.com … So I think I’ve got some 10-odd random ones that didn’t come from installing my IME.

I also use xMunch’s reorder script, so I’d be interested in having the following problem looked at/fixed:

Amenophyckxs said…
I have the same issue as with the other font changer, whenever I reorder my reviews it stops cycling through the font list.
With the other font changer it starts out with one random font and it sticks to that random font after I reordered. This one changes to meiryo and never changes back. Would be nice if this gets fixed.
tested with reorder ultimate 2, and also with WK review order. 
Thank you for this amazing script! :smiley:

EDIT: I love how you gave walkthrough-like instructions on how to add the fonts in your code. XD (I had it open to check how long the list was, I will have to add my own, now to find them in my FONTS folder.) I seriously laughed at your 4 fake fonts. Love it! XD
EDIT 2: I’m adding some now, the project was the Noramoji Project. 2 of the 4 fonts I’ve added have that listed (Hirose and Tsuruya). The other two, don’t have any samples appearing… so I hope your blank thing making the font skip works if they’re not in fact Japanese fonts like I think. XD
EDIT 3: Yeah, I noticed it worked for a second (not even), and then as soon as the reorder box appeared below (I didn’t even touch it, merely it loaded) it switched to the usual font. I’m going to turn that off for now, because I want to play with this, but it would be lovely if you could get both to coexist happily. I’m using xMunch’s Wanikani Reorder Ultimate 2.

EDIT 4: Also after using it (it was pretty cool!) I kept coming to a font that looked identical to WK’s main font, only with a different spacing width (when you hover to switch/switch back, it just had the first kanji in vocabulary move back and forth). That font seemed to come up a lot. It looked to me like I was only seeing two, maybe three fonts (I mean including this identical font), and the fonts I had made sure to add into the list myself never did show up. (I only had 20 items, though… not the biggest sampling.)

An inelegant crop of my favorite font


AnimeCanuck said...I also use xMunch's reorder script, so I'd be interested in having the following problem looked at/fixed:

Amenophyckxs said... I have the same issue as with the other font changer, whenever I reorder my reviews it stops cycling through the font list.
With the other font changer it starts out with one random font and it sticks to that random font after I reordered. This one changes to meiryo and never changes back. Would be nice if this gets fixed.
tested with reorder ultimate 2, and also with WK review order. 
 I also use Reorder Ultimate 2, but do not have this issue. This got me wondering....
Those of you having this compatibility issue, are you using the 1X1 reordering feature? The only feature of the reorder that I use during reviews is to always be asked for 読み方 before 意味.

I don't claim to know for sure, but if you're using 1X1, maybe try without it so that you can also enjoy using both scripts together.

Best of luck, I hope that's helpful.

So for some reason this won’t work for me at all… Not sure why. I have several of the fonts installed. Even after disabling my other scripts to see if that would help it still didn’t work.

busaninja said...I don't claim to know for sure, but if you're using 1X1, maybe try without it so that you can also enjoy using both scripts together.

Best of luck, I hope that's helpful.
 I think I may have actually confirmed this one. I turned on the 1X1 feature and exited my reviews, then started reviews again with the feature already enabled and this reproduced the issue some of you are having (selecting a single alternate font for the first review and sticking with that font for subsequent reviews in the same session). Then, I disabled the 1X1 and exited again, restarted reviews and saw that font change on every item as it was intended.

Hopefully this helps the rest of you, too.

Yeah, but it doesn’t reorder unless you click force reorder and then it stops working.

Alluka-Sama said... So for some reason this won't work for me at all.. Not sure why. I have several of the fonts installed. Even after disabling my other scripts to see if that would help it still didn't work.
 Which OS and browser are you on...? And were you doing reviews and not lessons?

busaninja said...
busaninja said...I don't claim to know for sure, but if you're using 1X1, maybe try without it so that you can also enjoy using both scripts together.

Best of luck, I hope that's helpful.
 I think I may have actually confirmed this one.
embe said... Yeah, but it doesn't reorder unless you click force reorder and then it stops working.
 I took a look at the source of Ultimate Reorder 2, but couldn't find anything that would interfere. I didn't look very exhaustively, though, so I might try again sometime. Seeing as it stopped the other font script too, which was on a timer and not a WaniKani trigger, I wonder if it messes with JS execution or CSS (though I couldn't find any of that) somehow...

Thanks for the feedback. Hope you manage to fix it. Other than that, I love it. :slight_smile:

obskyr said... I took a look at the source of Ultimate Reorder 2, but couldn't find anything that would interfere. I didn't look very exhaustively, though, so I might try again sometime. Seeing as it stopped the other font script too, which was on a timer and not a WaniKani trigger, I wonder if it messes with JS execution or CSS (though I couldn't find any of that) somehow...
The Ultimate Reorder script cheekily overrides the implementation of Math.random() to always return 0 when 1x1 mode is selected.  It assigns the previous (true) implementation to Math.randomB before it does this.

I forked your gist and updated the shuffle function to use this workaround, and it works for me with and without the reorder script enabled:
https://gist.github.com/cplaverty/ceee98a407a0bdab5db7
1 Like

Works here too. Thanks a bunch!

cplaverty said...
obskyr said... I took a look at the source of Ultimate Reorder 2, but couldn't find anything that would interfere. I didn't look very exhaustively, though, so I might try again sometime. Seeing as it stopped the other font script too, which was on a timer and not a WaniKani trigger, I wonder if it messes with JS execution or CSS (though I couldn't find any of that) somehow...
The Ultimate Reorder script cheekily overrides the implementation of Math.random() to always return 0 when 1x1 mode is selected.  It assigns the previous (true) implementation to Math.randomB before it does this.

I forked your gist and updated the shuffle function to use this workaround, and it works for me with and without the reorder script enabled:
https://gist.github.com/cplaverty/ceee98a407a0bdab5db7
Can you explain what bit of code you changed to the lay people please! :-D

Ah, okay, even though I use the reorderscript sometimes, I’ve never used the 1x1-mode. I guess that’s why some people didn’t have any problems even though they used the reorderscript?

edit: I think  his change is probably line 126 and maybe something on 128 (only looked at the modified script and not the original right now)

var getRandomNumber = Math.randomB ? Math.randomB : Math.random;

Basically he tries to get a random number with randomB, and if he doesn"t get one he uses the usual random? :slight_smile:
edit2: actually my edit1 was too late, and the post below me was faster :stuck_out_tongue: just wanted to give him credits :slight_smile:

@EskimoJo Javascript comes with a default “random” function. The reorder script hijacks that function so it can trick WK into ordering how it wants, it adds a new random function named RandomB that uses the original functionality.

cplaverty just added a bit of code that makes it says “if RandomB exists, use that function instead because I know that will give me actual random instead of always 0.”

This allows the font chooser to actually get a random font instead of always the default. Note that these changes don’t scale too well if we start piling more scripts on so we may want to think about this moving forward but it’s fine for now.

1 Like