+
    i                      a  0 t $ ^ RIHt ^ RIt^ RIt^ RIt^ RIHtHtH	t	 ^ RI
HtHtHtHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHtHtHt ^ R
IHt ^ RIHtHt ^ RI H!t!H"t"H#t#H$t$H%t% ]'       d   ^ RI&H't'H(t( ^ RI)H*t*H+t+ ^ RI
H,t,H-t-H.t.H/t/H0t0 ^ RI1H2t2H3t3 ^ RI4H5t5H6t6H7t7H8t8H9t9H:t:H;t;H<t<H=t=H>t>H?t?H@t@HAtAHBtBHCtCHDtDHEtEHFtFHGtGHHtHHItIHJtJHKtKHLtLHMtMHNtNHOtOHPtPHQtQHRtRHStSHTtTHUtUHVtVHWtWHXtXHYtYHZtZH[t[H\t\H]t]H^t^H_t_H`t`HataHbtbHctcHdtdHeteHftfHgtgHhthHitiHjtjHktkHltlHmtmHntnHotoHptpHqtqHrtrHstsHtttHutuHvtvHwtwHxtxHytyHztzH{t{H|t|H}t}H~t~HtHtHtHtHtHtHtHtHtHtHt ^ RIHt ]! RRR7      t]EP                  ! ]4      t]! R]R7      t ! R R]4      t ! R R]4      tR R lt/ tR]R&   R>R  R! lltR" R# ltR$ R% ltR& R' ltR( R) ltR* R+ ltR, R- ltR. R/ ltR0 R1 ltR2 R3 ltR4 R5 lt. R?Ot. R@OtR>R6 R7 lltRAR8 R9 lltR: R; ltRBR< R= lltR# )C    )annotationsN)BytesIOStringIOUnsupportedOperation)TYPE_CHECKING	TypedDictTypeVaroverload)Config)	xmlWriter)AbstractConfig)deprecateArgument)Tagbyteordtostr)
TTLibError)
SFNTReader
SFNTWriter)_TTGlyph_TTGlyphSet_TTGlyphSetCFF_TTGlyphSetGlyf_TTGlyphSetVARC)MappingMutableMapping)
ModuleTypeTracebackType)AnyBinaryIOLiteralSequenceTextIO)SelfUnpack)UB_A_S_E_C_B_D_T_C_B_L_C_C_F_F_C_F_F__2C_O_L_R_C_P_A_L_D_S_I_G_E_B_D_T_E_B_L_C_F_F_T_M_G_D_E_F_G_M_A_P_G_P_K_G_G_P_O_S_G_S_U_B_G_V_A_R_H_V_A_R_J_S_T_F_L_T_S_H_M_A_T_H_M_E_T_A_M_V_A_R_S_I_N_G_S_T_A_T_S_V_G_T_S_I__0T_S_I__1T_S_I__2T_S_I__3T_S_I__5T_S_I_B_T_S_I_C_T_S_I_D_T_S_I_J_T_S_I_P_T_S_I_S_T_S_I_V_T_T_F_A_V_A_R_C_V_D_M_X_V_O_R_G_V_V_A_R_D__e_b_gF__e_a_tG__l_a_tG__l_o_cO_S_2f_2S__i_l_fS__i_l_l_a_n_k_r_a_v_a_r_b_s_l_n_c_i_d_g_c_m_a_p_c_v_a_r_c_v_t_f_e_a_t_f_p_g_m_f_v_a_r_g_a_s_p_g_c_i_d_g_l_y_f_g_v_a_r_h_d_m_x_h_e_a_d_h_h_e_a_h_m_t_x_k_e_r_n_l_c_a_r_l_o_c_a_l_t_a_g_m_a_x_p_m_e_t_a_m_o_r_t_m_o_r_x_n_a_m_e_o_p_b_d_p_o_s_t_p_r_e_p_p_r_o_p_s_b_i_x_t_r_a_k_v_h_e_a_v_m_t_xDefaultTable_VT_coT)	covariant_NumberT)boundc                     ] tR t^t$ RtR]R&   R]R&   R]R&   R]R	&   R
]R&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   RRRR^ RR ]R!R ERRRR/ 3R" R# lltR$ R% ltR& R' lt	R( R) lt
ERR* R+ lltERR, R- llt ! R. R/]4      tERR0 R1 lltERR2 R3 lltERR4 R5 lltERR6 R7 lltR8 R9 ltR: R; lt]tR< R= ltERR> R? lltR@ RA lt]RB RC l4       t]RD RE l4       t]RF RG l4       t]RH RI l4       t]RJ RK l4       t]RL RM l4       t]RN RO l4       t]RP RQ l4       t]RR RS l4       t]RT RU l4       t]RV RW l4       t]RX RY l4       t]RZ R[ l4       t]R\ R] l4       t]R^ R_ l4       t]R` Ra l4       t]Rb Rc l4       t]Rd Re l4       t]Rf Rg l4       t]Rh Ri l4       t]Rj Rk l4       t]Rl Rm l4       t]Rn Ro l4       t]Rp Rq l4       t]Rr Rs l4       t]Rt Ru l4       t]Rv Rw l4       t]Rx Ry l4       t]Rz R{ l4       t]R| R} l4       t]R~ R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       tR R ltR R ltR R ltR R lt]R R l4       t]R R l4       t]R R l4       t]R R l4       t]ER  ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER	 l4       t]ER
 ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER  ER! l4       t]ER" ER# l4       t]ER$ ER% l4       t]ER& ER' l4       t]ER( ER) l4       t]ER* ER+ l4       t]ER, ER- l4       t]ER. ER/ l4       t]ER0 ER1 l4       t]ER2 ER3 l4       t]ER4 ER5 l4       t]ER6 ER7 l4       t]ER8 ER9 l4       t]ER: ER; l4       t]ER< ER= l4       t]ER> ER? l4       t]ER@ ERA l4       t]ERB ERC l4       t]ERD ERE l4       t]ERF ERG l4       t]ERH ERI l4       t]ERJ ERK l4       t]ERL ERM l4       t]ERN ERO l4       t]ERP ERQ l4       t]ERR ERS l4       t]ERT ERU l4       t]ERV ERW l4       t]ERX ERY l4       t]ERZ ER[ l4       t]ER\ ER] l4       t]ER^ ER_ l4       t]ER` ERa l4       t]ERb ERc l4       t]ERd ERe l4       t]ERf ERg l4       t]ERh ERi l4       t]ERj ERk l4       t]ERl ERm l4       t]ERn ERo l4       t]ERp ERq l4       t]ERr ERs l4       t]ERt ERu l4       t]ERv ERw l4       t]ERx ERy l4       t]ERz ER{ l4       t]ER| ER} l4       t]ER~ ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       t]ER ER l4       tERER ER lltER ER ltER ER lt ER ER lt!]"ER ER l4       t#ER ER lt$ER ER lt%ER ER lt&ER ER lt'ER ER lt(ER ER lt)ERER ER llt*ER ER lt+ERER ER llt,ER ER lt-ERER ER llt.ER ER lt/ERER ER llt0ER ER lt1ERt2R# (  TTFontaS  Represents a TrueType font.

The object manages file input and output, and offers a convenient way of
accessing tables. Tables will be only decompiled when necessary, ie. when
they're actually accessed. This means that simple operations can be extremely fast.

Example usage:

.. code-block:: pycon

    >>>
    >> from fontTools import ttLib
    >> tt = ttLib.TTFont("afont.ttf") # Load an existing font file
    >> tt['maxp'].numGlyphs
    242
    >> tt['OS/2'].achVendID
    'B&H '
    >> tt['head'].unitsPerEm
    2048

For details of the objects returned when accessing each table, see the
:doc:`tables </ttLib/tables>` documentation.
To add a table to the font, use the :py:func:`newTable` function:

.. code-block:: pycon

    >>>
    >> os2 = newTable("OS/2")
    >> os2.version = 4
    >> # set other attributes
    >> font["OS/2"] = os2

TrueType fonts can also be serialized to and from XML format (see also the
:doc:`ttx </ttx>` binary):

.. code-block:: pycon

    >>
    >> tt.saveXML("afont.ttx")
    Dumping 'LTSH' table...
    Dumping 'OS/2' table...
    [...]

    >> tt2 = ttLib.TTFont() # Create a new font object
    >> tt2.importXML("afont.ttx")
    >> tt2['maxp'].numGlyphs
    242

The TTFont object may be used as a context manager; this will cause the file
reader to be closed after the context ``with`` block is exited::

        with TTFont(filename) as f:
                # Do stuff

