googlefonts / axisregistry

A Python API to access data from the Google Fonts variable fonts Axis Registry.
Apache License 2.0
27 stars 11 forks source link

[name builder] bug with postcript name #139

Closed RosaWagner closed 1 year ago

RosaWagner commented 1 year ago

Wavefont's postscript name is "WavefontDefaultDefault", my guess is that this is due to default being on missing fallback from the axis registry:

Wavefont is overwriting the default for ROND and YELA, instead of 0 it chooses 100 and -100 respectively. This is allowed thanks to the registry_default_overrides entry in METADATA.pb. And it works fine in the API. Although, since those are not defined fallbacks in the axis registry, I think the builder is not considering 'Default' as being an elided value and thus include it in the postscripts names?

<name>
    <namerecord nameID="25" platformID="1" platEncID="0" langID="0x0" unicode="True">
      WavefontDefaultDefault
    </namerecord>
    <namerecord nameID="256" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Roundness
    </namerecord>
    <namerecord nameID="257" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Vertical Element Alignment
    </namerecord>
    <namerecord nameID="258" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Weight
    </namerecord>
    <namerecord nameID="259" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Thin
    </namerecord>
    <namerecord nameID="260" platformID="1" platEncID="0" langID="0x0" unicode="True">
      ExtraLight
    </namerecord>
    <namerecord nameID="261" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Light
    </namerecord>
    <namerecord nameID="262" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Regular
    </namerecord>
    <namerecord nameID="263" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Medium
    </namerecord>
    <namerecord nameID="264" platformID="1" platEncID="0" langID="0x0" unicode="True">
      SemiBold
    </namerecord>
    <namerecord nameID="265" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Bold
    </namerecord>
    <namerecord nameID="266" platformID="1" platEncID="0" langID="0x0" unicode="True">
      ExtraBold
    </namerecord>
    <namerecord nameID="267" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Black
    </namerecord>
    <namerecord nameID="268" platformID="1" platEncID="0" langID="0x0" unicode="True">
      WavefontDefaultDefault-Thin
    </namerecord>
    <namerecord nameID="269" platformID="1" platEncID="0" langID="0x0" unicode="True">
      WavefontDefaultDefault-ExtraLight
    </namerecord>
    <namerecord nameID="270" platformID="1" platEncID="0" langID="0x0" unicode="True">
      WavefontDefaultDefault-Light
    </namerecord>
    <namerecord nameID="271" platformID="1" platEncID="0" langID="0x0" unicode="True">
      WavefontDefaultDefault-Regular
    </namerecord>
    <namerecord nameID="272" platformID="1" platEncID="0" langID="0x0" unicode="True">
      WavefontDefaultDefault-Medium
    </namerecord>
    <namerecord nameID="273" platformID="1" platEncID="0" langID="0x0" unicode="True">
      WavefontDefaultDefault-SemiBold
    </namerecord>
    <namerecord nameID="274" platformID="1" platEncID="0" langID="0x0" unicode="True">
      WavefontDefaultDefault-Bold
    </namerecord>
    <namerecord nameID="275" platformID="1" platEncID="0" langID="0x0" unicode="True">
      WavefontDefaultDefault-ExtraBold
    </namerecord>
    <namerecord nameID="276" platformID="1" platEncID="0" langID="0x0" unicode="True">
      WavefontDefaultDefault-Black
    </namerecord>
    <namerecord nameID="277" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Default
    </namerecord>
    <namerecord nameID="0" platformID="3" platEncID="1" langID="0x409">
      Copyright 2022 The Wavefont Project Authors (https://github.com/dy/wavefont)
    </namerecord>
    <namerecord nameID="1" platformID="3" platEncID="1" langID="0x409">
      Wavefont Thin
    </namerecord>
    <namerecord nameID="2" platformID="3" platEncID="1" langID="0x409">
      Regular
    </namerecord>
    <namerecord nameID="3" platformID="3" platEncID="1" langID="0x409">
      3.004;DY  ;Wavefont-Thin
    </namerecord>
    <namerecord nameID="4" platformID="3" platEncID="1" langID="0x409">
      Wavefont Thin
    </namerecord>
    <namerecord nameID="5" platformID="3" platEncID="1" langID="0x409">
      Version 3.004
    </namerecord>
    <namerecord nameID="6" platformID="3" platEncID="1" langID="0x409">
      Wavefont-Thin
    </namerecord>
    <namerecord nameID="13" platformID="3" platEncID="1" langID="0x409">
      This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is available with a FAQ at: https://scripts.sil.org/OFL
    </namerecord>
    <namerecord nameID="14" platformID="3" platEncID="1" langID="0x409">
      https://scripts.sil.org/OFL
    </namerecord>
    <namerecord nameID="16" platformID="3" platEncID="1" langID="0x409">
      Wavefont
    </namerecord>
    <namerecord nameID="17" platformID="3" platEncID="1" langID="0x409">
      Thin
    </namerecord>
    <namerecord nameID="25" platformID="3" platEncID="1" langID="0x409">
      WavefontDefaultDefault
    </namerecord>
    <namerecord nameID="256" platformID="3" platEncID="1" langID="0x409">
      Roundness
    </namerecord>
    <namerecord nameID="257" platformID="3" platEncID="1" langID="0x409">
      Vertical Element Alignment
    </namerecord>
    <namerecord nameID="258" platformID="3" platEncID="1" langID="0x409">
      Weight
    </namerecord>
    <namerecord nameID="259" platformID="3" platEncID="1" langID="0x409">
      Thin
    </namerecord>
    <namerecord nameID="260" platformID="3" platEncID="1" langID="0x409">
      ExtraLight
    </namerecord>
    <namerecord nameID="261" platformID="3" platEncID="1" langID="0x409">
      Light
    </namerecord>
    <namerecord nameID="262" platformID="3" platEncID="1" langID="0x409">
      Regular
    </namerecord>
    <namerecord nameID="263" platformID="3" platEncID="1" langID="0x409">
      Medium
    </namerecord>
    <namerecord nameID="264" platformID="3" platEncID="1" langID="0x409">
      SemiBold
    </namerecord>
    <namerecord nameID="265" platformID="3" platEncID="1" langID="0x409">
      Bold
    </namerecord>
    <namerecord nameID="266" platformID="3" platEncID="1" langID="0x409">
      ExtraBold
    </namerecord>
    <namerecord nameID="267" platformID="3" platEncID="1" langID="0x409">
      Black
    </namerecord>
    <namerecord nameID="268" platformID="3" platEncID="1" langID="0x409">
      WavefontDefaultDefault-Thin
    </namerecord>
    <namerecord nameID="269" platformID="3" platEncID="1" langID="0x409">
      WavefontDefaultDefault-ExtraLight
    </namerecord>
    <namerecord nameID="270" platformID="3" platEncID="1" langID="0x409">
      WavefontDefaultDefault-Light
    </namerecord>
    <namerecord nameID="271" platformID="3" platEncID="1" langID="0x409">
      WavefontDefaultDefault-Regular
    </namerecord>
    <namerecord nameID="272" platformID="3" platEncID="1" langID="0x409">
      WavefontDefaultDefault-Medium
    </namerecord>
    <namerecord nameID="273" platformID="3" platEncID="1" langID="0x409">
      WavefontDefaultDefault-SemiBold
    </namerecord>
    <namerecord nameID="274" platformID="3" platEncID="1" langID="0x409">
      WavefontDefaultDefault-Bold
    </namerecord>
    <namerecord nameID="275" platformID="3" platEncID="1" langID="0x409">
      WavefontDefaultDefault-ExtraBold
    </namerecord>
    <namerecord nameID="276" platformID="3" platEncID="1" langID="0x409">
      WavefontDefaultDefault-Black
    </namerecord>
    <namerecord nameID="277" platformID="3" platEncID="1" langID="0x409">
      Default
    </namerecord>
  </name>

cc @m4rc1e

m4rc1e commented 1 year ago

Just genned the font using the latest axis registry. I get the following which looks correct:

<?xml version="1.0" encoding="UTF-8"?>
<ttFont sfntVersion="\x00\x01\x00\x00" ttLibVersion="4.41">

  <name>
    <namerecord nameID="256" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Roundness
    </namerecord>
    <namerecord nameID="257" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Vertical Element Alignment
    </namerecord>
    <namerecord nameID="258" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Weight
    </namerecord>
    <namerecord nameID="259" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Thin
    </namerecord>
    <namerecord nameID="260" platformID="1" platEncID="0" langID="0x0" unicode="True">
      ExtraLight
    </namerecord>
    <namerecord nameID="261" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Light
    </namerecord>
    <namerecord nameID="262" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Regular
    </namerecord>
    <namerecord nameID="263" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Medium
    </namerecord>
    <namerecord nameID="264" platformID="1" platEncID="0" langID="0x0" unicode="True">
      SemiBold
    </namerecord>
    <namerecord nameID="265" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Bold
    </namerecord>
    <namerecord nameID="266" platformID="1" platEncID="0" langID="0x0" unicode="True">
      ExtraBold
    </namerecord>
    <namerecord nameID="267" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Black
    </namerecord>
    <namerecord nameID="268" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Default
    </namerecord>
    <namerecord nameID="0" platformID="3" platEncID="1" langID="0x409">
      Copyright 2022 The Wavefont Project Authors (https://github.com/dy/wavefont)
    </namerecord>
    <namerecord nameID="1" platformID="3" platEncID="1" langID="0x409">
      Wavefont Thin
    </namerecord>
    <namerecord nameID="2" platformID="3" platEncID="1" langID="0x409">
      Regular
    </namerecord>
    <namerecord nameID="3" platformID="3" platEncID="1" langID="0x409">
      3.004;DY  ;Wavefont-Thin
    </namerecord>
    <namerecord nameID="4" platformID="3" platEncID="1" langID="0x409">
      Wavefont Thin
    </namerecord>
    <namerecord nameID="5" platformID="3" platEncID="1" langID="0x409">
      Version 3.004;gftools[0.9.28.dev9+g7d2139d.d20230707]
    </namerecord>
    <namerecord nameID="6" platformID="3" platEncID="1" langID="0x409">
      Wavefont-Thin
    </namerecord>
    <namerecord nameID="13" platformID="3" platEncID="1" langID="0x409">
      This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is available with a FAQ at: https://scripts.sil.org/OFL
    </namerecord>
    <namerecord nameID="14" platformID="3" platEncID="1" langID="0x409">
      https://scripts.sil.org/OFL
    </namerecord>
    <namerecord nameID="16" platformID="3" platEncID="1" langID="0x409">
      Wavefont
    </namerecord>
    <namerecord nameID="17" platformID="3" platEncID="1" langID="0x409">
      Thin
    </namerecord>
    <namerecord nameID="25" platformID="3" platEncID="1" langID="0x409">
      Wavefont
    </namerecord>
    <namerecord nameID="256" platformID="3" platEncID="1" langID="0x409">
      Roundness
    </namerecord>
    <namerecord nameID="257" platformID="3" platEncID="1" langID="0x409">
      Vertical Element Alignment
    </namerecord>
    <namerecord nameID="258" platformID="3" platEncID="1" langID="0x409">
      Weight
    </namerecord>
    <namerecord nameID="259" platformID="3" platEncID="1" langID="0x409">
      Thin
    </namerecord>
    <namerecord nameID="260" platformID="3" platEncID="1" langID="0x409">
      ExtraLight
    </namerecord>
    <namerecord nameID="261" platformID="3" platEncID="1" langID="0x409">
      Light
    </namerecord>
    <namerecord nameID="262" platformID="3" platEncID="1" langID="0x409">
      Regular
    </namerecord>
    <namerecord nameID="263" platformID="3" platEncID="1" langID="0x409">
      Medium
    </namerecord>
    <namerecord nameID="264" platformID="3" platEncID="1" langID="0x409">
      SemiBold
    </namerecord>
    <namerecord nameID="265" platformID="3" platEncID="1" langID="0x409">
      Bold
    </namerecord>
    <namerecord nameID="266" platformID="3" platEncID="1" langID="0x409">
      ExtraBold
    </namerecord>
    <namerecord nameID="267" platformID="3" platEncID="1" langID="0x409">
      Black
    </namerecord>
    <namerecord nameID="268" platformID="3" platEncID="1" langID="0x409">
      Default
    </namerecord>
  </name>

</ttFont>

I don't see the default default. Perhaps you solved it in https://github.com/dy/wavefont/pull/57

RosaWagner commented 1 year ago

Ah thanks @m4rc1e, indeed the repo has this requirement pinged: gftools<0.9.15 and the font are build through actions, which means axis registry was not updated either?