Need Help Understanding Line Wrapping Difference Between Browsers and TextMeasurer #367
-
A specific sentence, in a specific font (Courier Prime Regular), wraps to 3 lines in a given width in modern browsers (Chrome and Firefox tested), but TextMeasurer counts only 2 lines. HTML
C#
Console Output
Am I missing any other options to set? My understanding is that modern browsers and this library should match. The difference ends up being (looking at the layout generated internally by |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
I think it simply boils down to accuracy. We measure the glyph points to determine wrapping and if the glyph (before rasterization) fits in those bounds it will not get wrapped. Wrapping positions is determined by the algorithm defined by UAX14 and pass all the provided tests so there are no issues there. Maybe the browser is less accurate? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Today!! 🎉