Args:
        file: When reading a font from disk, either a pathname pointing to a file,
                or a readable file object.
        res_name_or_index: If running on a Macintosh, either a sfnt resource name or
                an sfnt resource index number. If the index number is zero, TTLib will
                autodetect whether the file is a flat file or a suitcase. (If it is a suitcase,
                only the first 'sfnt' resource will be read.)
        sfntVersion (str): When constructing a font object from scratch, sets the four-byte
                sfnt magic number to be used. Defaults to ``   `` (TrueType). To create
                an OpenType file, use ``OTTO``.
        flavor (str): Set this to ``woff`` when creating a WOFF file or ``woff2`` for a WOFF2
                file.
        checkChecksums (int): How checksum data should be treated. Default is 0
                (no checking). Set to 1 to check and warn on wrong checksums; set to 2 to
                raise an exception if any wrong checksums are found.
        recalcBBoxes (bool): If true (the default), recalculates ``glyf``, ``CFF ``,
                ``head`` bounding box values and ``hhea``/``vhea`` min/max values on save.
                Also compiles the glyphs on importing, which saves memory consumption and
                time.
        ignoreDecompileErrors (bool): If true, exceptions raised during table decompilation
                will be ignored, and the binary data will be returned for those tables instead.
        recalcTimestamp (bool): If true (the default), sets the ``modified`` timestamp in
                the ``head`` table on save.
        fontNumber (int): The index of the font in a TrueType Collection file.
        lazy (bool): If lazy is set to True, many data structures are loaded lazily, upon
                access only. If it is set to False, many data structures are loaded immediately.
                The default is ``lazy=None`` which is somewhere in between.
z$dict[Tag, DefaultTable | GlyphOrder]tableszSFNTReader | NonereaderstrsfntVersion
str | Noneflavor
Any | None
flavorDatabool | NonelazyboolrecalcBBoxesrecalcTimestampignoreDecompileErrorsr   cfg	list[str]
glyphOrderdict[str, int]_reverseGlyphOrderDict6MutableMapping[tuple[Tag, bytes], DefaultTable] | None_tableCachedisassembleInstructionsbitmapGlyphDataFormatverbosequietNz   TFc                X    V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRR
RRRRRRRRRR/# )   filez(str | os.PathLike[str] | BinaryIO | Noneres_name_or_indexzstr | int | Noner   r   r   r   checkChecksumsintr   r   r   r   allowVIDr   r   r   
fontNumberr   r   r   r   r   z"Mapping[str, Any] | AbstractConfigreturnNone )formats   "v/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/fontTools/ttLib/ttFont.py__annotate__TTFont.__annotate__   s     \1 \16\1 ,\1 	\1
 \1 \1 \1 \1 \1  $\1 \1 \1 \1 \1 L\1  0!\1" 
#\1    c                	   R F9  p\        4       P                  V4      pVe   \        VR4       \        V VV4       K;  	  Wn        Wpn        Wn        / V n        RV n        \        V\        4      '       d   VP                  4       M
\        V4      V n        Wn        V'       g   W0n        W@n        RV n        R# Rp\%        VR4      '       g   \        V\&        \(        P*                  34      '       g   \-        R4      hRpVeW   ^RIHp V^ 8X  d8   VP3                  V4      '       d   VP5                  V^4      pM\7        VR4      pMVP5                  W4      pM~\7        VR4      pMq\        V\&        \(        P*                  34      '       d   Q hRp\%        VR	4      '       d   VP9                  4       pM$\%        VR
4      '       d    VP;                  ^ 4       V P                  '       gq   V'       d   VP;                  ^ 4       \?        VPA                  4       4      p\%        VR4      '       d   VPB                  Vn!        V'       d   VPE                  4        TpMV'       g   \G        R4      hWn$        \K        WVR7      V n        V P                  P                  V n        V P                  P                   V n        V P                  P"                  V n        R#   \<         d    Rp ELi ; i)r   Nconfigure logging insteadTreadz\fileOrPath must be a file path (str or PathLike) if it isn't an object with a `read` method.)macUtilsrbFseekableseeknamez*Input file must be seekable when lazy=True)r   )r   r   )&localsgetr   setattrr   r   r   r   r   
isinstancer   copyr   r   r   r   r   r   hasattrr   osPathLike	TypeError r   getSFNTResIndicesSFNTResourceReaderopenr   r   r   r   r   r   closer   r   r   )selfr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   valr   closeStreamr   tmps   &&&&&&&&&&&&&&&&      r   __init__TTFont.__init__   sL   & )D(,,t$C!$(CDD$$	 ) 	(.!+C!@!@388:fSk%:"* K"DOtV$$dS"++$677r  K ,&$)11$77'::4C#D$/#66tODD$' "$bkk(:;;;;K tZ((==?v&&%IIaL yyy		!$))+&CtV$$99

DIJJ& *M;;22kk((++00) , %$H%s   K K)(K)c                   V ^8  d   QhRR/# )r   r   r#   r   )r   s   "r   r   r   E  s      4 r   c                	    V # Nr   r   s   &r   	__enter__TTFont.__enter__E  s    r   c               (    V ^8  d   QhRRRRRRRR/# )	r   exc_typeztype[BaseException] | None	exc_valuezBaseException | None	tracebackzTracebackType | Noner   r   r   )r   s   "r   r   r   H  s2      , ( (	
 
r   c                	&    V P                  4        R # r   )r   )r   r   r   r   s   &&&&r   __exit__TTFont.__exit__H  s     	

r   c                   V ^8  d   QhRR/# r   r   r   r   )r   s   "r   r   r   P  s      t r   c                h    V P                   e$   V P                   P                  4        RV n         R# R# )z+If we still have a reader object, close it.N)r   r   r   s   &r   r   TTFont.closeP  s(    ;;"KKDK #r   c               $    V ^8  d   QhRRRRRR/# )r   r   !str | os.PathLike[str] | BinaryIOreorderTablesr   r   r   r   )r   s   "r   r   r   V  s$     7 757FQ7	7r   c                   \        VR4      '       gF   V P                  '       d1   V P                  P                  P                  V8X  d   \        R4      hRpMRp\        4       pV P                  V4      pVe   V'       g   VRJ d   V P                  e~   VRJ d>   V P                  f   \        R4      h\        V P                  P                  4       4      pMRpVP                  4        \        4       p\        WGV4       VP                  4        TpV'       df   \        V\        \        P                   34      '       g   Q h\#        VR4      ;_uu_ 4       pVP%                  VP'                  4       4       RRR4       MG\        V\        \        P                   34      '       d   Q hVP%                  VP'                  4       4       VP                  4        R#   + '       g   i     L"; i)a  Save the font to disk.

Args:
        file: Similarly to the constructor, can be either a pathname or a writable
                binary file object.
        reorderTables (Option[bool]): If true (the default), reorder the tables,
                sorting them by tag (recommended by the OpenType specification). If
                false, retain the original font order. If None, reorder by table
                dependency (fastest).
writez4Can't overwrite TTFont when 'lazy' attribute is TrueTFNzSThe original table order is unavailable because there isn't a font to read it from.wb)r   r   r   r   r   r   r   _savelistkeysflushreorderFontTablesr   r   r   r   r   r   r   getvalue)r   r   r   createStreamr   writer_reordersTables
tableOrdertmp2s   &&&     r   saveTTFont.saveV  sn    tW%%yyyT[[--22d: !WXXL !Li $

3 !$&4;;+>%;;&$m  "$++"2"2"45
 "
IIK9Dc4IIKCdS"++$67777dD!!T

3<<>* "! "$bkk(:;;;;JJs||~&		 "!s    GG(	c               $    V ^8  d   QhRRRRRR/# )r   r   r   
tableCachez-MutableMapping[tuple[Tag, bytes], Any] | Noner   r   r   )r   s   "r   r   r     s)     ' '' B' 
	'r   c                p   V P                   '       d   RV 9   d
   V R,           V P                  4       pVP                  ^ 4       \        V4      p\	        WV P
                  V P                  V P                  4      p. pV F  pV P                  WuWb4       K  	  VP                  4        VP                  4       # )zAInternal function, to be shared by save() and TTCollection.save()head)r   r   poplenr   r   r   r   _writeTabler   reordersTables)r   r   r   tags	numTableswriterdonetags   &&&     r   r   TTFont._save  s     FdNLyy{I	T--t{{DOO
 CS$;  	$$&&r   c                  h    ] tR tRt$ R]R&   R]R&   R]R&   R]R	&   R]R
