From 1288f8ad41b183ccdc3a8657b751ce53e03953a7 Mon Sep 17 00:00:00 2001 From: jvr Date: Thu, 2 May 2002 10:53:10 +0000 Subject: [PATCH] whoops, lastIndex can't be smaller than 1 git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@182 4cde692c-a291-49d1-8350-778aa11640f8 --- Lib/fontTools/ttLib/tables/_h_m_t_x.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/fontTools/ttLib/tables/_h_m_t_x.py b/Lib/fontTools/ttLib/tables/_h_m_t_x.py index 2d4d8ed46..2675a2950 100644 --- a/Lib/fontTools/ttLib/tables/_h_m_t_x.py +++ b/Lib/fontTools/ttLib/tables/_h_m_t_x.py @@ -52,8 +52,9 @@ class table__h_m_t_x(DefaultTable.DefaultTable): lastIndex = len(metrics) while metrics[lastIndex-2][0] == lastAdvance: lastIndex = lastIndex - 1 - if lastIndex == 0: + if lastIndex <= 1: # all advances are equal + lastIndex = 1 break additionalMetrics = metrics[lastIndex:] additionalMetrics = map(lambda (advance, sb): sb, additionalMetrics)