Adds support for letter spacing#2066
Conversation
|
Hi @kennethormandy , and thank you for working on this subject. I was waiting for this for the last 2 years. |
|
@jtuffier Glad it was useful for you! My guess would be that the underlying version of Chromium, depending on what version of Electron you’re using, might not support the letter spacing feature yet. So it’s like you’re viewing it in an older browser. The links in the PR description should still be relevant for that. |
|
@kennethormandy You were right, I was using the latest version for development (v33.0.0), but once my application was packaged I was using Electron v8.2.4. After updating the Electron dependency to v33.0.0 for my packaged application ,it works like a charm. Many thanks for your great support. |
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:
letterSpacingonly 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 likeleadingandjustificationin thattrackingwould be the more expected name within Paper.js.Related issues
Checklist
yarn run jshintpasses)Thanks for considering this, and for all the great work on this library over the years!