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

TSI5 contains the VTT character groups.

See also https://learn.microsoft.com/en-us/typography/tools/vtt/tsi-tables
    N)safeEval   )DefaultTablec                   ,    \ rS rSrS rS rS rS rSrg)table_T_S_I__5   c           	         US   R                   n[        R                  " S5      nUR                  U5        [        R                  S:w  a  UR                  5         0 U l        [        U5      S-  nXS:w  a,  XS-
  n[        R                  S[        U5       SU SU S35        [        U5       H#  nXG   U R                  UR                  U5      '   M%     g )	NmaxpHbig   zCNumber of entries differs from the number of glyphs in the font by z (z entries vs. z	 glyphs).)	numGlyphsarray	frombytessys	byteorderbyteswapglyphGroupinglenlogwarningabsrangegetGlyphName)selfdatattFontr   a
numEntriesdiffis           Y/var/www/fran/franai/venv/lib/python3.13/site-packages/fontTools/ttLib/tables/T_S_I__5.py	decompiletable_T_S_I__5.decompile   s    6N,,	KK	D==E!JJLY!^
")DKK$i[:,mI;iQ z"A9:Dv22156 #    c                    UR                  5       n[        R                  " S5      nU H.  nUR                  U R                  R	                  US5      5        M0     [
        R                  S:w  a  UR                  5         UR                  5       $ )Nr   r   r   )	getGlyphOrderr   appendr   getr   r   r   tobytes)r   r   
glyphNamesr   	glyphNames        r"   compiletable_T_S_I__5.compile&   sh    ))+
KK#IHHT''++Iq9: $==E!JJLyy{r%   c                     [        U R                  R                  5       5      nU H0  nUR                  SX@R                  U   S9  UR	                  5         M2     g )N
glyphgroup)namevalue)sortedr   keys	simpletagnewline)r   writerr   namesr,   s        r"   toXMLtable_T_S_I__5.toXML/   sT    t))..01I94F4Fy4Q   NN	 r%   c                 ~    [        U S5      (       d  0 U l        US:w  a  g [        US   5      U R                  US   '   g )Nr   r0   r2   r1   )hasattrr   r   )r   r1   attrscontentr   s        r"   fromXMLtable_T_S_I__5.fromXML7   s?    t_--!#D<,4U7^,D5=)r%   )r   N)	__name__
__module____qualname____firstlineno__r#   r-   r9   r?   __static_attributes__ r%   r"   r   r      s    >"Er%   r   )__doc__r   loggingr   fontTools.misc.textToolsr    r   	getLoggerrA   r   r   rF   r%   r"   <module>rL      s?      
 - !(E\.. (Er%   