EBLC: fix padding length calculation for Format 3 IndexSubTable

Fixes #1817
This commit is contained in:
Cosimo Lupo 2020-01-31 17:30:12 +00:00
parent 39b02fd224
commit c5dfbab521
No known key found for this signature in database
GPG Key ID: 20D4A261E4A0E642

View File

@ -482,7 +482,7 @@ def _createOffsetArrayIndexSubTableMixin(formatStringForDataType):
dataList = [EblcIndexSubTable.compile(self, ttFont)]
dataList += [struct.pack(dataFormat, offsetValue) for offsetValue in offsetArray]
# Take care of any padding issues. Only occurs in format 3.
if offsetDataSize * len(dataList) % 4 != 0:
if offsetDataSize * len(offsetArray) % 4 != 0:
dataList.append(struct.pack(dataFormat, 0))
return bytesjoin(dataList)