UFO Color Marks not exported

post must be at least 20 characters.

nothing much else to say

v 789

Are you sure? It works for me. Where did you try to import the .ufo?

I opened it in Robofont, no colours, colours are there in Glyphs that’s fine but I need them in RF:

Looks like you are missing:

  <key>com.typemytype.robofont.mark</key>
  <array>
    <real>1.0</real>
    <real>1.0</real>
    <real>0.0</real>
    <real>1.0</real>
  </array>

That is because it is a private key. Glyphs exports it as:

  <key>com.schriftgestaltung.Glyphs.ColorIndex</key>
  <integer>0</integer>
  <key>public.markColor</key>
  <string>0.85,0.26,0.06,1</string>

In Robofont, you could write a script that reads com.schriftgestaltung.Glyphs.ColorIndex and imports it into a Robofont mark color.

This is code that transposes the Glyphs color marks into Robofont mark colors:

for g in CurrentFont().glyphs:
    try:
        colorString = g.lib['public.markColor']
        if colorString:
            rgbaValueList = [float(x) for x in colorString.split(",")]
            g.mark = rgbaValueList
        else:
            print "%s: No proper public.markColor set." % g.name
    except:
        print "%s: No color found." % g.name
        pass
1 Like

Thank you for your help!