-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Line break refactoring in preparation for bidirectional text support. #3725
Conversation
31cbcab
to
2bad8cc
Compare
@ChrisLoer is this going to be incorporated into this PR? #3658 (comment) Solving the line-breaking issue with |
401abe8
to
5e10967
Compare
@nickidlugash As you mentioned in #3658 (comment), the parentheses issue will probably go beyond the scope of this PR, although I'm happy to start working on a separate PR for that issue. |
lineBreakPoints.forEach(lineBreak => { | ||
lines.push(text.substring(start, lineBreak)); | ||
start = lineBreak; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a for (const lineBreak of lineBreakPoints) { ... }
loop here instead of forEach
.
427195f
to
48818e7
Compare
* Separates line-breaking logic from glyph placement * Adds U+2027 "Interpunct" to ideographic breaking character set * Trims whitespace from beginning and end of line before calculating width for alignment purposes. * Fixes a crash on labels that generated lines with a single whitespace glyph.
48818e7
to
8408313
Compare
Separates line-breaking logic from glyph placement. Introduces a few small behavior changes:
shaping.test.js updated to reflect invisible behavior changes (e.g. invisible glyphs no longer added to shaping).
cc @lucaswoj @jfirebaugh @mollymerp @1ec5