&   R]R&   R]R&   R]R&   RtR# )TTFont.XMLSavingOptionsi  r   writeVersionr   r   Sequence[str | bytes] | Noner   Sequence[str] | None
skipTablessplitTablessplitGlyphsr   r   r   r   N)__name__
__module____qualname____firstlineno____annotations____static_attributes__r   r   r   XMLSavingOptionsr     s2    ,,((!%%""r   r  c               (    V ^8  d   QhRRRRRRRR/# )	r   
fileOrPathz*str | os.PathLike[str] | BinaryIO | TextIO
newlinestrr   kwargszUnpack[XMLSavingOptions]r   r   r   )r   s   "r   r   r     s2      >  +	
 
r   c                z    \         P                  ! WR7      pV P                  ! V3/ VB  VP                  4        R# )az  Export the font as TTX (an XML-based text file), or as a series of text
files when splitTables is true. In the latter case, the 'fileOrPath'
argument should be a path to a directory.
The 'tables' argument must either be false (dump all tables) or a
list of tables to dump. The 'skipTables' argument may be a list of tables
to skip, but only when the 'tables' argument is false.
r	  N)r   	XMLWriter_saveXMLr   )r   r  r	  r
  r   s   &&&, r   saveXMLTTFont.saveXML  s.     $$ZGf''r   c               @    V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRR/
# )r   r   xmlWriter.XMLWriterr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   s   "r   r   r     sz     B B#B B 	B
 -B )B B B "&B  #B 
Br   c
                	f   Ve   \        RR4       Wn        Wn        V'       g2   V P                  4       pV'       d   V U
u. uF  qV9  g   K  V
NK  	  pp
V'       db   ^ RIHp RP                  VP                  R4      R,          4      pVP                  R\        \        V P                  4      4      ^R VR7       M2VP                  R\        \        V P                  4      4      ^R R7       VP                  4        T;'       g    TpV'       g   VP                  4        MDVP                  f   \        R	4      h\        P                   P#                  VP                  4      w  rV EF  p
V'       d   XR,           \%        V
4      ,           X,           p\&        P(                  ! WP*                  R
7      pVP                  RXR7       VP                  4        VP                  4        VP-                  \/        V
4      \        P                   P1                  V4      R7       VP                  4        MTpV P3                  WVR7       V'       g   K  VP5                  R4       VP                  4        VP7                  4        EK  	  VP5                  R4       VP                  4        R # u up
i )Nr   r   )version.:Nr   NttFont)r   ttLibVersion)r   zJsplitTables requires the file name to be a file system path, not a stream.r  )r  )srcr   )r   r   r   r   	fontToolsr  joinsplitbegintagreprr   r   newlinefilenamer   r   pathsplitexttagToIdentifierr   r  r	  	simpletagtagToXMLbasename_tableToXMLendtagr   )r   r   r   r   r   r   r   r   r   r   r   r  r"  ext	tablePathtableWriters   &&&&&&&&&&      r   r  TTFont._saveXML  s$    g'BC'>$%:"YY[F)/I#j3H##I)hhw}}S1"56GOO t'7'7!89!B?$   OOH$uT=M=M7N2OPQRT2UOV "00[NN& `  ((9IDC 3J)==C	'11*;*; $$XG$D##%##%  #BGG4D4DY4O P $[;G{""8,##%!!## $ 	h] Js   J.J.c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r   r   r  r   str | bytesr   r   r   r   r   r   r   )r   s   "r   r   r   
  s<     ! !#! ! 	!
 ! 
!r   c                	"   Ve   \        RR4       W 9   d   W,          pRV,          pM	RV,          p\        P                  V4       W 9  d   R # \        V4      p/ p\	        XR4      '       d   RVR&   ^RIHp	 VP                  V	8X  d   RVR	&   VP                  ! V3/ VB  VP                  4        VR
8X  d   VP                  WVR7       MVP                  W4       VP                  V4       VP                  4        VP                  4        R # )Nr   r   zDumping '%s' table...zNo '%s' table found.ERRORzdecompilation errorrz   Trawglyfr  )r   loginfor&  r   tables.DefaultTabler{   	__class__r  r   toXMLr)  )
r   r   r   r   r   tablereportxmlTagattrsr{   s
   &&&&&     r   r(  TTFont._tableToXML
  s     g'BC;IE,s2F+c1F?# "5'""2E'N5??l*E%L(%(&=KK+K>KK%fr   c               $    V ^8  d   QhRRRRRR/# )r   r  r   r   r   r   r   r   )r   s   "r   r   r   -  s$      ;DO	r   c                    Ve   \        RR4       RV 9   d   RV 9   d   V P                  4        ^ RIHp VP	                  W4      pVP                  4        R# )zOImport a TTX file (an XML-based text format), so as to recreate
a font object.
Nr   r   maxppost)	xmlReader)r   getGlyphOrderfontTools.miscrB  	XMLReaderr   )r   r  r   rB  r   s   &&&  r   	importXMLTTFont.importXML-  sL     g'BCT>fn
  ,$$Z6r   c                    V ^8  d   QhRRRR/# r   r   r/  r   r   r   )r   s   "r   r   r   B  s     " "K "D "r   c                    WP                   9   # )zZReturn true if the table identified by ``tag`` has been
decompiled and loaded into memory.r   r   r   s   &&r   isLoadedTTFont.isLoadedB  s     kk!!r   c                    V ^8  d   QhRRRR/# rI  r   )r   s   "r   r   r   G  s      ; 4 r   c                    V P                  V4      '       d   R# V P                  '       d   WP                  9   d   R# VR8X  d   R# R# )zTest if the table identified by ``tag`` is present in the font.

