loca.py 597 B

123456789101112131415161718192021222324
  1. from lxml.etree import Element
  2. from transform.bytes import outputTableBytes
  3. class loca:
  4. """
  5. Class representing a placeholder loca table.
  6. This table exists to please macOS. macOS considers a font valid if it has this table.
  7. """
  8. def __init__(self):
  9. self.whatever = 0
  10. # This table's type is determined by head.indexToLocFormat.
  11. # TODO: make a version of loca that can be used in bytes compilation.
  12. def toTTX(self):
  13. return Element("loca")
  14. def toBytes(self):
  15. return outputTableBytes(b'\0') # TODO: make a bytes representation