Skip to content

Conversation

@MatthewScholefield
Copy link

From my understanding, the extra pixels above the top of the letters should be baseline - cap_height not ascent - cap_height since baseline typically refers to the render position of the bottoms of the letters.

Also, it looks like we fall back to ascent if the cap_height doesn't exist, but I think it still makes sense to subtract the extra top pixels in this case.

Feel free to let me know if I'm misunderstanding anything here since this is based mostly on my interpretation of the code and general font rendering terminology.

For reference, here are the values for Consolas:

LineMetrics { ascent: 14.0, descent: 4.0, cap_height: 9.0, leading: 0.0, baseline: 14.0, offset: 0.0, advance: 0.0, trailing_whitespace: 0.0 }

From my understanding, the extra pixels above the top of the letters should be `baseline - cap_height` not `ascent - cap_height` since `baseline` typically refers to the render position of the bottoms of the letters.

Also, it looks like we fall back to ascent if the cap_height doesn't exist, but I think it still makes sense to subtract the extra top pixels in this case.

Feel free to let me know if I'm misunderstanding anything here since this is based mostly on my interpretation of the code and general font rendering terminology.

For reference, here are the values for `Consolas`:
```
LineMetrics { ascent: 14.0, descent: 4.0, cap_height: 9.0, leading: 0.0, baseline: 14.0, offset: 0.0, advance: 0.0, trailing_whitespace: 0.0 }
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant