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

Parse SVG files to include paths data into dmak repo #12

Closed
mbilbille opened this issue Jun 9, 2014 · 3 comments
Closed

Parse SVG files to include paths data into dmak repo #12

mbilbille opened this issue Jun 9, 2014 · 3 comments

Comments

@mbilbille
Copy link
Owner

Suggested by @boberman here https://twitter.com/tangorin/status/474534212595245056 i order to minimize storage and maximize loading time.

Sample: convert 0672c.svg:

<path id="kvg:0672c-s1" kvg:type="" d="M20.5,33.5c1.93,0.62,4.91,1.07,8.1,0.75C42.43,32.88,66,30.75,79.64,30c3.2-0.18,7.22,0.25,9.23,0.5"/>

into:

stroke = {
  groups: [ 'kvg:0672c-s1 ' ],
  path: "M20.5,33.5c1.93,0.62,4.91,1.07,8.1,0.75C42.43,32.88,66,30.75,79.64,30c3.2-0.18,7.22,0.25,9.23,0.5",
  text: {
    value: 1,
    x: 13.50,
    y: 34.50
  }
};

TO TRY: to put all of this data into one single unique file

@mbilbille
Copy link
Owner Author

TO TRY: to put all of this data into one single unique file
No a good idea, result file is definitively too big

@mbilbille
Copy link
Owner Author

Gave some thoughts about it. I think it will be best to create a dedicated Node module (a then a separate Github project) which will handle this task.

@mbilbille
Copy link
Owner Author

@boberman Here is the alpha version of kvg2js https://github.com/mbilbille/kvg2js, to parse KanjiVG files into JS objects. You will need then to implement your own custom loader to load them into dmak.

The best way to use those files will be to have a back-end service which takes a word as argument and merge data into ONE single JS file.

Still some work to do but hope this help :)

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

No branches or pull requests

1 participant