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 request: kanji support #132

Closed
TowelSniffer opened this issue Aug 4, 2019 · 4 comments
Closed

Feature request: kanji support #132

TowelSniffer opened this issue Aug 4, 2019 · 4 comments

Comments

@TowelSniffer
Copy link

Is it possible that this will ever include Japanese characters?

@chanind
Copy link
Owner

chanind commented Aug 12, 2019

It should be doable - there's a Japanese dataset using the same format in https://raw.githubusercontent.com/parsimonhi/animCJK/master/graphicsJa.txt, just need to process it and get it into a CDN

@chanind
Copy link
Owner

chanind commented Aug 12, 2019

I put a repo up with Japanese data from animCJK here: https://github.com/chanind/hanzi-writer-data-jp. You can use this in Hanzi Writer via a custom charDataLoader function, like below:

HanziWriter.create('target-div', '私', {
  width: 400,
  height: 400,
  charDataLoader: (char, onLoad, onError) => {
    fetch(`https://cdn.jsdelivr.net/npm/hanzi-writer-data-jp@0/${char}.json`)
      .then(res => res.json())
      .then(onLoad)
      .catch(onError);
  }
})

This Japanese data is limited compared to the Chinese currently due to:

  • The data does not support radicals yet
  • The data does not have capped strokes, so there are sharp edges where strokes intersect

I'll work on tidying this up before making an official release in HanziWriter adding first-class support for this data. I also want to double-check with animCJK that using the data this way is alright.

This is also discussed in chanind/hanzi-writer-data#2

@TowelSniffer
Copy link
Author

TowelSniffer commented Aug 13, 2019 via email

@ganqqwerty
Copy link

ganqqwerty commented Nov 22, 2022

is there any update on this? I'd like to use it for the Anki cards for Japanese. For now we use the Hanzi, but every now and then the character is different.

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

3 participants