As well as this method, ``tag in font`` can also be used to determine the
presence of the table.T
GlyphOrderF)rM  r   rL  s   &&r   has_keyTTFont.has_keyG  s9    
 ==[[[SKK/L r   c                   V ^8  d   QhRR/# r   r   r   r   )r   s   "r   r   r   W  s     % %i %r   c                L   \        V P                  P                  4       4      pV P                  '       dD   \        V P                  P                  4       4       F  pW!9  g   K  VP	                  V4       K  	  RV9   d   VP                  R4       \        V4      pR.V,           # )zSReturns the list of tables in the font, along with the ``GlyphOrder`` pseudo-table.rQ  )r   r   r   r   appendremovesortedTagList)r   r   keys   &  r   r   TTFont.keysW  s|    DKK$$&';;;DKK,,./?KK$ 0 4KK%T"~$$r   c                    V ^8  d   QhRRRR/# )r   recurser   r   r   r   )r   s   "r   r   r   d  s       t r   c                    V P                  4        FM  pW,          pVf   V P                  RJpV'       g   K'  \        VR4      '       g   K;  VP                  VR7       KO  	  RV n        R# )zEDecompile all the tables, even if a TTFont was opened in 'lazy' mode.NFensureDecompiled)r]  )r   r   r   r_  )r   r]  r   r9  s   &&  r   r_  TTFont.ensureDecompiledd  sX    99;CIE))50w75*<==&&w&7  	r   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r   n  s     & & &r   c                	F    \        \        V P                  4       4      4      # r   )r   r   r   r   s   &r   __len__TTFont.__len__n  s    4		$%%r   c                    V ^8  d   QhRRRR/# )r   r   Literal['BASE']r   zB_A_S_E_.table_B_A_S_E_r   )r   s   "r   r   r   r      OOO3JOr   c                	    R # r   r   rL  s   &&r   __getitem__TTFont.__getitem__q      LOr   c                    V ^8  d   QhRRRR/# )r   r   Literal['CBDT']r   zC_B_D_T_.table_C_B_D_T_r   )r   s   "r   r   r   t  rg  r   c                	    R # r   r   rL  s   &&r   ri  rj  s  rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['CBLC']r   zC_B_L_C_.table_C_B_L_C_r   )r   s   "r   r   r   v  rg  r   c                	    R # r   r   rL  s   &&r   ri  rj  u  rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['CFF ']r   zC_F_F_.table_C_F_F_r   )r   s   "r   r   r   x      KKK3FKr   c                	    R # r   r   rL  s   &&r   ri  rj  w      HKr   c                    V ^8  d   QhRRRR/# )r   r   Literal['CFF2']r   zC_F_F__2.table_C_F_F__2r   )r   s   "r   r   r   z  rg  r   c                	    R # r   r   rL  s   &&r   ri  rj  y  rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['COLR']r   zC_O_L_R_.table_C_O_L_R_r   )r   s   "r   r   r   |  rg  r   c                	    R # r   r   rL  s   &&r   ri  rj  {  rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['CPAL']r   zC_P_A_L_.table_C_P_A_L_r   )r   s   "r   r   r   ~  rg  r   c                	    R # r   r   rL  s   &&r   ri  rj  }  rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['DSIG']r   zD_S_I_G_.table_D_S_I_G_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['EBDT']r   zE_B_D_T_.table_E_B_D_T_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['EBLC']r   zE_B_L_C_.table_E_B_L_C_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['FFTM']r   zF_F_T_M_.table_F_F_T_M_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['GDEF']r   zG_D_E_F_.table_G_D_E_F_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['GMAP']r   zG_M_A_P_.table_G_M_A_P_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['GPKG']r   zG_P_K_G_.table_G_P_K_G_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['GPOS']r   zG_P_O_S_.table_G_P_O_S_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['GSUB']r   zG_S_U_B_.table_G_S_U_B_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['GVAR']r   zG_V_A_R_.table_G_V_A_R_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['HVAR']r   zH_V_A_R_.table_H_V_A_R_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['JSTF']r   zJ_S_T_F_.table_J_S_T_F_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['LTSH']r   zL_T_S_H_.table_L_T_S_H_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['MATH']r   zM_A_T_H_.table_M_A_T_H_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['META']r   zM_E_T_A_.table_M_E_T_A_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['MVAR']r   zM_V_A_R_.table_M_V_A_R_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['SING']r   zS_I_N_G_.table_S_I_N_G_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['STAT']r   zS_T_A_T_.table_S_T_A_T_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['SVG ']r   zS_V_G_.table_S_V_G_r   )r   s   "r   r   r     rt  r   c                	    R # r   r   rL  s   &&r   ri  rj    rv  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['TSI0']r   zT_S_I__0.table_T_S_I__0r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['TSI1']r   zT_S_I__1.table_T_S_I__1r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['TSI2']r   zT_S_I__2.table_T_S_I__2r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['TSI3']r   zT_S_I__3.table_T_S_I__3r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['TSI5']r   zT_S_I__5.table_T_S_I__5r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['TSIB']r   zT_S_I_B_.table_T_S_I_B_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['TSIC']r   zT_S_I_C_.table_T_S_I_C_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['TSID']r   zT_S_I_D_.table_T_S_I_D_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['TSIJ']r   zT_S_I_J_.table_T_S_I_J_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['TSIP']r   zT_S_I_P_.table_T_S_I_P_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['TSIS']r   zT_S_I_S_.table_T_S_I_S_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['TSIV']r   zT_S_I_V_.table_T_S_I_V_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['TTFA']r   zT_T_F_A_.table_T_T_F_A_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['VARC']r   zV_A_R_C_.table_V_A_R_C_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['VDMX']r   zV_D_M_X_.table_V_D_M_X_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['VORG']r   zV_O_R_G_.table_V_O_R_G_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['VVAR']r   zV_V_A_R_.table_V_V_A_R_r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['Debg']r   zD__e_b_g.table_D__e_b_gr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['Feat']r   zF__e_a_t.table_F__e_a_tr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['Glat']r   zG__l_a_t.table_G__l_a_tr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['Gloc']r   zG__l_o_c.table_G__l_o_cr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['OS/2']r   zO_S_2f_2.table_O_S_2f_2r   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['Silf']r   zS__i_l_f.table_S__i_l_fr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['Sill']r   zS__i_l_l.table_S__i_l_lr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['ankr']r   z_a_n_k_r.table__a_n_k_rr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['avar']r   z_a_v_a_r.table__a_v_a_rr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['bsln']r   z_b_s_l_n.table__b_s_l_nr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['cidg']r   z_c_i_d_g.table__c_i_d_gr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['cmap']r   z_c_m_a_p.table__c_m_a_pr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['cvar']r   z_c_v_a_r.table__c_v_a_rr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['cvt ']r   z_c_v_t.table__c_v_tr   )r   s   "r   r   r     rt  r   c                	    R # r   r   rL  s   &&r   ri  rj    rv  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['feat']r   z_f_e_a_t.table__f_e_a_tr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['fpgm']r   z_f_p_g_m.table__f_p_g_mr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['fvar']r   z_f_v_a_r.table__f_v_a_rr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['gasp']r   z_g_a_s_p.table__g_a_s_pr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['gcid']r   z_g_c_i_d.table__g_c_i_dr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['glyf']r   z_g_l_y_f.table__g_l_y_fr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['gvar']r   z_g_v_a_r.table__g_v_a_rr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['hdmx']r   z_h_d_m_x.table__h_d_m_xr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['head']r   z_h_e_a_d.table__h_e_a_dr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['hhea']r   z_h_h_e_a.table__h_h_e_ar   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['hmtx']r   z_h_m_t_x.table__h_m_t_xr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['kern']r   z_k_e_r_n.table__k_e_r_nr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['lcar']r   z_l_c_a_r.table__l_c_a_rr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['loca']r   z_l_o_c_a.table__l_o_c_ar   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['ltag']r   z_l_t_a_g.table__l_t_a_gr   )r   s   "r   r   r      rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['maxp']r   z_m_a_x_p.table__m_a_x_pr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['meta']r   z_m_e_t_a.table__m_e_t_ar   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['mort']r   z_m_o_r_t.table__m_o_r_tr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['morx']r   z_m_o_r_x.table__m_o_r_xr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['name']r   z_n_a_m_e.table__n_a_m_er   )r   s   "r   r   r   
  rg  r   c                	    R # r   r   rL  s   &&r   ri  rj  	  rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['opbd']r   z_o_p_b_d.table__o_p_b_dr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['post']r   z_p_o_s_t.table__p_o_s_tr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['prep']r   z_p_r_e_p.table__p_r_e_pr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['prop']r   z_p_r_o_p.table__p_r_o_pr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['sbix']r   z_s_b_i_x.table__s_b_i_xr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['trak']r   z_t_r_a_k.table__t_r_a_kr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['vhea']r   z_v_h_e_a.table__v_h_e_ar   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# )r   r   Literal['vmtx']r   z_v_m_t_x.table__v_m_t_xr   )r   s   "r   r   r     rg  r   c                	    R # r   r   rL  s   &&r   ri  rj    rk  r   c                    V ^8  d   QhRRRR/# r   r   zLiteral['GlyphOrder']r   rQ  r   )r   s   "r   r   r     s    HH4HHr   c                	    R # r   r   rL  s   &&r   ri  rj    s    EHr   c                    V ^8  d   QhRRRR/# r   r   r/  r   zDefaultTable | GlyphOrderr   )r   s   "r   r   r     s    MM{M/HMr   c                	    R # r   r   rL  s   &&r   ri  rj    s    JMr   c                    V ^8  d   QhRRRR/# rn  r   )r   s   "r   r   r      s      { /H r   c                	   \        V4      pV P                  P                  V4      pVfV   VR8X  d   \        V4      pW P                  V&   V# V P                  e   V P                  V4      pV# \        RV,          4      hV# )NrQ  '%s' table not found)r   r   r   rQ  r   
_readTableKeyErrorr   r   r9  s   && r   ri  rj     s    #h$=l""3#(C 
 	 (,  5;<<r   c                    V ^8  d   QhRRRR/# )r   r   r   r   r{   r   )r   s   "r   r   r   -  s      c l r   c                	   \         P                  R V4       V P                  f   Q hV P                  V,          pV P                  e#   V P                  P	                  W34      pVe   V# \        V4      pV! V4      pW0P                  V&   \         P                  RV4        VP                  W 4       V P                  e   W0P                  W3&   V#   \         d    T P                  '       g   h \         P                  RT4       ^RIHp \        4       p\        P                  ! TR7       T! T4      pTP!                  4       Tn        Y0P                  T&   TP                  Y 4        Li ; i)Reading '%s' table from diskzDecompiling '%s' tablez@An exception occurred during the decompilation of the '%s' tablerz   )r   )r4  debugr   r   r   getTableClassr   	decompile	Exceptionr   	exceptionr6  r{   r   r   	print_excr   r1  )r   r   datar9  
tableClassr{   r   s   &&     r   rs  TTFont._readTable-  s;   		0#6{{&&&{{3'$$((#5E "3'
3 C		*C0	(OOD'  ',1c[)#  	(---MMRTW ::DT* %E--/EK$KKOOD'	(s   "C E,/A:E,+E,c               $    V ^8  d   QhRRRRRR/# )r   r   r/  r9  r{   r   r   r   )r   s   "r   r   r   N  s!     & &{ &< &D &r   c                	4    W P                   \        V4      &   R # r   )r   r   ru  s   &&&r   __setitem__TTFont.__setitem__N  s     %CHr   c                    V ^8  d   QhRRRR/# r   r   r/  r   r   r   )r   s   "r   r   r   Q  s     ! !{ !t !r   c                	    W9  d   \        R V,          4      hWP                  9   d   V P                  V V P                  '       d"   WP                  9   d   V P                  V R# R# R# )rr  N)rt  r   r   rL  s   &&r   __delitem__TTFont.__delitem__Q  sS    ?1C788++C ;;;3++-C  .;r   c                    V ^8  d   QhRRRR/# )r   r   rf  r   zB_A_S_E_.table_B_A_S_E_ | Noner   )r   s   "r   r   r   Z      NNN+INr   c                	    R # r   r   rL  s   &&r   r   
TTFont.getY      KNr   c                    V ^8  d   QhRRRR/# )r   r   rm  r   zC_B_D_T_.table_C_B_D_T_ | Noner   )r   s   "r   r   r   \  r  r   c                	    R # r   r   rL  s   &&r   r   r  [  r  r   c                    V ^8  d   QhRRRR/# )r   r   rp  r   zC_B_L_C_.table_C_B_L_C_ | Noner   )r   s   "r   r   r   ^  r  r   c                	    R # r   r   rL  s   &&r   r   r  ]  r  r   c                    V ^8  d   QhRRRR/# )r   r   rs  r   zC_F_F_.table_C_F_F_ | Noner   )r   s   "r   r   r   `      JJJ+EJr   c                	    R # r   r   rL  s   &&r   r   r  _      GJr   c                    V ^8  d   QhRRRR/# )r   r   rx  r   zC_F_F__2.table_C_F_F__2 | Noner   )r   s   "r   r   r   b  r  r   c                	    R # r   r   rL  s   &&r   r   r  a  r  r   c                    V ^8  d   QhRRRR/# )r   r   r{  r   zC_O_L_R_.table_C_O_L_R_ | Noner   )r   s   "r   r   r   d  r  r   c                	    R # r   r   rL  s   &&r   r   r  c  r  r   c                    V ^8  d   QhRRRR/# )r   r   r~  r   zC_P_A_L_.table_C_P_A_L_ | Noner   )r   s   "r   r   r   f  r  r   c                	    R # r   r   rL  s   &&r   r   r  e  r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zD_S_I_G_.table_D_S_I_G_ | Noner   )r   s   "r   r   r   h  r  r   c                	    R # r   r   rL  s   &&r   r   r  g  r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zE_B_D_T_.table_E_B_D_T_ | Noner   )r   s   "r   r   r   j  r  r   c                	    R # r   r   rL  s   &&r   r   r  i  r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zE_B_L_C_.table_E_B_L_C_ | Noner   )r   s   "r   r   r   l  r  r   c                	    R # r   r   rL  s   &&r   r   r  k  r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zF_F_T_M_.table_F_F_T_M_ | Noner   )r   s   "r   r   r   n  r  r   c                	    R # r   r   rL  s   &&r   r   r  m  r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zG_D_E_F_.table_G_D_E_F_ | Noner   )r   s   "r   r   r   p  r  r   c                	    R # r   r   rL  s   &&r   r   r  o  r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zG_M_A_P_.table_G_M_A_P_ | Noner   )r   s   "r   r   r   r  r  r   c                	    R # r   r   rL  s   &&r   r   r  q  r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zG_P_K_G_.table_G_P_K_G_ | Noner   )r   s   "r   r   r   t  r  r   c                	    R # r   r   rL  s   &&r   r   r  s  r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zG_P_O_S_.table_G_P_O_S_ | Noner   )r   s   "r   r   r   v  r  r   c                	    R # r   r   rL  s   &&r   r   r  u  r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zG_S_U_B_.table_G_S_U_B_ | Noner   )r   s   "r   r   r   x  r  r   c                	    R # r   r   rL  s   &&r   r   r  w  r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zG_V_A_R_.table_G_V_A_R_ | Noner   )r   s   "r   r   r   z  r  r   c                	    R # r   r   rL  s   &&r   r   r  y  r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zH_V_A_R_.table_H_V_A_R_ | Noner   )r   s   "r   r   r   |  r  r   c                	    R # r   r   rL  s   &&r   r   r  {  r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zJ_S_T_F_.table_J_S_T_F_ | Noner   )r   s   "r   r   r   ~  r  r   c                	    R # r   r   rL  s   &&r   r   r  }  r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zL_T_S_H_.table_L_T_S_H_ | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zM_A_T_H_.table_M_A_T_H_ | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zM_E_T_A_.table_M_E_T_A_ | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zM_V_A_R_.table_M_V_A_R_ | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zS_I_N_G_.table_S_I_N_G_ | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zS_T_A_T_.table_S_T_A_T_ | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zS_V_G_.table_S_V_G_ | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zT_S_I__0.table_T_S_I__0 | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zT_S_I__1.table_T_S_I__1 | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zT_S_I__2.table_T_S_I__2 | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zT_S_I__3.table_T_S_I__3 | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zT_S_I__5.table_T_S_I__5 | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zT_S_I_B_.table_T_S_I_B_ | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zT_S_I_C_.table_T_S_I_C_ | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zT_S_I_D_.table_T_S_I_D_ | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zT_S_I_J_.table_T_S_I_J_ | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zT_S_I_P_.table_T_S_I_P_ | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zT_S_I_S_.table_T_S_I_S_ | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zT_S_I_V_.table_T_S_I_V_ | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zT_T_F_A_.table_T_T_F_A_ | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zV_A_R_C_.table_V_A_R_C_ | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zV_D_M_X_.table_V_D_M_X_ | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zV_O_R_G_.table_V_O_R_G_ | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zV_V_A_R_.table_V_V_A_R_ | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zD__e_b_g.table_D__e_b_g | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zF__e_a_t.table_F__e_a_t | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zG__l_a_t.table_G__l_a_t | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zG__l_o_c.table_G__l_o_c | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zO_S_2f_2.table_O_S_2f_2 | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zS__i_l_f.table_S__i_l_f | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   zS__i_l_l.table_S__i_l_l | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   z_a_n_k_r.table__a_n_k_r | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   z_a_v_a_r.table__a_v_a_r | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   z_b_s_l_n.table__b_s_l_n | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   z_c_i_d_g.table__c_i_d_g | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   z_c_m_a_p.table__c_m_a_p | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   z_c_v_a_r.table__c_v_a_r | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   z_c_v_t.table__c_v_t | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   z_f_e_a_t.table__f_e_a_t | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   z_f_p_g_m.table__f_p_g_m | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r  r   z_f_v_a_r.table__f_v_a_r | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r   r   z_g_a_s_p.table__g_a_s_p | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r#  r   z_g_c_i_d.table__g_c_i_d | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r&  r   z_g_l_y_f.table__g_l_y_f | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r)  r   z_g_v_a_r.table__g_v_a_r | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r,  r   z_h_d_m_x.table__h_d_m_x | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r/  r   z_h_e_a_d.table__h_e_a_d | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r2  r   z_h_h_e_a.table__h_h_e_a | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r5  r   z_h_m_t_x.table__h_m_t_x | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r8  r   z_k_e_r_n.table__k_e_r_n | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r;  r   z_l_c_a_r.table__l_c_a_r | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r>  r   z_l_o_c_a.table__l_o_c_a | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   rA  r   z_l_t_a_g.table__l_t_a_g | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   rD  r   z_m_a_x_p.table__m_a_x_p | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   rG  r   z_m_e_t_a.table__m_e_t_a | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   rJ  r   z_m_o_r_t.table__m_o_r_t | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   rM  r   z_m_o_r_x.table__m_o_r_x | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   rP  r   z_n_a_m_e.table__n_a_m_e | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   rS  r   z_o_p_b_d.table__o_p_b_d | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   rV  r   z_p_o_s_t.table__p_o_s_t | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   rY  r   z_p_r_e_p.table__p_r_e_p | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r\  r   z_p_r_o_p.table__p_r_o_p | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   r_  r   z_s_b_i_x.table__s_b_i_x | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   rb  r   z_t_r_a_k.table__t_r_a_k | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   re  r   z_v_h_e_a.table__v_h_e_a | Noner   )r   s   "r   r   r      r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# )r   r   rh  r   z_v_m_t_x.table__v_m_t_x | Noner   )r   s   "r   r   r     r  r   c                	    R # r   r   rL  s   &&r   r   r    r  r   c                    V ^8  d   QhRRRR/# rk  r   )r   s   "r   r   r     s    @@,@@r   c                	    R # r   r   rL  s   &&r   r   r    s    =@r   c                    V ^8  d   QhRRRR/# )r   r   r/  r   &DefaultTable | GlyphOrder | Any | Noner   )r   s   "r   r   r     s    RR{R'MRr   c                	    R # r   r   rL  s   &&r   r   r    s    ORr   c               $    V ^8  d   QhRRRRRR/# )r   r   r/  defaultr|   r   z(DefaultTable | GlyphOrder | Any | _VT_cor   )r   s   "r   r   r     s$     7 77)/7	17r   c                	    R # r   r   r   r   r@  s   &&&r   r   r    s     47r   c               $    V ^8  d   QhRRRRRR/# )r   r   r/  r@  r   r   r=  r   )r   s   "r   r   r     s$      )3	/r   c                :     W,          #   \          d    Tu # i ; i)zGReturns the table if it exists or (optionally) a default if it doesn't.)rt  rB  s   &&&r   r   r    s#    	9 	N	s   
 c                    V ^8  d   QhRRRR/# )r   r   r   r   r   r   )r   s   "r   r   r     s     
3 
3	 
3d 
3r   c                    Wn         \        V R4      '       d   V =V P                  R4      '       d   V R,          P	                  V4       R# R# )zUSet the glyph order

Args:
        glyphOrder ([str]): List of glyph names in order.
r   r3  N)r   r   r   rM  setGlyphOrder)r   r   s   &&r   rG  TTFont.setGlyphOrder  sC     %4122+==  L&&z2 !r   c                   V ^8  d   QhRR/# rU  r   )r   s   "r   r   r   !  s     ! !y !r   c                    V P                   #   \         d     Mi ; iRT 9   d+   T R,          pTP                  4       T n         T P                   # RT 9   d   T R,          P                  4       pTf   T P                  4        T P                   # \	        T4      T R,          P
                  8  d2   \        P                  R4       T P                  4        T P                   # Y n          T P                   # T P                  4        T P                   # )zDReturns a list of glyph names ordered by their position in the font.CFF rA  r@  zMNot enough names found in the 'post' table, generating them from cmap instead)r   AttributeErrorrC  _getGlyphNamesFromCmapr   	numGlyphsr4  warning)r   cffr   s   &  r   rC  TTFont.getGlyphOrder!  s    	??" 		T>v,C!//1DO2 1 t^f335J! ++-  Z4<#9#99 c ++-
  #-  '')s    c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   D  s     ?2 ?2 ?2r   c                	   V P                  R 4      '       d"   V P                  R ,          pV P                  R  MRp\        V R,          P                  4      p\	        V4       Uu. uF  pRV,          NK  	  ppRV^ &   W@n        R V 9   d   V R ,          P                  4       pM/ p/ p\        V4       F]  w  r7Wu9   g   K  V P                  WW,          4      pVP                  V^ 4      ^,           ;qV&   V	^8  d   RW^,
          3,          pWV&   K_  	  R V 9   d.   V P                  R  W@n        V'       d   WP                  R &   R# R# R# u upi )cmapNr@  	glyph%.5dz.notdefz%s.alt%d)
rM  r   r   rN  ranger   buildReversedMin	enumerate_makeGlyphNamer   )
r   cmapLoadingrN  ir   reversecmapuseCounttempName	glyphNamenumUsess
   &         r   rM  TTFont._getGlyphNamesFromCmapD  sE    ==   ++f-KF#K V../	/4Y/?@/?!kAoo/?
@!
1 % T>v,779KK$Z0KA& !//0EF	08Y0JQ0NN9-Q; *i1-E EI )1 1 T> F#(O '2F#  5 As   $Ec                    V ^8  d   QhRRRR/# )r   	codepointr   r   r   r   )r   s   "r   r   r     s     % %# %# %r   c                	    ^ RI Hp WP                  9   d   VP                  V ,          # V R8:  d
   RV ,          # RV ,          # )r   )agli  zuni%04Xzu%X)r  re  UV2AGL)rc  re  s   & r   rY  TTFont._makeGlyphName  s<    !

"::i((& y((9$$r   c                   V ^8  d   QhRR/# rU  r   )r   s   "r   r   r     s      y r   c                8    \        V P                  4       4      pV# )z1Get a list of glyph names, sorted alphabetically.)sortedrC  )r   
glyphNamess   & r   getGlyphNamesTTFont.getGlyphNames  s    D..01
r   c                   V ^8  d   QhRR/# rU  r   )r   s   "r   r   r     s     < <	 <r   c                L    ^ RI Hp VP                  V P                  4       4      # )zJGet a list of glyph names, sorted alphabetically,
but not case sensitive.
)	textTools)rD  rp  caselessSortrC  )r   rp  s   & r   getGlyphNames2TTFont.getGlyphNames2  s!     	-%%d&8&8&:;;r   c                    V ^8  d   QhRRRR/# )r   glyphIDr   r   r   r   )r   s   "r   r   r     s     	) 	)C 	)C 	)r   c                f     V P                  4       V,          #   \         d    RT,          u # i ; i)zReturns the name for the glyph with the given ID.

