photopea/Typr.js

letter-spacing

Closed this issue · 1 comments

Is there a way to add letter-spacing when I'm using Typr.U.stringToPath(font, str) like the letter-spacing in opentype.js?

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/letter-spacing

stringToPath is implemented here: https://github.com/photopea/Typr.js/blob/gh-pages/src/Typr.U.js#L187 . I would suggest adding a new line x+=5; under the line 204.

There are many ways of how users may want to render the text. That is why I haven't added many parameters of text rendering, but expected, that everybody would implement their own rendering functions (it should be realy easy), Typr.U is more like a guide of how to write such functions. Note, that stringToPath uses only standard, documented functions and nothing else.