laerm0 / opensans

Open Sans font
Apache License 2.0
3 stars 3 forks source link

bracket layers are hiding somewhere #13

Closed laerm0 closed 5 years ago

laerm0 commented 5 years ago

OpenSans-Italic.glyphs has bracket layers stuck somewhere inside it.

fontmake -g OpenSans-Italic.glyphs -o ufo returns

  File "/Users/stupakm/venvs/type-tools-py3/lib/python3.7/site-packages/glyphsLib/builder/builders.py", line 343, in _apply_bracket_layers
    "Only bracket layers with one numerical (design space) location "
ValueError: Only bracket layers with one numerical (design space) location (meaning the first axis in the designspace file) are currently supported.

@m4rc1e had given me the following short script that would clean this up but no luck here.

font = Glyphs.font

for glyph in font.glyphs:
    new_layers = []
    for layer in glyph.layers:
        if not layer.isSpecialLayer:
            new_layers.append(layer)
    glyph.layers = new_layers

Any thoughts from him or a fellow Glyphs driver out there?

anthrotype commented 5 years ago

try to make that condition like

if "[" in layer.name or "]" in layer.name:

we should really demote that error to a warning and skip those invalid layers /cc @madig

anthrotype commented 5 years ago

also put some print() statements to see what your layers names look like. I believe they must only contain one integer number within square backets (whitespace is ignored). No commas.

schriftgestalt commented 5 years ago

In Glyphs, they can contain more values. And the second one is kind of taken into account. But it is not very useful as you can’t say "first axis > XX && second axis < YY".

madig commented 5 years ago

So both values are min values?

schriftgestalt commented 5 years ago

Both values are min or max depending if it is a bracket or reverse bracket.

madig commented 5 years ago

Are the values in an AND or OR relationship?

schriftgestalt commented 5 years ago

That is an ‘and’.

laerm0 commented 5 years ago

This is closed for my needs, but feel free to keep talking because it's good info. :)