If no name is available, synthesises one with the form ``glyphXXXXX``` where
```XXXXX`` is the zero-padded glyph ID.
rU  )rC  
IndexError)r   ru  s   &&r   getGlyphNameTTFont.getGlyphName  s5    	)%%'00 	)((	)s    00c                    V ^8  d   QhRRRR/# )r   lstzSequence[int]r   r   r   )r   s   "r   r   r     s     T TM Ti Tr   c                    V P                  4       p\        V4      pV Uu. uF  qDV8  d	   W$,          MRV,          NK  	  up# u upi )z8Converts a list of glyph IDs into a list of glyph names.rU  )rC  r   )r   r{  r   cntgids   &&   r   getGlyphNameManyTTFont.getGlyphNameMany  sA    '')
*oORSs9
+2CCsSSSs    Ac                    V ^8  d   QhRRRR/# )r   r_  r   r   r   r   )r   s   "r   r   r     s     
 
C 
C 
r   c                     V P                  4       V,          #   \         dF    TR,          R8X  d6    \        TR,          4      u #   \        \        3 d    \        T4      hi ; ih i ; i)z0Returns the ID of the glyph with the given name.:N   Nglyph:r  NN)getReverseGlyphMaprt  r   	NameError
ValueError)r   r_  s   &&r   
getGlyphIDTTFont.getGlyphID  sl    	**,Y77 	}'.y}--!:. ."9--.	s     A)AA)A$$A)c                    V ^8  d   QhRRRR/# )r   r{  Sequence[str]r   z	list[int]r   )r   s   "r   r   r     s     @ @- @I @r   c                    V P                  4       p V Uu. uF  q2V,          NK  	  up# u upi   \         d-    T P                  pT Uu. uF
  q4! T4      NK  	  Mu upi upu # i ; i)z8Converts a list of glyph names into a list of glyph IDs.)r  rt  r  )r   r{  dr_  r  s   &&   r   getGlyphIDManyTTFont.getGlyphIDMany  sf    ##%	@256#YiLL#666 	@J;>?3iJy)3??	@s'   / */ / A&
