-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
support CSS line-height for Label font #8954
Conversation
Thanks for the pull request @nmschulte!
Reviewers, don't forget to make sure that:
|
@@ -407,7 +407,7 @@ function repositionAllGlyphs(label) { | |||
horizontalOrigin, | |||
backgroundPadding | |||
); | |||
var lineSpacing = defaultLineSpacingPercent * maxLineHeight; |
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.
I question why line-spacing is based upon the maximum glyph height instead of the font-size.
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.
Not quite sure either. Your calculation looks fine, but we just need to make sure letters than go below the base like like 'y' and 'g' don't overrun tall letters like 'T' on the line below it
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.
The existing logic causes multi-line label "heights" to only be as tall as the tallest character in the string, instead of a fixed height based upon the font-size (which is how I understand CSS font-size
to work).
So label with text _\n_\n_\n_
renders with effectively small "line-heights" compared to one with text M\nM\nM\nM
.
eb79777
to
8cdca14
Compare
8cdca14
to
f10b971
Compare
changes multi-line Label line-spacing basis from per-label max-glyph-height to font-size
f10b971
to
a82c896
Compare
Thanks again for your contribution @nmschulte! No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with |
1 similar comment
Thanks again for your contribution @nmschulte! No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with |
@hpinkos is there anything I can do to get this included? Does the breaking/behavior change need more clarification, or just some close attention for consideration? |
@nmschulte sorry, I just haven't had the bandwidth to get back to this. @kring or @lilleyse would you have time to review? |
This seems like a good change to me. I tried a bunch of things and didn't run into any problems. Thanks @nmschulte! |
maxLineHeight
(understood as "line's max glyph height", excl.s spacing) and how it interacts withotherLinesHeight
("height of other lines", incl.s spacing) andtotalLineHeight
("height of all lines", incl.s spacing); I think some of this codes should simply always use the specified font-size -- this implicates how the background is drawn, and the present logic specializes on the first or last line to avoid an "extra" line-spacing