Skip to content

Commit

Permalink
skip disabled custom parameters when glyphs=>ufo and minimal=True
Browse files Browse the repository at this point in the history
Fixes #905
  • Loading branch information
schriftgestalt committed Oct 23, 2024
1 parent b331e2e commit 19dc330
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions Lib/glyphsLib/builder/custom_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,15 +929,19 @@ def to_glyphs(self, glyphs, ufo):

def to_ufo(self, builder, glyphs, ufo):
if isinstance(glyphs._owner, GSFont):
glyphs_glyphOrder = glyphs[self.glyphs_name]
if glyphs_glyphOrder:
ufo_glyphOrder = ufo.get_lib_value(self.ufo_name)
# If the custom parameter provides partial coverage we want to
# append the original glyph order for uncovered glyphs.
glyphs_glyphOrder += [
g for g in ufo_glyphOrder if g not in glyphs_glyphOrder
]
ufo.set_lib_value(self.ufo_name, glyphs_glyphOrder)
glyphs_glyphOrder_parameter = glyphs._get_by_name(self.glyphs_name)
if not glyphs_glyphOrder_parameter:
return
if builder.minimal and not glyphs_glyphOrder_parameter.active:
return
glyphs_glyphOrder = glyphs_glyphOrder_parameter.value
ufo_glyphOrder = ufo.get_lib_value(self.ufo_name)
# If the custom parameter provides partial coverage we want to
# append the original glyph order for uncovered glyphs.
glyphs_glyphOrder += [
g for g in ufo_glyphOrder if g not in glyphs_glyphOrder
]
ufo.set_lib_value(self.ufo_name, glyphs_glyphOrder)


register_parameter_handler(GlyphOrderParamHandler())
Expand Down

0 comments on commit 19dc330

Please sign in to comment.