Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature ideas: Random fonts and phonetic components #8

Open
MartiiDev opened this issue Dec 13, 2022 · 7 comments
Open

Feature ideas: Random fonts and phonetic components #8

MartiiDev opened this issue Dec 13, 2022 · 7 comments

Comments

@MartiiDev
Copy link

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
Copy link
Owner

Lemmmy commented Dec 14, 2022

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
Copy link
Author

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

For the fonts you could maybe have three options:

  • Disabled (default)
  • Loading fonts from the user's computer (faster I think but the user must install the fonts they want on their device)
  • Loading fonts from the internet (heavier but easier)

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
Copy link
Owner

Lemmmy commented Feb 9, 2023

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
Copy link
Author

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

@Lemmmy
Copy link
Owner

Lemmmy commented Feb 10, 2023

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

@MartiiDev
Copy link
Author

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
Copy link
Owner

Lemmmy commented Feb 10, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants