brechtm / rinohtype

The Python document processor
http://www.mos6581.org/rinohtype
GNU Affero General Public License v3.0
499 stars 59 forks source link

'Source Serif Pro' font causes crash #334

Open brechtm opened 2 years ago

brechtm commented 2 years ago
    def __init__(self, file, file_offset, subtable_types):
        super().__init__(file, file_offset)
        offsets = array(uint16, self['SubTableCount'])(file)
        if self['LookupFlag']['UseMarkFilteringSet']:
            self['MarkFilteringSet'] = uint16(file)
>       subtable_type = subtable_types[self['LookupType']]
E       KeyError: 8

If rinohtype doesn't yet implement support for an OpenType table format, exit with a more informative message. For substitution tables, we could also ignore them but issue a warning to the user that the particular font will lack (some) glyph substitutions.