
    h                     `    S r SSKJr  SSKJr  SSKJrJrJr   " S S\\R                  5      r	g)	a\  TSI{0,1,2,3,5} are private tables used by Microsoft Visual TrueType (VTT)
tool to store its hinting source data.

TSI1 contains the text of the glyph programs in the form of low-level assembly
code, as well as the 'extra' programs 'fpgm', 'ppgm' (i.e. 'prep'), and 'cvt'.

See also https://learn.microsoft.com/en-us/typography/tools/vtt/tsi-tables
   )DefaultTable    )LogMixin)strjointobytestostrc                   >    \ rS rSrSSSSS.rSrS rS	 rS
 rS r	Sr
g)table_T_S_I__1   ppgmcvtreservedfpgm)i  i  i  i  TSI0c                 &   [        U5      nX R                     n[        UR                  UR                  4S5       GHQ  u  pV0 n[        U5       GH#  u  nu  pnU(       a  U R                  U	   nOUR                  U	5      nX:  a   U R                  R                  SU-  5        MW  U
S:  a  OU
S:X  au  U[        U5      S-
  :H  nU(       a  U(       a  UnOUR                  S   S   nO
XXS-      S   nX:  d   S5       eX:  a   U R                  R                  SU-  5        UnX-
  n
OSS	K
Jn  UR                  S
X4-  5      eXX-    n[        U5      U
:X  d   e[        USS9nU(       d  GM  UX|'   GM&     U(       a	  Xpl        GMK  Xpl        GMT     g )N)FTz$textOffset > totalLength; %r skipped   r   r      zentries not sorted by offsetz*nextTextOffset > totalLength; %r truncated)ttLibz&%r textLength (%d) must not be > 32768utf-8encoding)len
indextablezipindicesextra_indices	enumerateextrasgetGlyphNamelogwarning	fontToolsr   
TTLibErrorr   extraProgramsglyphPrograms)selfdatattFonttotalLengthr   r   isExtraprogramsiglyphID
textLength
textOffsetnameisLastnextTextOffsetr   texts                    Q/var/www/html/env/lib/python3.13/site-packages/fontTools/ttLib/tables/T_S_I__1.py	decompiletable_T_S_I__1.decompile   s   $iOO,
 #!9!9:M!
G H8A'8J44G;;w/D!..w7D+HH$$%Kd%RS& 6)3w<!#34F"
 .9N .8-E-Ea-H-KN
 *1Q):)7W9WW7%3((H4O *5!/!<J/**@DCUU  )@A4yJ...TG44%)HNi 9Kj %-"%-"y!
    c                 D   [        U S5      (       d  0 U l        0 U l        SnXR                     nUR	                  5       n/ n[        [        U5      5       H{  n[        U5      S-  (       a  US-   nXF   nXpR                  ;   a  [        U R                  U   SS9nOSn[        U5      n	U	S:  a  Sn	UR                  Xi[        U5      45        X(-   nM}     / n
[        U R                  R                  5       5      n[        [        U5      5       H}  n[        U5      S-  (       a  US-   nX   u  pXpR                  ;   a  [        U R                  U   SS9nOSn[        U5      n	U	S:  a  Sn	U
R                  X[        U5      45        X(-   nM     UR                  XZ5        U$ )Nr%   r7   r      r   r   r   )hasattrr%   r$   r   getGlyphOrderranger   r   appendsortedr   itemsset)r&   r(   r'   r   
glyphNamesr   r,   r0   r3   r.   r   codescodes                r4   compiletable_T_S_I__1.compileU   s   t_--!#D!#DOO,
))+
s:'A4y1}7N  =D)))t11$7'JTJV##
NNA3t956;D (  t{{((*+s5z"A4y1}7N  JD)))t11$7'JTJV##
  $CI!>?;D # 	w.r7   c                 <   [        U R                  R                  5       5      nUR                  5         U H  nU R                  U   nU(       d  M  UR	                  SUS9  UR                  5         UR                  UR                  SS5      5        UR                  5         UR                  S5        UR                  5         UR                  5         M     [        U R                  R                  5       5      nU H  nU R                  U   nU(       d  M  UR	                  SUS9  UR                  5         UR                  UR                  SS5      5        UR                  5         UR                  S5        UR                  5         UR                  5         M     g )NglyphProgram)r0   
extraProgram)	r>   r%   keysnewlinebegintagwrite_noindentreplaceendtagr$   )r&   writerr(   namesr0   r3   extra_namess          r4   toXMLtable_T_S_I__1.toXML   s:   t))..01D%%d+DOONO6NN!!$,,tT":;NNMM.)NNNN  T//4467D%%d+DOONO6NN!!$,,tT":;NNMM.)NNNN  r7   c                    [        U S5      (       d  0 U l        0 U l        [        U5      R	                  SS5      R                  S5      nSR                  USS 5      nUS:X  a  X`R                  US   '   g US:X  a  X`R                  US   '   g g )	Nr%   rH   rI   r   rG   r0   rJ   )r:   r%   r$   r   rO   splitjoin)r&   r0   attrscontentr(   linesr3   s          r4   fromXMLtable_T_S_I__1.fromXML   s    t_--!#D!#D ((t4::4@yyq%>!04uV}-^#04uV}- $r7   )r$   r%   N)__name__
__module____qualname____firstlineno__r   r   r5   rD   rT   r]   __static_attributes__ r7   r4   r
   r
      s+    eZPFJ?.B+Z6	5r7   r
   N)
__doc__ r   fontTools.misc.loggingToolsr   fontTools.misc.textToolsr   r   r   r
   rd   r7   r4   <module>ri      s.     0 < <W5X|88 W5r7   