googlefonts / googlefonts/fontmake
Empty name entry generated if elidable="true" in Designspace v5 <label>
- Dominant language
- Python
- Stars
- 888
- Forks
- 97
- Avg merge
- 4d 52m
- Merged PRs (30d)
- 1
Description
## Context
I’m building a family that has two variable fonts: a roman and an italic, each with 5 weight instances.
I’m using Designspace version 5.0 to setup both subfamilies in one document, including STAT information. This is amazing, and FontMake is handling it wonderfully overall.
I have a [`labels` element](https://fonttools.readthedocs.io/en/latest/designspaceLib/xml.html#labels-element-top-level) set up in my Weight axis, which is built into a STAT table that looks good. Here’s from my designspace:
```xml
```
This results in a STAT table that seems to look great, including this entry for the Regular weight instance:
```xml
```
In my Designspace, I’m specifying two variable fonts:
```xml
```
However, I may have found one glitch.
## Problem
If I include `elidable="true"` in the label element for the Regular instance at 400, an empty entry appears in the resulting font’s name table:
```xml
Light
Familyname-Light
Familyname-Regular
Medium
Familyname-Medium
Semibold
Familyname-Semibold
Bold
Familyname-Bold
```
Further, the `fvar` table looks like this (notice the missing `` comment – this is copied directly from a ttx output):
```xml
wght
0x0
300.0
300.0
700.0
269
```
If I simply remove the `elidable` attribute from the Regular label, name 272 changes to `Regular`, and the fvar table outputs in an expected way.
```
```
```xml
Regular
Familyname-Regular
```
In FontBakery, including `elidable="true"` in the designspace label triggers the following `FAIL`s (these don’t happen without `elidable="true"`):
🔥 FAIL: Check name table for empty records. (com.adobe.fonts/check/name/empty_records)
>
>Check the name table for empty records, as this can cause problems in Adobe apps.
>
* 🔥 **FAIL** "name" table record with key=(1, 0, 0, 272) is empty and should be removed. [code: empty-record]
* 🔥 **FAIL** "name" table record with key=(3, 1, 1033, 272) is empty and should be removed. [code: empty-record]
🔥 FAIL: The variable font 'wght' (Weight) axis coordinate must be 400 on the 'Regular' instance. (com.google.fonts/check/varfont/regular_wght_coord)
>
>According to the Open-Type spec's registered design-variation tag 'wght' available at https://docs.microsoft.com/en-gb/typography/opentype/spec/dvaraxistag_wght
>
>If a variable font has a 'wght' (Weight) axis, then the coordinate of its 'Regular' instance is required to be 400.
>
* 🔥 **FAIL** The "wght" axis coordinate of the "Regular" instance must be 400. Got None instead. [code: wght-not-400]
## Expectation
As far as I understand it, the only change I should expect from including `elidable="true"` should be a flag in the `AxisValue` entry of the STAT table. Indeed, this does work well for the STAT table.
...but I doubt it should create the empty `name` table entry.
Perhaps making Regular elidable isn’t actually necessary, or expected on FontMake’s end? I don’t get FontBakery fails when I don’t set the elidable flag, even though I was under the impression that it was a good flag to set for the Regular instance. For now, I will skip it.
If I am doing something wrong, I will very much appreciate learning about it! Otherwise, hopefully this helps improve FontMake a little further.
Contributor guide
Assessment
This issue has not been assessed yet.