A	A&%A&c                    V ^8  d   QhRRRR/# )r   rebuildr   r   r   r   )r   s   "r   r   r     s     + +$ +> +r   c                n    V'       g   \        V R4      '       g   V P                  4        V P                  # )z.Returns a mapping of glyph names to glyph IDs.r   )r   _buildReverseGlyphOrderDictr   )r   r  s   &&r   r  TTFont.getReverseGlyphMap  s*    '$(@AA,,.***r   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r     s      ^ r   c                	d    / ;V n         p\        V P                  4       4       F	  w  r#W!V&   K  	  V# r   )r   rX  rC  )r   r  ru  r_  s   &   r   r  "TTFont._buildReverseGlyphOrderDict  s7    *,,#a"+D,>,>,@"AG"iL #Br   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r   r   r/  r   r   r   zlist[str | bytes]r   r   r   r   r   )r   s   "r   r   r     s=     < << <  	<
 K< 
<r   c                   W9   d   R# \        V4      pVP                   F6  pWc9  g   K  W`9   d   V P                  WbW44       K%  VP                  V4       K8  	  VP                  V4       V P	                  V4      pVeJ   VP                  \        V4      V34      pVe*   \        P                  RV4       VP                  W4       R# \        P                  RV4       WrV&   Ve   W!,          V\        V4      V3&   R# R# )zSInternal helper function for self.save(). Keeps track of
inter-table dependencies.
Nzreusing '%s' tablezWriting '%s' table to disk)
rz  dependenciesr   rW  getTableDatar   r   r4  ry  setEntry)	r   r   r   r   r   r  masterTable	tabledataentrys	   &&&&&    r   r   TTFont._writeTable  s     ;"3'
%22K&&$$[$KKK, 3 	C%%c*	!NNCHi#89E 		.4+		.4s!06JC),- "r   c                    V ^8  d   QhRRRR/# )r   r   r/  r   bytesr   )r   s   "r   r   r     s            r   c                b   \        V4      pV P                  V4      '       d9   \        P                  RV4       V P                  V,          P                  V 4      # V P                  '       d:   WP                  9   d*   \        P                  RV4       V P                  V,          # \        V4      h)zReturns the binary representation of a table.

If the table is currently loaded and in memory, the data is compiled to
binary and returned; if it is not currently loaded, the binary data is
read from the font file and returned.
zCompiling '%s' tablerx  )r   rM  r4  ry  r   compiler   rt  rL  s   &&r   r  TTFont.getTableData  s     #h==II,c2;;s#++D11[[[SKK/II4c:;;s##3-r   c          
     ,    V ^8  d   QhRRRRRRRRRR/# )	r   	preferCFFr   locationzMapping[str, _NumberT] | None
normalizedrecalcBoundsr   r   r   )r   s   "r   r   r      s<     + ++ 0+ 	+
 + 
