Skip to content
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

Multi-line labels have extra vertical spacing with some characters #6997

Closed
schmidtk opened this issue Sep 3, 2018 · 4 comments
Closed

Multi-line labels have extra vertical spacing with some characters #6997

schmidtk opened this issue Sep 3, 2018 · 4 comments

Comments

@schmidtk
Copy link

schmidtk commented Sep 3, 2018

The measureText call calculates odd heights/descents for some characters. On macOS/Chrome the letter M is measured taller than it should be. From inspection, it looks like the canvas has extra empty space at the top. This results in multi-line labels having unnecessary spacing between lines.

screen shot 2018-09-03 at 11 47 24 am

On Linux/Chrome I was seeing similar behavior but with 4 having a height of 17 (most characters were 11) and N having a descent of 2.5 (most characters were 0.5). The end result in repositionAllGlyphs was a much larger max line height (19.5) than expected and very spread out label lines.

Use this gist to reproduce:
https://gist.github.com/schmidtk/77c64471dc9e7170b18a344c238c4700

@ggetz
Copy link
Contributor

ggetz commented Sep 4, 2018

Thanks @schmidtk for tracking this down!

Related #378?

@schmidtk
Copy link
Author

schmidtk commented Sep 4, 2018

I did look at that a bit, and I believe this is a separate issue with the same library. It happens with native browser fonts and doesn't seem to be related to font loading.

@hpinkos
Copy link
Contributor

hpinkos commented Sep 19, 2019

This appears to be fixed

image

@hpinkos hpinkos closed this as completed Sep 19, 2019
@schmidtk
Copy link
Author

@hpinkos Confirmed in our app as well, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants