only return kern if we parsed it

This commit is contained in:
Ryan Oldenburg 2021-04-27 00:37:18 -05:00
parent 7ae3d5c418
commit 512e49e6e7

View file

@ -525,12 +525,14 @@ proc parseKernTable(buf: string, offset: int): KernTable =
buf.eofCheck(i + 2)
result = KernTable()
result.version = buf.readUint16(i + 0).swap()
let version = buf.readUint16(i + 0).swap()
i += 2
if result.version == 0:
if version == 0:
buf.eofCheck(i + 2)
result = KernTable()
result.version = version
result.nTables = buf.readUint16(i + 0).swap()
i += 2