class_docstr: Support Graphite Glat tables
class_docstr_tok: ["Support","Graphite","Glat","tables"]
code: def toXML(self, writer, ttFont):
      writer.simpletag(
          "version", version=self.version, compressionScheme=self.scheme
      )
      writer.newline()
      for n, a in sorted(
          self.attributes.items(), key=lambda x: ttFont.getGlyphID(x[0])
      ):
          writer.begintag("glyph", name=n)
          writer.newline()
          if hasattr(a, "octabox"):
              o = a.octabox
              formatstring, names, fixes = sstruct.getformat(
                  Glat_format_3_octabox_metrics
              )
              vals = {}
              for k in names:
                  if k == "subboxBitmap":
                      continue
                  vals[k] = "{:.3f}%".format(
                      getattr(o, k) * 100.0 / 255
                  )
              vals["bitmap"] = "{:0X}".format(o.subboxBitmap)
              writer.begintag("octaboxes", **vals)
              writer.newline()
              formatstring, names, fixes = sstruct.getformat(
                  Glat_format_3_subbox_entry
              )
              for s in o.subboxes:
                  vals = {}
                  for k in names:
                      vals[k] = "{:.3f}%".format(
                          getattr(s, k) * 100.0 / 255
                      )
                  writer.simpletag("octabox", **vals)
                  writer.newline()
              writer.endtag("octaboxes")
              writer.newline()
          for k, v in sorted(a.items()):
              writer.simpletag("attribute", index=k, value=v)
              writer.newline()
          writer.endtag("glyph")
          writer.newline()
  
imports: from fontTools.misc import sstruct
  from fontTools.misc.fixedTools import floatToFixedToStr
  from fontTools.misc.textTools import safeEval
  from functools import partial
  from .None import DefaultTable
  from .None import grUtils
  import struct
label_desc: Use image node_id 8 for calling the table_G__l_a_t obj's underlying member method code with example usage: obj.toXML(writer, ttFont) without return types