googlefonts / ufomerge

ufomerge
Apache License 2.0
11 stars 3 forks source link

Subset of kern groups #17

Closed aaronbell closed 11 months ago

aaronbell commented 1 year ago

I am merging one UFO into another with a reduced character set (as in, it is being subsetted).

The UFO being merged in has a kerning group like the following:

    <key>public.kern1.i</key>
    <array>
      <string>igrave</string>
      <string>icircumflex</string>
      <string>i</string>
      <string>palochka-cy</string>
      <string>iacute</string>
      <string>idieresis</string>
    </array>

And the one it is merging into has one list this:

    <key>public.kern1.idotless</key>
    <array>
      <string>i</string>
      <string>idotless</string>
      <string>idotless_dotbelowcomb</string>
      <string>idotless_ogonekcomb</string>
      <string>iacute</string>
      <string>ibreve</string>
      <string>icircumflex</string>
      <string>idblgrave</string>
      <string>idieresis</string>
      <string>idotaccent</string>
      <string>idotbelow</string>
      <string>igrave</string>
      <string>ihookabove</string>
      <string>iinvertedbreve</string>
      <string>imacron</string>
      <string>iogonek</string>
      <string>itilde</string>
      <string>i.alt</string>
      <string>idieresis.alt</string>
      <string>idotaccent.alt</string>
      <string>i-cy</string>
      <string>yi-cy</string>
      <string>i-cy.alt</string>
      <string>yi-cy.alt</string>
      <string>i-cy.loclBSH</string>
    </array>

As you can see, there is some overlap between the two wherein the ufolib validator becomes concerned and issues an error as the same glyph is in two different kern groups.

The subsetting process does not appear to be subsetting the kern groups during the merge process but rather just keeps entire kern groups if it contains a glyph from the subset list.

I think I can disable the UFO validator and make it work, but would be better if it didn't merge everything together.