Skip to content

Commit a1145ec

Browse files
committed
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.
1 parent 2d06da1 commit a1145ec

1,013 files changed

Lines changed: 20261 additions & 19405 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Binary file not shown.
-39 Bytes
Loading
1.01 KB
Loading
-908 Bytes
Loading
-138 Bytes
Loading
-295 Bytes
Loading
30 Bytes
Loading
122 Bytes
Loading
-6 Bytes
Loading
17 Bytes
Loading

0 commit comments

Comments
 (0)