-
Notifications
You must be signed in to change notification settings - Fork 12
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
Some heisig primitives cannot be displayed #175
Comments
This comment was marked as duplicate.
This comment was marked as duplicate.
@MinmoTech The Migaku Kanji Database Excel sheet lists each primitive as a single Unicode character so to use also non-Unicode primitives we would need a way to address them in the database and then map those into custom font for viewing. I propose to use brackets to enclose a keyword assigned to the primitive. Example: I haven't looked yet how the font files are composed and indexed. Do we need a separate custom font file for each new primitive? |
@MinmoTech I've made some progress using the great RTK index and copying their list of primitives and associated SVGs, and then filtering out all of those that have Unicode representation. This leaves us a collection of 65 non-Unicode primitives that we have now nice images for. With few modifications I'm able to now create distinct cards for these missing primitives and reference those from other kanjis that use them. This is possible with the [primitive_name] addressing scheme explained above. If a character has this format, it will be converted to a image link for visual representation. The SVGs are a bit too small though.. .. and currently show up in wrong color. I've made a script that modifies kanji.db with external .tsv file to add these missing primitives and then recalculates references from kanjis to primitives. I've manually added few select kanjis (such as for the 'tribe' above), but a lot of manual work has to be done to go through the main list and add all the rest. I'll need to do some tidying but I'll put the code later into my repository. |
MAKE COPY OF kanji.db BEFORE TESTING db_merge_tsv.py !! :) |
@mjuhanne Sorry for taking so long to respond, this looks pretty great! I actually started working on fixing this issue myself While working on it I noticed how large the effort that still needs to go in and couldn't justify the time commitment at the time so the work had kinda stalled again. This is the font I used in case it helps you out: Pangolin_font für Heisig Primitive.zip (not sure if it's the same one you are using) Are you on our discord server btw? :) You can find me on there as "Julius", you can contact me there if you ever want quicker feedback from me about something. Also do you want to open a PR with your changes? |
How would I go about testing this? Are there any good resources on how to build it into an Anki plugin or perhaps a pre-compiled plugin I can install somehow? |
@calculuschild IMPORTANT! Do make a backup of the 1872210448 and especially its user_files/ directory. Also it's wise to export all your Anki stacks using File | Export.. before testing, just in case something goes horribly wrong :) |
@mjuhanne Ok, I finally had a chance to download your repository. I backed up the original elsewhere and then overwrote it with yours. Anki goes through a "refreshing cards" step. In all, the cards already look so much cleaner, especially the scrambled primitive references and missing story entries. Some observations:
|
@calculuschild Thank you for testing! Those with existing decks will have a bit nuisance because of the orphan cards (renamed '-'). I would be very hesitant adding code to remove cards from users' decks, so it is just best to Suspend the card whenever one comes across it (there are only a handful of those anyway). When it comes to the non-Unicode primitives, I don't think KanjiVG database has to stroke order graphic for those. I'll have to research later how to create them. For the other cards, they should work. You aren't seeing this? You mean the stroke order graphic is broken in EVERY card or just those that use the new primitives? |
That's fair.
Do you know if the Kanji GOD addon itself has some function to just re-scan for missing cards? I seem to remember if I add new vocab to my vocab deck, Kanji GOD is supposed to detect that and generate new Kanji cards. It just doesn't seem to be happening in this case, or I'm not finding the right button.
EVERY card. You can see my screenshot above of the "cottage" card. It doesn't show the stroke order that yours shows. Do I need to install some other dependency? |
@calculuschild Ok that is weird, I cannot reproduce your findings.
I tried even both Qt5 and Qt6 versions of Anki with same results. If you really want to get your hands dirty, you could try the AnkiWebView Inspector to see if there's some weird Javascript error that prevents showing the stroke graphics. The normal version supports inspecting only the card windows, but I've made a patch to enable inspecting also the Lookup window |
@calculuschild Hold on, I came across the same problem now. Will investigate. |
@calculuschild Ok, found out the culprit. I think you're missing the 'addon/kanjivg' directory and its contents (the actual svg files containing the stroke graphics). I don't know how the installation procedure invokes the command to download the separate kanjivg repository but you can do it manually:
|
@mjuhanne OK, that looks like it was probably the issue; I manually installed using your script, then moved it into the One weird thing; not sure if it matters. In the card browser, there is a weird Also, while the cards now show the stroke order on my Android and in the card lookup tool on PC, they don't show up when doing normal study on PC. I assume this is not you but some weird Anki caching issue since Android is working fine. This is honestly really really great. You're doing (Kanji) God's work. Hoping they merge your PR soon. |
These character require a custom font that we can use:
Ideally we would have a design for each of our existing fonts.
Example with all fonts:
The text was updated successfully, but these errors were encountered: