Character Variant names of cv16 are partially replaced by those in cv20

I am currently testing the opentype code in my font. An issue I have recently encountered is that the text for c16’s options have been partially replaced by those of cv20 in certain applications when using the exported font.

1
cv16 is used to modify the look of the invisible braille dots, while cv20 has been set up as a opentype test using a few of the dingbats that has been drawn.

For some reason the text of the options in cv16 that should say Small, Ring, Numeral and Line has been replaced by the corresponding first four text strings from cv20.

No issues can be seen in the feature code.

The file can be sent if neccesary.

In which applications have you tried? As far as I know, the Affinity apps have some long-standing issues in showing cv## features.

You can send us the file (private message here on the Forum or support at this domain) and we will have a look.

Sent.

This is an issue with the Affinity app. Glyphs writes the names correctly to the name table of the OpenType file and uses those names only for the intended features and lookups.

One clue might be that the Affinity app incorrectly uses the names in order of the name table and not in the order that they are assigned in the GSUB table. In the name table, the names appear in the order Variants of Raised Braille Text, Blank, Small, Ring, Numeral, Line, Variants of Lowered Braille, Filled, Variants of cross, Celtic, White, Heavy, Orthodox, Lorraine, Shadowed White. That matches the order in the UI.

So, the Affinity app addresses the names not by ID but by name index, therefore the app is making an incorrect assumption that the cv## feature names are written in a specific way in the name table. The app should be using name IDs, not name indices.

Thanks, that was really insightful.

I guess the only thing to do here would be to file a report to them regarding this then.

From how you are describing it, it seems like Affinity’s implementation of CVs caused issues due to two of my font’s CV’s sharing feature names.

Sharing names between CV features is a dangerous thing :wink: But I don’t think it’s your fault, maybe the exported name table actually shares the name IDs between different features. That won’t work, because the CV feature only stores the first name ID and the number of glyph variants that follow, each with its own name.

So if two CVs partially have the same names, but a different number of variants, that will probably go wrong. But it’s a problem of how those names are stored in the name table, not a problem in user input.

Could you send me your glyphs file and font, so I can see if my suspicion is correct?

Sure, I’ll send it sometime today

Thank you! It seems my hunch was correct. If I look at the name table …

Bildschirmfoto 2022-08-23 um 16.19.24

… the names for “Variants of Lowered Braille” are missing except for the one that is different from the ParamUILabelNames for “Variants of Raised Braille”.

This is how the name table entries are referenced in the GSUB table:

      <FeatureRecord index="531">
        <FeatureTag value="cv15"/>
        <Feature>
          <FeatureParamsCharacterVariants Format="0">
            <Format value="0"/>
            <FeatUILabelNameID value="302"/>  <!-- Variants of Raised Braille -->
            <FeatUITooltipTextNameID value="0"/>
            <SampleTextNameID value="0"/>
            <NumNamedParameters value="5"/>
            <FirstParamUILabelNameID value="303"/>  <!-- Blank -->
          </FeatureParamsCharacterVariants>
          <LookupListIndex index="0" value="84"/>
        </Feature>
      </FeatureRecord>
      <FeatureRecord index="532">
        <FeatureTag value="cv16"/>
        <Feature>
          <FeatureParamsCharacterVariants Format="0">
            <Format value="0"/>
            <FeatUILabelNameID value="308"/>  <!-- Variants of Lowered Braille -->
            <FeatUITooltipTextNameID value="0"/>
            <SampleTextNameID value="0"/>
            <NumNamedParameters value="5"/>
            <FirstParamUILabelNameID value="309"/>  <!-- Filled -->
          </FeatureParamsCharacterVariants>
          <LookupListIndex index="0" value="85"/>
        </Feature>
      </FeatureRecord>

A tool parsing the font has only the first name ID (FirstParamUILabelNameID, e.g. 303) and the number of following entries (NumNamedParameters, e.g. 5) to go on. But for CV16, there is only one entry for named parameters, before the names for the next CV feature start.

So Affinity keeps reading and uses “Variants of cross” etc. as the names for CV16.

Affinity is not at fault, it is a bug in the way the name table is built by Glyphs.

How did I guess? I’ve written a script to add CV names to a finished font and have experienced similar problems :wink:

Thanks for the update. That cleared some more things up.

Does that mean that it would be possible to have it fixed in Glyphs then?