
    h}
                     f    S SK Jr  S SKJr  SSKJr  S SKrS SKrSr " S S\R
                  5      r	g)	    )sstruct)safeEval   )DefaultTableNz
    >        # big endian
    version: 16.16F    # Table version
    flags:        H    # bit 0: 1=long format, 0=short format
                       # bit 1: 1=attribute names, 0=no names
    numAttribs:   H    # NUmber of attributes
c                   X    \ rS rSrSrS/rSS jrS rS rS r	S	 r
S
 rS rS rS rSrg)table_G__l_o_c   zuGraphite Index to Glyph Atttributes table

See also https://graphite.sil.org/graphite_techAbout#graphite-font-tables
GlatNc                 ^    [         R                   R                  X5        S U l        SU l        g )Nr   )r   __init__	attribIds
numAttribs)selftags     Q/var/www/html/env/lib/python3.13/site-packages/fontTools/ttLib/tables/G__l_o_c.pyr   table_G__l_o_c.__init__   s$    !!**45    c                 x   [         R                  " [        X5      u  p1U R                  nU ?[        R                  " US-  (       a  SOS5      U l        U R
                  R                  US [        U5      U R                  US-  -  -
   5        [        R                  S:w  a  U R
                  R                  5         [        R                  " S5      U l        US-  (       a[  U R                  R                  XR                  * S-  S  5        [        R                  S:w  a  U R                  R                  5         g g g )Nr   IH   big)r   unpack2Gloc_headerflagsarray	locations	frombyteslenr   sys	byteorderbyteswapr   )r   datattFont_r   s        r   	decompiletable_G__l_o_c.decompile   s    //+t:

JEAIS3?  &QD	DOOuqy4Q(Q!RS==E!NN##%S)19NN$$T??*:Q*>*@%AB}}%'') & r   c           	         [         R                  " [        [        S[	        U R
                  5      S-  U R                  R                  S:H  -   U R                  S95      n[        R                  S:w  a  U R                  R                  5         X R                  R                  5       -  n[        R                  S:w  a  U R                  R                  5         U R
                  (       ax  [        R                  S:w  a  U R
                  R                  5         X R
                  R                  5       -  n[        R                  S:w  a  U R
                  R                  5         U$ )Ng      ?r   r   )versionr   r   r   )r   packr   dictboolr   r   typecoder   r    r!   r"   tobytes)r   r$   r#   s      r   compiletable_G__l_o_c.compile,   s    ||DNN+q0T^^5L5LPS5ST??
 ==E!NN##%&&((==E!NN##%>>}}%'')NN**,,D}}%'')r   c                 j    [        U5      S:  n[        R                  " U(       a  SOSU5      U l        g )Ni   r   r   )maxr   r   )r   r   long_formats      r   settable_G__l_o_c.setB   s&    )n-KSS)Lr   c                 X    UR                  SU R                  S9  UR                  5         g )N
attributes)number)	simpletagr   newline)r   writerr$   s      r   toXMLtable_G__l_o_c.toXMLF   s#    doo>r   c                 J    US:X  a  [        [        US   5      5      U l        g g )Nr7   r8   )intr   r   )r   nameattrscontentr$   s        r   fromXMLtable_G__l_o_c.fromXMLJ   s$    <!(5?";<DO  r   c                      U R                   U   $ N)r   )r   indexs     r   __getitem__table_G__l_o_c.__getitem__N   s    ~~e$$r   c                 ,    [        U R                  5      $ rF   )r   r   r   s    r   __len__table_G__l_o_c.__len__Q   s    4>>""r   c                 ,    [        U R                  5      $ rF   )iterr   rK   s    r   __iter__table_G__l_o_c.__iter__T   s    DNN##r   )r   r   r   rF   )__name__
__module____qualname____firstlineno____doc__dependenciesr   r&   r/   r4   r<   rC   rH   rL   rP   __static_attributes__ r   r   r   r      s>    
 8L
*,M=%#$r   r   )
fontTools.miscr   fontTools.misc.textToolsr    r   r   r    r   r   rY   r   r   <module>r]      s/    " -   
D$\.. D$r   