Skip to content

Commit

Permalink
No width linking of brace layers
Browse files Browse the repository at this point in the history
it was getting it form the master they are attached too and that is supposed to have a different width
  • Loading branch information
schriftgestalt committed Feb 10, 2024
1 parent a8399de commit f79047b
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions Lib/glyphsLib/builder/glyph.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,22 +219,20 @@ def effective_width(layer, glyph):
# The width may be taken from another master via the customParameters
# 'Link Metrics With Master' or 'Link Metrics With First Master'.
font = glyph.parent
master = font.masters[layer.associatedMasterId or layer.layerId]
metrics_source = master.metricsSource
if metrics_source is None:
width = layer.width
else:
metric_layer = font.glyphs[glyph.name].layers[metrics_source.id]
if metric_layer:
width = metric_layer.width
if layer.width != width:
logger.debug(
f"{layer.parent.name}: Applying width from master "
f"'{metrics_source.id}': {layer.width} -> {width}"
)
else:
width = None
return width
master = font.masters[layer.layerId]
if master:
metrics_source = master.metricsSource
if metrics_source:
metric_layer = font.glyphs[glyph.name].layers[metrics_source.id]
if metric_layer:
width = metric_layer.width
if layer.width != width:
logger.debug(
f"{layer.parent.name}: Applying width from master "
f"'{metrics_source.id}': {layer.width} -> {width}"
)
return width
return layer.width


def to_ufo_glyph_color(self, ufo_glyph, layer, glyph, do_color_layers=True):
Expand Down

0 comments on commit f79047b

Please sign in to comment.