googlefonts / googlefonts/fontc

static fonts from single-master sources have overlaps, skewing glyf ttx diff

Open
#975 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
193
Forks
21
Avg merge
1d 20h
Merged PRs (30d)
60

Description

Following #971, ttx_diff.py now invokes fontmake `-o ttf` instead of `-o variable` when the input source contains only one master, in order to avoid fontmake adding unnecessary empty/noop variable tables (https://github.com/googlefonts/fontmake/issues/1125).

But fontmake `-o ttf` also passes the source through the ufo2ft's [remove overlaps filter](https://github.com/googlefonts/ufo2ft/blob/main/Lib/ufo2ft/filters/removeOverlaps.py) (using booleanOperations by default, or skia-pathops if requested via `--overlaps-backend pathops`).

fontc being variable-first font compile does not attempt nor support removing the overlaps (as it would destroy master compatibility for a VF target).

Therefore comparing fontc-built single-master sources vs fontmake-built ones will usually produce several glyph diffs in glyph-related tables like glyf, maxp, etc. because the number of outline points when glyphs contain overlapping contours will be different between the two fonts.

For example, take this test font, containing only one glyph "T" with overlapping contours, and compare it with ttx_diff.py:

[SingleMaster.glyphs.zip](https://github.com/user-attachments/files/17203384/SingleMaster.glyphs.zip)

```diff
--- build/default/fontc.ttf
+++ build/default/fontmake.ttf
@@ -12,12 +12,12 @@



-
+




-
+



@@ -53,7 +53,7 @@



-
+



@@ -169,12 +169,10 @@



-
-
+


-
-
+



```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.