I've developed a browser-based SVG font renderer: https://github.com/jvolker/svg-font-renderer It borrows a lot of code from this repository. Thanks for writing and sharing it. :)
Instead of using a modified version of this package, it would be great to use it as a dependency. Unfortunately, that's not possible at the moment, as hersheytextjs requires fs which is not available in the browser.
This is how I've adapted it to be used with SVG fonts in the browser: https://github.com/jvolker/svg-font-renderer/blob/master/src/lib/svgFontRenderer.js I've basically skipped fs and passed the SVG data directly from my main application.
Would be great to see this in the future. 👍
I've developed a browser-based SVG font renderer: https://github.com/jvolker/svg-font-renderer It borrows a lot of code from this repository. Thanks for writing and sharing it. :)
Instead of using a modified version of this package, it would be great to use it as a dependency. Unfortunately, that's not possible at the moment, as
hersheytextjsrequiresfswhich is not available in the browser.This is how I've adapted it to be used with SVG fonts in the browser: https://github.com/jvolker/svg-font-renderer/blob/master/src/lib/svgFontRenderer.js I've basically skipped
fsand passed the SVG data directly from my main application.Would be great to see this in the future. 👍