chinese-support-redux icon indicating copy to clipboard operation
chinese-support-redux copied to clipboard

Add stroke order animation field

Open jdlorimer opened this issue 6 years ago • 5 comments

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

jdlorimer avatar Oct 27 '18 05:10 jdlorimer

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?

p2635 avatar Jul 26 '19 20:07 p2635

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.

jdlorimer avatar Dec 16 '19 10:12 jdlorimer

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?

jay-pee avatar Apr 30 '20 10:04 jay-pee

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

ghost avatar Jan 11 '21 11:01 ghost

are you still working on this?

Yoyopizzacat avatar May 16 '23 10:05 Yoyopizzacat