[cffLib.widths] Fix off-by-one in values

Was wrong; didn't match the code block above it.
This commit is contained in:
Behdad Esfahbod 2022-08-09 21:43:25 -06:00
parent 68b0509711
commit 2963fa503a

View File

@ -135,13 +135,13 @@ def optimizeWidths(widths):
dfltC = nomnCost[nominal] - bestCost[nominal]
ends = []
if dfltC == dfltCostU[nominal]:
starts = [nominal, nominal-108, nominal-1131]
starts = [nominal, nominal-108, nominal-1132]
for start in starts:
while cumMaxU[start] and cumMaxU[start] == cumMaxU[start-1]:
start -= 1
ends.append(start)
else:
starts = [nominal, nominal+108, nominal+1131]
starts = [nominal, nominal+108, nominal+1132]
for start in starts:
while cumMaxD[start] and cumMaxD[start] == cumMaxD[start+1]:
start += 1