+r   c                &   V'       d
   RV 9  d   RpV'       d   V'       g   V P                  V4      pRpRV 9   g   RV 9   d   V'       g   RV 9  d   \        W4      pM RV 9   d   \        WVR7      pM\        R4      hRV 9   d   \	        WV4      pV# )	a  Return a generic GlyphSet, which is a dict-like object
mapping glyph names to glyph objects. The returned glyph objects
have a ``.draw()`` method that supports the Pen protocol, and will
have an attribute named 'width'.

If the font is CFF-based, the outlines will be taken from the ``CFF ``
or ``CFF2`` tables. Otherwise the outlines will be taken from the
``glyf`` table.

If the font contains both a ``CFF ``/``CFF2`` and a ``glyf`` table, you
can use the ``preferCFF`` argument to specify which one should be taken.
If the font contains both a ``CFF `` and a ``CFF2`` table, the latter is
taken.

If the ``location`` parameter is set, it should be a dictionary mapping
four-letter variation tags to their float values, and the returned
glyph-set will represent an instance of a variable font at that
location.

If the ``normalized`` variable is set to True, that location is
interpreted as in the normalized (-1..+1) space, otherwise it is in the
font's defined axes space.
fvarNrK  CFF2r3  )r  zFont contains no outlinesVARC)normalizeLocationr   r   r   r   )r   r  r  r  r  glyphSets   &&&&& r   getGlyphSetTTFont.getGlyphSet   s    < d*HJ--h7HdNfn9d@R%d5Ht^&tLQH899T>&tx@Hr   c                    V ^8  d   QhRRRR/# )r   r  zMapping[str, float]r   zdict[str, float]r   )r   s   "r   r   r   -  s      *= BR r   c                    ^ RI Hp RV 9  d   \        R4      hV R,          P                  4       pV! W4      pRV 9   d   V R,          P	                  W4      pV# )ag  Normalize a ``location`` from the font's defined axes space (also
known as user space) into the normalized (-1..+1) space. It applies
``avar`` mapping if the font contains an ``avar`` table.

The ``location`` parameter should be a dictionary mapping four-letter
variation tags to their float values.

Raises ``TTLibError`` if the font is not a variable font.
)r  r  zNot a variable fontavar)fontTools.varLib.modelsr  r   getAxesrenormalizeLocation)r   r  r  axess   &&  r   r  TTFont.normalizeLocation-  sW     	>233F|##%$X4T>F|77GHr   c                    V ^8  d   QhRRRR/# )r   cmapPreferenceszSequence[tuple[int, int]]r   zdict[int, str] | Noner   )r   s   "r   r   r   B  s"     #I #I2#I 
#Ir   c                4    V R,          P                  VR7      # )a  Returns the 'best' Unicode cmap dictionary available in the font
or ``None``, if no Unicode cmap subtable is available.

By default it will search for the following (platformID, platEncID)
pairs in order::

                (3, 10), # Windows Unicode full repertoire
                (0, 6),  # Unicode full repertoire (format 13 subtable)
                (0, 4),  # Unicode 2.0 full repertoire
                (3, 1),  # Windows Unicode BMP
                (0, 3),  # Unicode 2.0 BMP
                (0, 2),  # Unicode ISO/IEC 10646
                (0, 1),  # Unicode 1.1
                (0, 0)   # Unicode 1.0

This particular order matches what HarfBuzz uses to choose what
subtable to use by default. This order prefers the largest-repertoire
subtable, and among those, prefers the Windows-platform over the
Unicode-platform as the former has wider support.

