Closed Awendel closed 2 years ago
Im not sure why these wouldn't work. This library takes in the ctx "as is" and uses it to perform measurement.
My bad, read the example code wrong - yes by passing on ctx object this should be taken care of. One could think about offering a polyfill for Firefox etc. - will probably be a while before it lands. letterSpacing and wordSpacing shouldn't be too hard to compute based on how many displayChars and wordSeperators are inside a given line. I understand of course if its out of scope for this lib to polyfill canvas behaviour
Chrome has recently released new font properties for the Canvas API:
https://developer.chrome.com/blog/canvas2d/
Important aspects:
all these would affect the line breaking algorithm
.measureText() does incorporate these already, so would be great to add it to your library