Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request adds support for letter spacing, via the growing support for the canvas letter spacing property, and the existing support in SVG.
letter-spacing
: ~96% browser supportletterSpacing
: ~76% browser support (not supported in Safari)All browser tests are passing, including some new ones for this feature.
Example
API considerations
I’d be interested in getting your feedback on a couple of possible adjustments, @lehni:
letterSpacing
only accept a number that’s intended to be relative to the font size, like0.2
, rather than a value with units, like'10px'
? Ie. Treat all values like ems? This appears to be what OpenType.js does, and it feels like the better way to use it to me.tracking
, and use integers? I tend to prefer the CSS-like names, but it feels a bit likeleading
andjustification
in thattracking
would be the more expected name within Paper.js.Related issues
Checklist
yarn run jshint
passes)Thanks for considering this, and for all the great work on this library over the years!