gpos.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. from lxml.etree import Element, ElementTree, fromstring
  2. ################################
  3. # CURRENTLY DISCONTINUED TABLE #
  4. ################################
  5. def toTTX():
  6. """
  7. Generates and returns a placeholder GPOS table.
  8. """
  9. gpos = Element("GPOS")
  10. # constant information
  11. gpos.append(Element("Version", {"value": "0x00010000"})) # hard-coded
  12. # generating the ScriptList
  13. # all of the way this is is hardcoded for a reason.
  14. # DFLT means 'no script in particular'
  15. # ReqFeatureIndex value 65535 tells OpenType we don't need any Features in particular.
  16. gpos.append(fromstring("""
  17. <ScriptList>
  18. <ScriptRecord index="0">
  19. <ScriptTag value="DFLT"/>
  20. <Script>
  21. <DefaultLangSys>
  22. <ReqFeatureIndex value="65535"/>
  23. </DefaultLangSys>
  24. </Script>
  25. </ScriptRecord>
  26. </ScriptList>
  27. """))
  28. # FeatureList
  29. # no features
  30. gpos.append(fromstring("""
  31. <FeatureList>
  32. </FeatureList>
  33. """))
  34. # LookupList
  35. # no lookups
  36. gpos.append(fromstring("""
  37. <LookupList>
  38. </LookupList>
  39. """))
  40. return gpos