示例#1
0
 def read_names(self, f):
     if b'name' not in self.tables:
         raise UnsupportedFont('This font has no name table')
     toff, tlen = self.tables[b'name'][:2]
     f.seek(toff)
     table = f.read(tlen)
     if len(table) != tlen:
         raise UnsupportedFont('This font has a name table of incorrect length')
     vals = get_font_names2(table, raw_is_table=True)
     self.names = FontNames(*vals)
示例#2
0
 def read_names(self, f):
     if b'name' not in self.tables:
         raise UnsupportedFont('This font has no name table')
     toff, tlen = self.tables[b'name'][:2]
     f.seek(toff)
     table = f.read(tlen)
     if len(table) != tlen:
         raise UnsupportedFont('This font has a name table of incorrect length')
     vals = get_font_names2(table, raw_is_table=True)
     self.names = FontNames(*vals)