Metrics scope filters set OS/2 values to zero

I want to see the cap-hight metric in the edit view for all glyphs. (Glyphs 3 does not show it by default for some glyphs such as small letter.) Therefore, I followed this advise:

I added a scope filter to the “Cap Height” which matches all glyphs whose name is not the empty string, effectively matching all glyphs:

This works; the cap-height metric is displayed for every glyph. The side-effect is that the sCapHeight value in the OS/2 table of the exported OTF is set to 0.

This side-effect appears when adding a scope filter to

  • “Cap Height” (sCapHeight → 0),
  • “x-Height” (sxHeight → 0), and
  • “Descender” (sTypoDescender → 0).

Adding a scope filter to “Ascender” does not affect sTypoAscender in my testing.

I used TTX to look at the OS/2 values, like so:

$ ttx -qo - -t OS/2 Test-Regular.otf | xpath -q -e '//sCapHeight'
<sCapHeight value="0" />

Without the scope filter on “Cap Height”:

$ ttx -qo - -t OS/2 Test-Regular.otf | xpath -q -e '//sCapHeight'
<sCapHeight value="700" />

Test file: Test.glyphs (6.0 KB)

You need at least one “default” set of metric. I see if I can make that more lenient.

How would I go about adding a “default” set of metrics? Duplicate the metrics which are filtered like here:?

Perhaps a ‘universal’ checkbox in the dialog?

I still don’t understand the intended purpose of scope filter. Are they purely for the editing view, or is the change in OS/2 values intentional, if somewhat unexpected?

The scope filters are there for two reasons

  • Give you the ability to add metrics guides to some glyphs (superscript numbers)
  • One some point this can be used to make a BASE table and export multiple font dicts (in CID and CFF2)

In that case a simple universal-checkbox would suffice for my use.

1 Like

I would add a “Other” metric and give it the Name “x-Height” with a filter to show only where needed. That will look the same but will not interfere with the vertical metrics export