Avoid negative hmtx values when creating font from variable font

Fix #2821.
This commit is contained in:
Guillaume Ayoub 2022-09-20 16:27:54 +02:00
parent 995e5e254d
commit fd0e81ad13

View File

@ -143,7 +143,7 @@ def interpolate_cff2_metrics(varfont, topDict, glyphOrder, loc):
if lsb_delta or width_delta:
if width_delta:
entry[0] += width_delta
entry[0] = max(0, entry[0] + width_delta)
if lsb_delta:
entry[1] = lsb
hmtx[gname] = tuple(entry)