Skip to content

Take varied composite metrics from the component that uses its metrics - #423

Open
lehni wants to merge 4 commits into
foliojs:masterfrom
lineto:fix/use-my-metrics
Open

lehni wants to merge 4 commits into
foliojs:masterfrom
lineto:fix/use-my-metrics

Conversation

@lehni

@lehni lehni commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Vsevolod Volkov and others added 4 commits November 19, 2024 17:26
- Fix the vhea table structure
- Give empty glyphs zero coordinates instead of infinite ones
- Read the maxp, post and vhea versions as 16.16 version numbers
- Respect the useTypoMetrics flag for the font's ascent, descent and line gap, and add lineHeight
- Fix an undefined control box in the glyph metrics
- Use the typo metrics only when the font sets useTypoMetrics and the hhea metrics otherwise, with a positive ascent and a negative descent, as HarfBuzz does, instead of FreeType's fallbacks
- Drop lineHeight, which HarfBuzz doesn't have and clients can derive
- Expect HarfBuzz's vertical advance for Open Sans's space, which has no vmtx and doesn't set useTypoMetrics
- Add tests for the typo metrics, the vertical advance without vmtx, the vhea and maxp versions, and empty CFF glyph boxes, with HarfBuzz's values
- Put the bottom phantom point an advance below the top one, as the spec and HarfBuzz do, instead of above it, so gvar deltas vary the vertical advance in the right direction (foliojs#421)
- Add a test font derived from HarfBuzz's SourceSansVariable-Roman.modcomp.ttf without HVAR, so the advances come from the phantom points, renamed as the OFL reserves its name
- Expect HarfBuzz's vertical advance of 990 at wght 900
- A composite glyph's varied advances and bearings now come from the phantom points of its component with the useMyMetrics flag, as HarfBuzz does, instead of the composite's own
- Add a test with Ç from the phantom point test font, which now gets HarfBuzz's vertical advance of 990 instead of 962
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