This order can be customized via the ``cmapPreferences`` argument.
rT  )r  )getBestCmap)r   r  s   &&r   r  TTFont.getBestCmapB  s    F F|'''HHr   c                    V ^8  d   QhRRRR/# )r   new_glyph_orderr   r   r   r   )r   s   "r   r   r   g  s     - -Y -4 -r   c                	"    ^RI H p V! W4       R# )   reorderGlyphsNr  )r   r  r  s   && r   r  TTFont.reorderGlyphsg  s    0d,r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  )Tr   )
)TNNNFFTr2  NF)F)TNFT)))   
   )r      )r      )r  r  )r   r  )r   r   )r   r  )r   r   )3r   r  r  r  __doc__r  NotImplementedr   r   r   r   r   r   r   r  r  r  r(  rF  rM  rR  __contains__r   r_  rc  r
   ri  rs  r  r  r   rG  rC  rM  staticmethodrY  rl  rr  rx  r  r  r  r  r  r   r  r  r  r  r  r  r   r   r   r   r      sl   Qf 10
	**GG!! :>.2-!#!&&+ $ !NR24!\1|7 7r' '6#9 # $B BH! !F *"
 L% & O OO OO OK KO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OK KO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OK KO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OH HM MB&! N NN NN NJ JN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NJ JN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NJ JN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN NN N@ @R R7 7 
3!F?2B % %
<	)T
@+ +< <@ "+ +Z*#I #IJ- -r   r   c                  B    ] tR tRtRtRR R lltR R ltR R	 ltR
tR# )rQ  im  z~A pseudo table. The glyph order isn't in the font as a separate
table, but it's nice to present it as such in the TTX format.
Nc                    V ^8  d   QhRRRR/# )r   r   r   r   r   r   )r   s   "r   r   GlyphOrder.__annotate__r  s      J $ r   c                	    R # r   r   rL  s   &&r   r   GlyphOrder.__init__r  s    r   c               $    V ^8  d   QhRRRRRR/# )r   r   r  r  r   r   r   r   )r   s   "r   r   r  u  s"      /  D r   c                	    VP                  4       pVP                  R 4       VP                  4        \        V4       F(  w  rEVP	                  RWER7       VP                  4        K*  	  R# )zAThe 'id' attribute is only for humans; it is ignored when parsed.GlyphID)idr   N)rC  commentr   rX  r%  )r   r   r  r   r[  r_  s   &&&   r   r8  GlyphOrder.toXMLu  sY    ))+
O	
 	%j1LAY1=NN 2r   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r   r   r   r<  zdict[str, str]contentz	list[Any]r  r   r   r   r   )r   s   "r   r   r    s4     . .. ..9B.LR.	.r   c                	    \        V R 4      '       g   . V n        VR8X  d#   V P                  P                  VR,          4       VP                  V P                  4       R# )r   r  r   N)r   r   rW  rG  )r   r   r<  r  r  s   &&&&&r   fromXMLGlyphOrder.fromXML  sH     t\** DO9OO""5=1T__-r   )r   r   )	r   r  r  r  r  r   r8  r  r  r   r   r   rQ  rQ  m  s    . .r   rQ  c                    V ^8  d   QhRRRR/# )r   r   r/  r   zModuleType | Noner   )r   s   "r   r   r     s     & & &(9 &r   c                    ^RI Hp \        V 4      p \        RV,           4       \	        W4      #   \
         d-   p\        T4      P                  T4      ^ 8  d    Rp?R# ThRp?ii ; i)zSFetch the packer/unpacker module for a table.
Return None when no module is found.
rK  zfontTools.ttLib.tables.N)r   r   r$  
__import__getattrImportErrorr   find)r   r   pyTagerrs   &   r   getTableModuler    sb     C E&,u45 v%%  
 s8==1$Is   0 A'A" A""A'z"dict[str | bytes, tuple[str, str]]_customTableRegistryc               (    V ^8  d   QhRRRRRRRR/# )	r   r   r/  
moduleNamer   	classNamer   r   r   r   )r   s   "r   r   r     s,     8 8	8"%82<8	8r   c                F    Vf   R\        V 4      ,           pW3\        V &   R# )aJ  Register a custom packer/unpacker class for a table.

The 'moduleName' must be an importable module. If no 'className'
is given, it is derived from the tag, for example it will be
``table_C_U_S_T_`` for a 'CUST' tag.

The registered table class should be a subclass of
:py:class:`fontTools.ttLib.tables.DefaultTable.DefaultTable`
Ntable_)r$  r  )r   r  r  s   &&&r   registerCustomTableClassr    s'     s33	!+ 7r   c                    V ^8  d   QhRRRR/# r  r   )r   s   "r   r   r     s     " "K "D "r   c                    \         V  R# )z8Unregister the custom packer/unpacker class for a table.N)r  r   s   &r   unregisterCustomTableClassr    s
    S!r   c                    V ^8  d   QhRRRR/# )r   r   r/  r   ztype[DefaultTable] | Noner   )r   s   "r   r   r     s     
& 
&[ 
&-F 
&r   c                z    V \         9  d   R# ^ RIp\         V ,          w  r#VP                  V4      p\        WC4      # )zwReturn the custom table class for tag, if one has been registered
with 'registerCustomTableClass()'. Else return None.
N)r  	importlibimport_moduler  )r   r  r  r  modules   &    r   getCustomTableClassr    s;     &&05J$$Z0F6%%r   c                    V ^8  d   QhRRRR/# )r   r   r/  r   type[DefaultTable]r   )r   s   "r   r   r     s      { '9 r   c                    \        V 4      pVe   V# \        V 4      pVf	   ^RIHp V# \	        V 4      p\        VRV,           4      pV# )z,Fetch the packer/unpacker class for a table.rz   r  )r  r  r6  r{   r$  r  )r   r  r  r{   r  s   &    r   rz  rz    sQ    $S)JC F~5C EE!12Jr   c                    V ^8  d   QhRRRR/# )r   klassr  r   r/  r   )r   s   "r   r   r     s     ! !) !k !r   c                b    V P                   pVR,          R8X  g   Q hVR,          p\        V4      # )z'Fetch the table tag for a class object.:Nr  Nr  :r  NN)r   identifierToTag)r  r   s   & r   getClassTagr    s1    >>D8x8D4  r   c                    V ^8  d   QhRRRR/# )r   r   r/  r   r{   r   )r   s   "r   r   r     s      + , r   c                (    \        V 4      pV! V 4      # )z!Return a new instance of a table.)rz  )r   r  s   & r   newTabler    s    s#Jc?r   c                    V ^8  d   QhRRRR/# )r   cr   r   r   )r   s   "r   r   r     s     	# 	#3 	#3 	#r   c                    ^ RI pVP                  RV 4      '       d
   RV ,           # VP                  RV 4      '       d
   V R,           # \        \        V 4      4      R,          # )z%Helper function for tagToIdentifier()Nz[a-z0-9]_z[A-Z]:r   NN)rematchhexr   )r  r
  s   & r   _escapecharr    sL    	xx
AQw	'1		3w71:r""r   c                    V ^8  d   QhRRRR/# r   r   r/  r   r   r   )r   s   "r   r   r     s            r   c                *   ^ RI p\        V 4      p V R8X  d   V # \        V 4      ^8X  g   Q R4       h\        V 4      ^8  d   V R,          R8X  d   V RR p K%  RpV  F  pV\        V4      ,           pK  	  VP	                  RV4      '       d
   RV,           pV# )	a  Convert a table tag to a valid (but UGLY) python identifier,
as well as a filename that's guaranteed to be unique even on a
caseless file system. Each character is mapped to two characters.
Lowercase letters get an underscore before the letter, uppercase
letters get an underscore after the letter. Trailing spaces are
trimmed. Illegal characters are escaped as two hex bytes. If the
result starts with a number (as the result of a hex escape), an
extra underscore is prepended. Examples:
.. code-block:: pycon

    >>>
    >> tagToIdentifier('glyf')
    '_g_l_y_f'
    >> tagToIdentifier('cvt ')
    '_c_v_t'
    >> tagToIdentifier('OS/2')
    'O_S_2f_2'
NrQ  ztag should be 4 characters long r   z[0-9]r	  r  )r
  r   r   r  r  )r   r
  identr  s   &   r   r$  r$    s    & 
c(C
l
s8q=;;;=
c(Q,3r7c>#2hEA& 	xxeLr   c                    V ^8  d   QhRRRR/# )r   r  r   r   r   )r   s   "r   r   r     s      3 3 r   c           
        V R8X  d   V # \        V 4      ^,          '       d   V ^ ,          R8X  d
   V R,          p \        V 4      ^,          '       d   Q hRp\        ^ \        V 4      ^4       Fr  pW,          R8X  d   WV^,           ,          ,           pK(  W^,           ,          R8X  d   WV,          ,           pKM  V\        \        WV^,            ^4      4      ,           pKt  	  V^\        V4      ,
          R,          ,           p\	        V4      # )z!the opposite of tagToIdentifier()rQ  r	  :r  NNr   r  )r   rV  chrr   r   )r  r   r[  s   &  r   r  r    s    
5zA~~%(c/b	E
Q
C1c%j!$8s?a!e$Cq5\S a.C C!a% 0"566C % SX$
$Cs8Or   c                    V ^8  d   QhRRRR/# r  r   )r   s   "r   r   r   )  s     $ $+ $# $r   c                    ^ RI p\        V 4      p V R8X  d   R# V R8X  d   V # VP                  RV 4      '       d   V P                  4       # \	        V 4      # )zSimilarly to tagToIdentifier(), this converts a TT tag
to a valid XML element name. Since XML element names are
case sensitive, this is a fairly simple/readable translation.
NOS/2OS_2rQ  z[A-Za-z_][A-Za-z_0-9]* *$)r
  r   r  stripr$  )r   r
  s   & r   r&  r&  )  sP    
 
c(C
f}		
	xx+S11yy{s##r   c                    V ^8  d   QhRRRR/# )r   r   r   r   r   )r   s   "r   r   r   ;  s     / /# /# /r   c                    V R8X  d   \        R4      # \        V 4      ^8X  d   \        V 4      # \        V R^\        V 4      ,
          ,          ,           4      # )zThe opposite of tagToXML()r  r  r  )r   r   r  r  s   &r   xmlToTagr  ;  sF    
f}6{
3x1}s##3CH--..r   c               $    V ^8  d   QhRRRRRR/# )r   tagListr  r   r   r   r   r   )r   s   "r   r   r   _  s$      (<r   c                *   \        V 4      p Vf>   RV 9   d#   V P                  R4       V P                  R4       RV 9   d   \        pM\        p. pV F-  pW09   g   K  VP                  V4       V P                  V4       K/  	  VP                  V 4       V# )zReturn a sorted copy of tagList, sorted according to the OpenType
specification, or according to a custom tableOrder. If given and not
None, tableOrder needs to be a list of tag names.
DSIGrK  )rj  rX  rW  OTFTableOrderTTFTableOrderextend)r  r   orderedTablesr   s   &&  r   rY  rY  _  s     WoGWNN6"NN6"W&J&JM>  %NN3  !r   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   inFiler   outFiler   r   r   r   r   r   r   )r   s   "r   r   r   y  s:       % 	
 
r   c                l   V P                  ^ 4       VP                  ^ 4       \        WR7      p\        V\        VP                  4      VP
                  VP                  VP                  4      p\        VP                  4       4      p\        Wb4       F  pWG,          WW&   K  	  VP                  4        R# )z[Rewrite a font file, ordering the tables as recommended by the
OpenType specification 1.4.
)r   N)r   r   r   r   r   r   r   r   r   r   rY  r   )r'  r(  r   r   r   r   r   r   s   &&&&    r   r   r   y  s     KKNLLO>FFMMF &++- FV0k 1
LLNr   c                    V ^8  d   QhRRRR/# )r   xr   r   r   )r   s   "r   r   r     s        S  S  r   c                d    ^ pV '       d   V ^,	          p V^,           pK  \        V^,
          ^ 4      # )zWReturn the highest exponent of two, so that
(2 ** exponent) <= x.  Return 0 if x is 0.
)max)r+  exponents   & r   maxPowerOfTwor/    s/     H
Fa<x!|Qr   c               $    V ^8  d   QhRRRRRR/# )r   nr   itemSizer   ztuple[int, int, int]r   )r   s   "r   r   r     s"     2 2c 2S 22F 2r   c                v    \        V 4      p^V,          V,          pTp\        ^ W,          V,
          4      pW4V3# )z1Calculate searchRange, entrySelector, rangeShift.)r/  r-  )r1  r2  r.  searchRangeentrySelector
rangeShifts   &&    r   getSearchRanger7    s?     QHh;(*KMQ{23Jz11r   r   )r   hhear@  r  hmtxLTSHVDMXhdmxrT  fpgmprepzcvt locar3  kernr   rA  gaspPCLT)r   r8  r@  r  r   rT  rA  rK  r  )   )__conditional_annotations__
__future__r   loggingr   r   ior   r   r   typingr   r   r	   r
   fontTools.configr   rD  r   fontTools.misc.configToolsr   fontTools.misc.loggingToolsr   fontTools.misc.textToolsr   r   r   fontTools.ttLibr   fontTools.ttLib.sfntr   r   fontTools.ttLib.ttGlyphSetr   r   r   r   r   collections.abcr   r   typesr   r   r   r   r    r!   r"   typing_extensionsr#   r$   fontTools.ttLib.tablesr%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   #fontTools.ttLib.tables.DefaultTabler{   r|   	getLoggerr   r4  floatr~   objectr   rQ  r  r  r  r  r  r  rz  r  r  r  r$  r  r&  r  r#  r"  rY  r   r/  r7  )rD  s   @r   <module>rX     s   " "  	  6 6 > > # $ 5 9 8 8 & 7  7/??.V V V V V V V V V V V V V V V V V V V V V Vn AX.F! :U+j-V j-Z'. .8&2 <> 8 =8""

&!	# F*$$/, Q42 2 2r   