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

Line height too tall? #4

Open
quincylvania opened this issue Aug 8, 2024 · 4 comments · May be fixed by #6
Open

Line height too tall? #4

quincylvania opened this issue Aug 8, 2024 · 4 comments · May be fixed by #6
Labels
bug Something isn't working

Comments

@quincylvania
Copy link

We're using the Americana font stack over at OpenTrailMap and have run into some issues with the default line height. It seems that it may be too tall, as text is not centered on lines by default. This results in unequal padding when offsetting text from a line, depending on whether it's rendered above or below the line. This behavior is the same in both Firefox and Safari.

Screenshot 2024-08-06 at 6 50 12 PM

screenshot_2024-08-06_at_6 53 27___pm_720

@claysmalley claysmalley added the bug Something isn't working label Aug 8, 2024
@1ec5
Copy link
Member

1ec5 commented Aug 8, 2024

I wonder if this is a consequence of including Thai and Vietnamese in the same fontstack. Pan-Unicode fonts tend to have tall line heights for this reason (especially if the font format lacks a mechanism for ascender height above cap height).

@ZeLonewolf
Copy link
Member

I've been debugging this, and I suspect the problem is actually with the space character being too tall.

@1ec5
Copy link
Member

1ec5 commented Aug 22, 2024

In 1ec5/maplibre-gl-js#1, I was finding that GL JS hard-codes a line height from Arial Unicode MS regardless of the font and ended up removing these fudge factors when implementing all-local text rendering: 1ec5/maplibre-gl-js@b6df63e. Arial Unicode MS is the default font when text-font is unspecified, but it’s notorious for its excessive line height (to accommodate Thai and Vietnamese somewhat naïvely).

@ZeLonewolf
Copy link
Member

We are pulling the space character from GothicA1-regular. When I move that character to NotoSans700, I'm seeing some bad behavior go away.

Example from another project of proper spacing:

image

@ZeLonewolf ZeLonewolf linked a pull request Aug 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants