Lemmmy / KanjiSchool

Alternative web client for WaniKani
https://kanji.school
GNU Affero General Public License v3.0
16 stars 2 forks source link

Feature ideas: Random fonts and phonetic components #8

Open MartiiDev opened 1 year ago

MartiiDev commented 1 year ago

Hey, it's me again! Again, I love your app, I've been using it for weeks without returning even once to WaniKani. Back on WK I had 2 userscripts that were quite useful and that would be a good addition to Kanji School (I think).

  1. Random fonts for reviews (less indispensable but useful): Could be enabled in settings Useful since kanji often appear with different fonts in real life, so it's better to get used to it as early as possible

  2. Phonetic/semantic components in kanji page (would be really useful): That's really helpful to remember the pronunciation in lots of kanjis since it's not always obvious that a radical gives its pronunciation to a kanji. Ex: 仲's pronunciations (チュウ / なか) come from 中 which is the phonetic component. I believe most of the data needed for this would be in the WK userscript already so there wouldn't be a lot of work on that side.

I'd love to help and do a PR but unfortunately I still have trouble understanding TypeScript. I can live without these features, but that'd be a nice improvement, I think.

Lemmmy commented 1 year ago

Two fantastic ideas! The font idea came up during development actually, but I didn't get round to implementing it as the font files have a tendency to be huge (upwards of hundreds of MBs, so preloading them adds a lot to load time). I think if it's off by default it can work - I'm sure the userscript manages this fine too.

For #2 are you takling about the Keisei userscript? I'm not too familiar with the userscript, or phonetic-semantic composition in general, but I can definitely take a look into this.

My backlog is currently filled up until the new year but hopefully I can take a look at these some time after that. Feel free to bump this at any time too!

MartiiDev commented 1 year ago

Awesome, and I was expecting your backlog to be quite filled up anyway!

For the fonts you could maybe have three options:

For the second one I was indeed talking about the Keisei userscript. I'm not too sure about how those phonetic/semantic components work but I know that it has been quite helpful to me so far, so I don't think I'll be able to help on that.

I'll try to look at your code to see if I understand how it works so that I can give some help. And I'll need to learn how github works as well since I don't know a lot about PRs for example.

Lemmmy commented 1 year ago

Status update on this; I haven't forgotten! I've been working on the random fonts feature today. I've run out of time to finish it but it should be done soon.

image

image

image

Much like the Jitai userscript, KanjiSchool will pick fonts that are available on your system from a sensible set of defaults, and more can be installed manually if desired. It only shows random fonts in reviews. When picking a random font for a review, it will check if the font can actually render the characters. When hovering over the characters, it shows the default font (this behavior can be disabled).

MartiiDev commented 1 year ago

That looks perfect, exactly like I had imagined! Can't wait to try it out when you will be done!

Lemmmy commented 1 year ago

Random fonts has landed in v1.3.0! Go to Settings -> Font settings to enable.

MartiiDev commented 1 year ago

First of all, that's awesome! Thanks for the work!

Now I was wondering, does the app automatically detects the Japanese fonts on my system or do I need to input the name of each font? It would also be nice to show the supported font at the top of the list, especially if you have lots of fonts. image

One last thing, if the app can detect the Japanese fonts on the user's system, wouldn't it be possible to just put a list of all the supported fonts with a toggle next to each of them? It seems much more straight-forward for users than having to write the font's names

Lemmmy commented 1 year ago

I'm not aware of any way to automatically detect Japanese fonts on the system, which is why the Jitai userscript comes with a set of defaults for each operating system, and a variety of other recommended fonts. The font list you see there is a predefined list of fonts - some for Windows, some for Mac, some for Linux, and some other popular fonts. For any font not in the list, you will have to add it manually, this is just a limitation browsers have to work with!