jdlorimer / chinese-support-redux

Anki add-on providing support for Chinese study
https://ankiweb.net/shared/info/1128979221
GNU General Public License v3.0
101 stars 50 forks source link

Add stroke order animation field #15

Open jdlorimer opened 5 years ago

jdlorimer commented 5 years ago

Original request: https://github.com/ttempe/chinese-support-addon/issues/68

p2635 commented 5 years ago

Is this just downloading a bunch of free images with gifs and then get it to autofill depending on the Hanzi field? Have you thought about how the solution would look?

jdlorimer commented 4 years ago

Pretty much, I think. The solution would be to have a mapping of Unicode character -> filename, which is probably work that has already been done. Licensing would be the only thing to check.

jay-pee commented 4 years ago

There is a project called hanzi-writer https://github.com/chanind/hanzi-writer You could implement the package like the implementation of mathjax for latex in anki. Basically the javascript package renders the stroke order. I would suggest you have a tag like:

[strokeorder]我[/strokeorder]

and then it renders the sign.

Have a look at the demo: https://hanziwriter.org/demo.html

I would have a look into that and make a pull request. @luoliyan are you open for that?

ghost commented 3 years ago

I added this for myself and wanted to share it, this probably isn't the cleanest way to do it but I just needed it to work (I am not sure if the config.json modification is conform to your style, let me know): https://github.com/benediktdreher/chinese-support-redux/commit/fc0d9c3a394f20fddeb57dd4c058bd4ed4526785 If the code is fine by you, I can open a PR. If not, this is a little hack for people who want it.

Usage: Create one or more fields "Stroke Order 1", "Stroke Order 2", etc. depending on how many characters in one word you want to allow, I left it at 4. Type in the Hanzi and hit Tab as usual. I fetch the .gif animation from an online resource: http://bishun.strokeorder.info/mandarin.php and paste the image source in, similar to how the TTS fetch works.

Here it is in action: strokeorder

Yoyopizzacat commented 1 year ago

are you still working on this?