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

adding a getCharacterData() method for easier access to loaded character data #223

Merged
merged 1 commit into from
Mar 2, 2021

Conversation

chanind
Copy link
Owner

@chanind chanind commented Mar 2, 2021

This PR adds a method writer.getCharacterData(), which returns a promise containing the parsed character data after it's loaded. This is to provide a more usable method to get info about the currently loaded character without needing to do anything hacky around reading internals like writer._character. This promise will always return the character data or error if it's not possible.

This character data contains the currently loaded character symbol (ex ), and an array of strokes containing the stroke data needed to render the character. This is probably most useful to determine how many strokes there are in the character.

related to #222

@chanind chanind changed the title adding a getCharacterData() method for easier loading of character data adding a getCharacterData() method for easier access to loaded character data Mar 2, 2021
@chanind chanind merged commit 3766a8b into master Mar 2, 2021
@chanind chanind deleted the get-character-data-method branch March 2, 2021 21:13
@chanind
Copy link
Owner Author

chanind commented Mar 2, 2021

🎉 This PR is included in version 3.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant