Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There can be two color palette layers with the same color #1002

Open
schriftgestalt opened this issue Apr 27, 2024 · 3 comments
Open

There can be two color palette layers with the same color #1002

schriftgestalt opened this issue Apr 27, 2024 · 3 comments
Assignees

Comments

@schriftgestalt
Copy link
Collaborator

as seen in this example:
Bildschirmfoto 2024-04-27 um 19 52 03

Using glyphs2ufo produces this output:

Bad Color Bold: Glyph A, layer color.0: Duplicate glyph layer name
Bad Color Thin: Glyph A, layer color.0: Duplicate glyph layer name

and this layer mapping (it appends a '#' to make the name unique):

<key>com.github.googlei18n.ufo2ft.colorLayerMapping</key>
      <array>
        <array>
          <string>color.0</string>
          <integer>0</integer>
        </array>
        <array>
          <string>color.1</string>
          <integer>1</integer>
        </array>
        <array>
          <string>color.0 #1</string>
          <integer>0</integer>
        </array>
      </array>

So it is not sufficient to use GSLayer.name as layer names in the ufos.

@khaledhosny
Copy link
Collaborator

Do you have a test font?

@schriftgestalt
Copy link
Collaborator Author

@khaledhosny
Copy link
Collaborator

The handling of color layers was supposed to be applied only when minimal=True (the thinking back then was that it is a ufo2ft-specefic feature so it was enabled only when minimal mode is enabled which is used when building UFOs with ufo2ft), but it seems that it is now partially applied when minimal=False:

$ glyphs2ufo ColorComponents.glyphs
Bad Color Bold: Glyph A, layer color.0: Duplicate glyph layer name
Bad Color Thin: Glyph A, layer color.0: Duplicate glyph layer name
Bad Color Thin: Glyph Aacute, layer color.0: Duplicate glyph layer name
Bad Color Bold: Glyph Aacute, layer color.0: Duplicate glyph layer name

And no warnings with:

$ glyphs2ufo --minimal ColorComponents.glyphs

I suggest we enable the handling of color layers unconditionally, since this seems to be a source of problems (e.g. googlefonts/gftools#740).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants