code: def encode_format_4_0(self, ttFont):
      from fontTools import agl
  
      numGlyphs = ttFont["maxp"].numGlyphs
      glyphOrder = ttFont.getGlyphOrder()
      assert len(glyphOrder) == numGlyphs
      indices = array.array("H")
      for glyphID in glyphOrder:
          glyphID = glyphID.split("#")[0]
          if glyphID in agl.AGL2UV:
              indices.append(agl.AGL2UV[glyphID])
          elif len(glyphID) == 7 and glyphID[:3] == "uni":
              indices.append(int(glyphID[3:], 16))
          else:
              indices.append(0xFFFF)
      if sys.byteorder != "big":
          indices.byteswap()
      return indices.tobytes()
  
imports: from fontTools import ttLib
  from fontTools.ttLib.standardGlyphOrder import standardGlyphOrder
  from fontTools.misc import sstruct
  from fontTools.misc.textTools import bytechr, byteord, tobytes, tostr, safeEval, readHex
  from .None import DefaultTable
  import sys
  import struct
  import array
  import logging
label_desc: Use image node_id 10 for calling the table__p_o_s_t obj's underlying member method code with example usage: obj.encode_format_4_0(ttFont) and returns: indices