Skip to content

Commit

Permalink
Include overshoot in guessed AccentBaseHeight
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledhosny committed Feb 22, 2024
1 parent 2eb1bf3 commit b296065
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion MATHPlugin.glyphsPlugin/Contents/Resources/plugin.py
Expand Up @@ -23,6 +23,7 @@
GSGlyphReference,
Message,
GSCallbackHandler,
GSMetricsTypexHeight,
)
from GlyphsApp.drawingTools import restore, save, translate
from GlyphsApp.plugins import GeneralPlugin
Expand Down Expand Up @@ -862,7 +863,15 @@ def getConstant(self, constant, force=False):
bounds = glyph.layers[master.id].bounds
value = bounds.origin.y + bounds.size.height / 2
elif constant == "AccentBaseHeight":
value = master.xHeight
for metric in master.metrics():
if (
metric.metric.type == GSMetricsTypexHeight
and metric.metric.filter is None
):
value = metric.position + metric.overshoot
break
if not value:
value = master.xHeight
elif constant == "FlattenedAccentBaseHeight":
value = master.capHeight
elif constant == "SubscriptShiftDown":
Expand Down

0 comments on commit b296065

Please sign in to comment.