Home | History | Annotate | Download | only in tables

Lines Matching defs:Table

23 	"""Given a table spec from otData.py, build a converter object for each
24 field of the table. This is called for each table in otData.py, and
68 convertersByName[cls.__name__] = Table(name, repeat, aux, cls)
73 convertersByName[cls.__name__] = Table(name, repeat, aux, cls)
296 xmlWriter.comment("missing from name table")
297 log.warning("name id %d missing from name table" % value)
356 Used in Apple AAT fonts in the `gcid` table.
389 table = self.tableClass()
390 table.decompile(reader, font)
391 return table
405 pass # NULL table, ignore
412 table = self.tableClass()
415 table.Format = int(Format)
417 noPostRead = not hasattr(table, 'postRead')
419 # TODO Cache table.hasPropagated.
421 for conv in table.getConverters():
428 setattr(table, conv.name, None)
429 propagator[conv.name] = CountReference(table.__dict__, conv.name)
434 table.fromXML(name, attrs, content, font)
438 table.populateDefaults(propagator=getattr(font, '_propagator', None))
442 for conv in table.getConverters():
449 return table
458 table = self.tableClass()
459 table.decompile(reader, font)
460 reader.seek(pos + table.StructLength)
461 return table
483 class Table(Struct):
501 table = self.tableClass()
504 table.reader = reader
505 table.font = font
507 table.decompile(reader, font)
508 return table
522 class LTable(Table):
541 Table):
553 Table.write(self, writer, font, tableDict, value, repeatIndex)
556 class FeatureParams(Table):
585 pass # NULL table, ignore
603 self.converter = Table(name='Value', repeat=None, aux=None, tableClass=self.tableClass)
743 pos = reader.pos - 2 # start of table is at UShort for format
758 pos = reader.pos - 2 # start of table is at UShort for format
768 dataReader.seek(pos + offset) # relative to start of table
778 pos = reader.pos - 2 # start of table is at UShort for format
818 # The AAT 'ankr' table has an unusual structure: An offset to an AATLookup
819 # followed by an offset to a glyph data table. Other than usual, the
821 # the beginning of the 'ankr' table, but relative to the glyph data table.
823 # to the data table to the offset found in the AATLookup, and then use
843 # table, for which we need to provide an offset value itself.
849 # contents of the AATLookup and associated data table.
863 # For calculating the offsets to our AATLookup and data table,
1031 table = AATStateTable()
1038 table.GlyphClassCount = reader.readULong()
1055 table.LigComponents = \
1057 table.Ligatures = self._readLigatures(ligaturesReader, font)
1061 table.GlyphClasses = self.classLookup.read(classTableReader,
1064 / (table.GlyphClassCount * 2))
1067 table.States.append(state)
1068 for glyphClass in range(table.GlyphClassCount):
1075 table.PerGlyphLookups = self._readPerGlyphLookups(
1076 table, perGlyphTableReader, font)
1077 return table
1092 def _countPerGlyphLookups(self, table):
1093 # Somewhat annoyingly, the morx table does not encode
1094 # the size of the per-glyph table. So we need to find
1096 # into this table.
1098 for state in table.States:
1111 def _readPerGlyphLookups(self, table, reader, font):
1114 for _ in range(self._countPerGlyphLookups(table)):
1202 def _compilePerGlyphLookups(self, table, font):
1205 numLookups = self._countPerGlyphLookups(table)
1206 assert len(table.PerGlyphLookups) == numLookups, (
1208 "but the actions inside the table refer to %d" %
1209 (len(table.PerGlyphLookups), numLookups))
1211 for lookup in table.PerGlyphLookups:
1219 def _compileLigComponents(self, table, font):
1220 if not hasattr(table, "LigComponents"):
1223 for component in table.LigComponents:
1227 def _compileLigatures(self, table, font):
1228 if not hasattr(table, "Ligatures"):
1231 for glyphName in table.Ligatures:
1286 table = AATStateTable()
1291 table.GlyphClasses[glyph] = safeEval(value)
1294 table.States.append(state)
1298 table.PerGlyphLookups.append(lookup)
1300 table.LigComponents = \
1304 table.Ligatures = \
1307 table.GlyphClassCount = max(table.GlyphClasses.values()) + 1
1308 return table
1578 "Offset": Table,
1597 "OffsetTo": lambda C: partial(Table, tableClass=C),