Question about STAT axis value tables

are they implemented/possible in Glyphs?

I was thinking it could be hard to implement because there arent defined userspace labels for axis locations. E.g. if there is a font with family name MyFont with a preferred name MyFont 72pt Condensed and a stylename of Thin, or a variable style name of 72pt Condensed Thin, you’d have to infer a lot to know that the userspace name for optical size is supposed to be “72pt,” no?

here is an example of all the designspace 5 axis elements together:

<axes elidedfallbackname="Regular">
    <axis default="1" maximum="1000" minimum="0" name="weight" tag="wght">
        <labelname xml:lang="fa-IR">قطر</labelname>
        <labelname xml:lang="en">Wéíght</labelname>
        <labels>
            <label userminimum="200" uservalue="200" usermaximum="250" name="Extra Light">
                <labelname xml:lang="de">Extraleicht</labelname>
                <labelname xml:lang="fr">Extra léger</labelname>
            </label>
            <label userminimum="350" uservalue="400" usermaximum="450" name="Regular" elidable="true" />
        </labels>
    </axis>
    <axis default="100" maximum="200" minimum="50" name="width" tag="wdth">
        <map input="50.0" output="10.0" />
        <map input="100.0" output="66.0" />
        <map input="200.0" output="990.0" />
    </axis>
</axes>

If we look at the line <label userminimum="200" uservalue="200" usermaximum="250" name="Extra Light"> that is an Axis Label Descriptor. if I understand right, this means if you were to add more axes, it would want to know that 72pt is the userspace name along the optical axis, even though it doesn’t exist on its own So if we imagine an optical axis labeled by point size:

<axis default="1" maximum="1000" minimum="0" name="Weight" tag="wght">
    <labels>
         ...
        <label userminimum="100" uservalue="200" usermaximum="900" name="ExtraLight"/>
        <label userminimum="100" uservalue="300" usermaximum="900" name="Light"/>
         ...
    </labels>
</axis>
<axis default="16" maximum="72" minimum="8" name="Optical size" tag="opsz">
    <labels>
         ... 
        <label userminimum="8" uservalue="24" usermaximum="72" name="24pt"/>
        <label userminimum="8" uservalue="72" usermaximum="72" name="72pt"/>
         ...
    </labels>
</axis>

there isn’t a predictable way to know that the label.name should be 72pt or whatever arbitrary value on a given axis. Which to me, makes me think there should be a new customParam on the instances that gets a specific userspace name for each individual instance.axes location? Because right now all we have is internal location (72 instead of 72pt in this example, or Display instead of 72, etc).

Does this question make any sense, or have I completely misunderstood what designspaceLib 5 is offering? I wouldn’t bet against the latter, personally :sweat_smile:

Aren’t those labels something like named instances?

yes it’s similar, but it’s just the name of a point on the axis, not a combination of points. I think the idea of named instances are handled elsewhere by LocationLabelDescriptor in designspacelib 5

I think the axis value table names are supposed to be userspace/user-facing names for any point (not whole coordinates) along an axis: STAT — Style Attributes Table (OpenType 1.9) - Typography | Microsoft Docs

imagine a menu that has “Width” and all possible widths and “Optical size” and all possible optical sizes, etc — names, not values — even though, as a practical matter, you’d cant have an optical size without also having a width (and there are elidable properties for when you dont)

The STAT table only defined points per axis. The instances in Glyphs have coordinates for all axes but they are used to calculate the STAT labels. It should work if you add instances with the desired names. Set all coordinates to the default masters position and only change the values for the size axis.

We are working on improving the STAT table setup.

2 Likes

You could maybe add a GUI and include both named instances and these per-axis location labels too, maybe in some kind of grid or set of columns

There are a few places you can infer this axis label name value, for example if you have a subfamily name, but if you have many axes it becomes a problem to not have a defined scheme for the order of the multiple axis label locations that make up a full family and style name — in a font name “Bold” might come last, when wght might actually be my first axis. So instead, I think ideally the label name order would be the same as in instance.axes, so that it could be keyed on the same index like every other axis in the Glyphs API