You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
text: Fetch line height metrics from the used font itself
We follow the process from [the CSS Inline Layout
module](https://www.w3.org/TR/css-inline-3/), specifically:
1. The default ascent and descent come from the `OS/2` font table, or
failing that, the `hhea` table, with final fallback to the
measurement we used to do.
2. If `linespacing` (cf line height in CSS) is normal, then we do as
before and size each line based on the maximum ascent/descent of its
contents. Additionally, apply the line gap from the font metrics as
half-leading around each line.
3. If `linespacing` is a float, then scale it by font size of the first
available font, and keep it fixed for each line.
However, if we are drawing a single line, then we do not add the line
gap around the line, to keep them a similar height as before.
0 commit comments