mekkablue / Glyphs-Scripts

Python scripts for the Glyphs font editor
http://glyphsapp.com/
Apache License 2.0
387 stars 103 forks source link

Brace & Bracket Manager: Issue when glyph without target layer included in selection #308

Closed clauseggers closed 1 year ago

clauseggers commented 1 year ago

If I select a handful of glyphs to make a search-and-replace using your Brace and Bracket Manager then I get this error if one of the glyphs does not contain the bracket layer that is targeted.

I then have to go through each glyph manually.

Brace and Bracket Manager Report for Playfair
/Users/claus/Git/clauseggers/Playfair/sources/Playfair-2_1-Roman.glyphs

🔢 Attempting Width: 97.0 → 99.0
  Processing g...
Brace and Bracket Manager Error: 'a02'
Traceback (most recent call last):
  File "Brace Layer Manager.py", line 236, in BraceLayerManagerMain
    axisLimits = axisRules[axisID]
  File "_convenience_mapping.py", line 18, in __getitem__objectForKey_
    return container_unwrap(res, KeyError, key)
  File "_convenience.py", line 113, in container_unwrap
    raise exc_type(*exc_args)
KeyError: 'a02'
clauseggers commented 1 year ago

In this case it really broke (as far as I can see), even in a glyph that has the correct layer.

Screenshot 2023-07-03 at 13 26 34
mekkablue commented 1 year ago

Probably the wrong axis selected. I’ll catch the error and put out a proper warning message in Macro Panel.

clauseggers commented 1 year ago

I did keep the B&B window open while I moved from glyph to glyph, maybe that confused the script?