https://github.com/arrowtype/test-fontmake-rules-overlap
A reproduction case for a glyphsLib / FontMake issue
https://github.com/arrowtype/test-fontmake-rules-overlap
Last synced: 23 days ago
JSON representation
A reproduction case for a glyphsLib / FontMake issue
- Host: GitHub
- URL: https://github.com/arrowtype/test-fontmake-rules-overlap
- Owner: arrowtype
- License: other
- Created: 2025-01-15T17:48:14.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-15T18:35:00.000Z (about 1 year ago)
- Last Synced: 2025-10-24T10:36:57.981Z (5 months ago)
- Size: 175 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FontMake /ufo2ft issue
A reproduction case for a FontMake (but really ufo2ft) issue (and partly also an issue in glyphsLib?).
Core issue: https://github.com/googlefonts/ufo2ft/issues/852
Font outlines based on Open Sans (https://github.com/googlefonts/opensans).
## Problem
It is common to up “bracket layers” in Glyphs, in order to create alternate glyphs shapes for certain areas of a typeface’s designspace. For example, it is common to remove the middle bar of a `$` for bolder weights.
Currently, generating from a Glyphs document to static fonts has unexpected results, where certain fonts will have the wrong version of a glyph. This is partially caused by two issues:
1. glyphsLib creates more rules than strictly necessary: it creates one rule for each area mentioned in any bracket layer, then places all glyphs with alternates in that area into each rule. This is slightly redundant, but shouldn’t cause a failure in the build.
2. ufo2ft inteprets redudant rules in a way that toggles them off and on, in static font builds. Variable font builds work well.

The above issues come from a `rules` element like this:
```xml
```
The “working” example comes from a `rules` element like this (with redundant rules removed):
```xml
```
## Reproduction
First, generate a UFO+designspace:
```
glyphs2ufo '01-src/ExampleSans.glyphs' --output-dir '02-glyphs2ufo'
```
Then, build fonts:
```
fontmake -o variable -m '02-glyphs2ufo/ExampleSans.designspace' --output-dir '03-fonts'
fontmake -o otf -i -m '02-glyphs2ufo/ExampleSans.designspace' --output-dir '03-fonts'
```
Finally, open fonts in Font Goggles (or similar) and preview glyphs `$฿Ø`.
## The fix, sort of
If the redundant rules are removed, the static fonts generate with the expected substitutions.
However, this shouldn’t be necessary to generate fonts with expected glyph forms, so it would be much better for this issue to be fixed in FontMake (or in the appropriate library repsponsible for interpolating static fonts from a designspace – maybe ufo2ft?)