+
    f7ii  c                   s^    ^ RI Ht ^RIHt  ! R R]P                  4      t ! R R]4      tR# )i    )safeEval)DefaultTablec                   sd   a  ] tR t^	t o Rt]R 4       tR tR tR t	R t
R tR tR	 tR
 tRtV tR# )table_C_O_L_R_a  Color table

The ``COLR`` table defines color presentation of outline glyphs. It must
be used in concert with the ``CPAL`` table, which contains the color
descriptors used.

This table is structured so that you can treat it like a dictionary keyed by glyph name.

``ttFont['COLR'][<glyphName>]`` will return the color layers for any glyph.

``ttFont['COLR'][<glyphName>] = <value>`` will set the color layers for any glyph.

See also https://learn.microsoft.com/en-us/typography/opentype/spec/colr
c                s   V P                   '       g   / # / pV P                   P                  p\        V4      pV P                  P                   F}  pVP
                  pVP                  pVP                  p. p\        WfV,           4       F:  p	W),          p
VP                  \        V
P                  V
P                  4      4       K<  	  WV&   K  	  V# N)ZLayerRecordArrayLayerRecordZlenZBaseGlyphRecordArrayZBaseGlyphRecordZ	BaseGlyphZFirstLayerIndexZ	NumLayersZrangeappendZ
LayerGlyphZPaletteIndex)tableZcolorLayerListsZlayerRecordsZnumLayerRecordsZbaseRec	baseGlyphZfirstLayerIndexZ	numLayerslayersZiZlayerRecs   &          F/usr/lib64/python3.14/site-packages/fontTools/ttLib/tables/C_O_L_R_.py_decompileColorLayersV0Z&table_C_O_L_R_._decompileColorLayersV0   s    %%%I--99l+11AAG))I%55O))IF?i,GH'?k(*=*=x?T?TUV I *0I& B     c                sl   ^RI Hp ^ RIHp \	        W P
                  4      pV! 4       pV P                  Vn        T! TV P                  P                  4        UUUu/ uF,  w  rgYg Uu. uF  qP                  VP                  3NK  	  upbK.  	  upppVP                  RR7      R7       V# u upi u upppi )   otTables)populateCOLRv0T)Zrebuild)ZglyphMap) r   ZfontTools.colorLib.builderr   getattrtableTagversionVersionColorLayersitemsnamecolorIDZgetReverseGlyphMap)	selfttFontr   r   
tableClassr   r   r   layers	   &&       r	   
_toOTTableZtable_C_O_L_R_._toOTTable,   s    =X}}5
 *.)9)9)?)?)A)A%I VLVEZZ7VLL)A ..t.<	
  Ms   B/& B*B/*B/c                s   ^RI Hp ^RIHp V! WP                  R7      p\        W@P                  4      pV! 4       pVP                  WR4       VP                  V n        V P                  ^ 8X  d   V P                  V4      V n
        R# Wpn        R# )r   )OTTableReaderr   r   N)otBaser   r   r   r   r   	decompiler   r   r
   r   r   )r   Zdatar   r   r   Zreaderr   r   s   &&&     r	   r!   Ztable_C_O_L_R_.decompile>   sj    ) tmm<X}}5
'}}<<1#;;EBD Jr   c                s    ^RI Hp \        V R4      '       d   V P                  pMV P	                  V4      pV! V P
                  R7      pVP                  WA4       VP                  4       # )r   )OTTableWriterr   r   )r    r"   hasattrr   r   r   compileZ
getAllData)r   r   r"   r   writers   &&   r	   r$   Ztable_C_O_L_R_.compileP   sR    )4!!JJEOOF+E6f%  ""r   c                s   \        V R 4      '       d   V P                  P                  W4       R# VP                  RV P                  R7       VP                  4        \        V P                  P                  4       VP                  R7       Fr  pVP                  RVR7       VP                  4        V P                  V,           F  pVP                  W4       K  	  VP                  R4       VP                  4        Kt  	  R# )r   r   )value)Zkey
ColorGlyph)r   N)r#   r   ZtoXML2	simpletagr   newlineZsortedr   ZkeysZ
getGlyphIDZbegintagtoXMLZendtag)r   r%   r   r   r   s   &&&  r	   r*   Ztable_C_O_L_R_.toXML\   s    4!!JJf-Ydll;NN#D$4$4$9$9$;ARARS	9= !--i88EKK/ 9l+  Tr   c                s   VR 8X  d   \        W\        VR,          4      4       R# VR8X  d   \        V R4      '       g   / V n        VR,          pV F  p\	        V\
        4      '       g   K  K  	  . pV F_  p\	        V\
        4      '       d   K  \        4       pVP                  V^ ,          V^,          V^,          V4       VP                  V4       Ka  	  WpP                  V&   R# ^RI	H
p	 \        V R4      '       g"   \        WP                  4      p
V
! 4       V n        V P                  P                  WW44       V P                  P                  4        V P                  P                  V n        R# )r   r&   r'   r   r   r   r   N)setattrr    r#   r   
isinstancestrr   fromXMLr   r   r   r   r   r   ZpopulateDefaultsr   r   )r   r   attrscontentr   	glyphNameZelementr   r   r   r   s   &&&&&      r	   r.   Ztable_C_O_L_R_.fromXMLj   s   9Dw 89\!4//#% fI"gs++ # F"gs++#gaj'!*gaj&Ie$ # +1Y'"4))$X}}=
'\
JJtG<JJ'')::--DLr   c                s    \        V\        4      '       g"   \        R \        V4      P                   24      hV P
                  V,          # )expected str, found r,   r-   Z	TypeErrorZtype__name__r   r   r1      &&r	   __getitem__Ztable_C_O_L_R_.__getitem__   s>    )S))24	?3K3K2LMNN	**r   c                s    \        V\        4      '       g"   \        R \        V4      P                   24      hVe   W P
                  V&   R# WP
                  9   d   V P
                  V R# R# )r2   Nr3   )r   r1   r&      &&&r	   __setitem__Ztable_C_O_L_R_.__setitem__   s`    )S))24	?3K3K2LMNN*/Y'***  + +r   c                s     V P                   V R # r   )r   r5   r6   r	   __delitem__Ztable_C_O_L_R_.__delitem__   s    Y'r   )r   r   r   N)r4   
__module____qualname____firstlineno__Z__doc__Zstaticmethodr
   r   r!   r$   r*   r.   r7   r9   r:   __static_attributes____classdictcell__Z__classdict__   @r	   r   r   	   sK       $$$
#!.8+
,( (r   r   c                   s6   a  ] tR t^t o RR ltR tR tRtV tR# )r   Nc                s    Wn         W n        R # r   r   r   )r   r   r   r8   r	   __init__ZLayerRecord.__init__   s    	r   c                sv    VP                  R V P                  V P                  R7       VP                  4        R# )r   rB   N)r(   r   r   r)   )r   r%   r   r8   r	   r*   ZLayerRecord.toXML   s)    tyy$,,Gr   c                s    VP                  4        F/  w  rVVR 8X  d   \        WV4       K  \        W\        V4      4       K1  	  R# )r   N)r   r+   r    )r   Zeltnamer/   r0   r   r   r&   s   &&&&&  r	   r.   ZLayerRecord.fromXML   s3     ;;=KDv~E*HUO4	 )r   )r   r   )NN)	r4   r;   r<   r=   rC   r*   r.   r>   r?   r@   rA   r	   r   r      s     5 5r   r   N)ZfontTools.misc.textToolsr    r   r   r   Zobjectr   ) r   r	   <module>rD      s.   
 . K(\.. K(\5& 5r   