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

Possibility of rendering only the first n strokes of a character? #76

Closed
hcoohb opened this issue Apr 6, 2018 · 5 comments
Closed

Possibility of rendering only the first n strokes of a character? #76

hcoohb opened this issue Apr 6, 2018 · 5 comments

Comments

@hcoohb
Copy link

hcoohb commented Apr 6, 2018

Hi,

This library looks great and thanks for writing and sharing it !

I am aiming at generating some practice sheets that display stroke order on the left side.
While looking at the documentation, I could not find a straightforward way to render a fixed image of the character with only one stroke first, then with the first 2 strokes, then the first 3 strokes …
Is that something that could be done easily with this library? And if so, is it also possible to have the last stroke displayed as a different colour ?

Thanks and regards,
Fabien

@chanind
Copy link
Owner

chanind commented Apr 8, 2018 via email

@chanind
Copy link
Owner

chanind commented Apr 25, 2018

v0.11.0 added 2 static methods HanziWriter.loadCharacterData(character) and HanziWriter.getScalingTransform(width, height) which should make it easier to do what you're talking about here. The docs on this are here: https://chanind.github.io/hanzi-writer/docs.html#raw-character-svg. There's also an example there of how to use these methods to do stroke fanning.

Closing this issue for now. If this isn't what you were looking to do we can reopen this issue again.

@chanind chanind closed this as completed Apr 25, 2018
@hcoohb
Copy link
Author

hcoohb commented Apr 26, 2018

That is perfect !!!
Exactly what I needed
Thank you so much for implementing those features!

@hugolpz
Copy link
Collaborator

hugolpz commented Apr 26, 2018

I love to functionality! Thanks @chanind for the code sample. 😁

Also, after a quick 5 mins online search, I noticed some solid html+svg to pdf js libs. It thus open the way to export pdf in order to print smart writing pad for paper-based studies. I collected some ideas there but it deserves a dedicated project I think.

@chanind
Copy link
Owner

chanind commented Apr 27, 2018

@hcoohb 😀Glad it worked out! It was a great feature request!

@ALL:

Also, after a quick 5 mins online search, I noticed some solid html+svg to pdf js libs. It thus open the way to export pdf in order to print smart writing pad for paper-based studies. I collected some ideas there but it deserves a dedicated project I think.

That's a really cool idea! I hadn't thought about generating paper worksheets, but I don't see why it wouldn't be possible to autogenerate worksheets like that using this SVG data.

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