
    h                     f    S SK Jr  S SKJrJr  S SKrSr\R                  " \5      r " S S\	5      r
g)    )sstruct)readHexsafeEvalNa  
	>
	originOffsetX: h	# The x-value of the point in the glyph relative to its
						# lower-left corner which corresponds to the origin of
						# the glyph on the screen, that is the point on the
						# baseline at the left edge of the glyph.
	originOffsetY: h	# The y-value of the point in the glyph relative to its
						# lower-left corner which corresponds to the origin of
						# the glyph on the screen, that is the point on the
						# baseline at the left edge of the glyph.
	graphicType:  4s	# e.g. "png "
c                   L    \ rS rSr        S
S jrS rS rS rS rS r	S	r
g)Glyph   Nc	                    Xl         Xl        X l        X0l        X@l        Xpl        XPl        X`l        U R                  b  U R                  S   S:X  a  U R                  S S U l        [        U R                  5      S:  a  SSK	J
n	  U	R                  S5      e[        U R                  5      S:  a/  U =R                  SS S[        U R                  5      -
   -  sl        g g g )N    r   ttLibz7Glyph.graphicType must not be longer than 4 characters.z    )gid	glyphNamereferenceGlyphNameoriginOffsetXoriginOffsetYrawdatagraphicType	imageDatalen	fontToolsr   
TTLibError)
selfr   r   r   r   r   r   r   r   r   s
             R/var/www/html/env/lib/python3.13/site-packages/fontTools/ttLib/tables/sbixGlyph.py__init__Glyph.__init__   s     ""4**&" '#t+#'#3#3CR#8 4##$q(+&&M  T%%&*  F+Ha#d6F6F2G.G$II  + (    c                 L    U R                   S:H  =(       d    U R                   S:H  $ )zHReturns True if this glyph is a reference to another glyph's image data.dupeflip)r   )r   s    r   is_reference_typeGlyph.is_reference_type9   s#    6)GT-=-=-GGr   c                 r   UR                  U R                  5      U l        U R                  c  SSKJn  UR                  S5      e[        U R                  5      S:  a  [        U R                  5      [        :  a  SSKJn  UR                  S5      e[        R                  " [        U R                  S [         U 5        U R                  5       (       aA  [        R                  " SU R                  [        S  5      u  nUR                  U5      U l        OU R                  [        S  U l        S U l        U ?U ?g )Nr   r   zNo table data to decompilezGlyph header too short.>H)getGlyphNamer   r   r   r   r   r   r   sbixGlyphHeaderFormatSizer   unpacksbixGlyphHeaderFormatr"   structr   r   )r   ttFontr   r   s       r   	decompileGlyph.decompile=   s    ,,TXX6<<'""#?@@t||q 4<< #<<+ &&'@AANN%t||4N5N'OQU %%''tT\\:S:T-UV*0*=*=c*B'!%.G.H!I*.'LHr   c                    U R                   c  SSKJn  UR                  S5      e[        R
                  " SUR                  U R                   5      5      U l        U R                  c  SnO[        R
                  " [        U 5      nU R                  5       (       a4  U[        R
                  " SUR                  U R                  5      5      -  nOU R                  c   eX0R                  -  nX0l        g )Nr   r   z&Can't compile Glyph without glyph namer%   r   )r   r   r   r   r*   pack
getGlyphIDr   r   r   r)   r"   r   r   r   )r   r+   r   r   s       r   compileGlyph.compileY   s    >>!'""#KLL ;;tV%6%6t~~%FG#Gll#8$?G%%''6;;tV->->t?V?V-WXX~~111>>)r   c                 f   U R                   c+  UR                  SU R                  S9  UR                  5         g UR	                  SU R                   U R                  U R
                  U R                  S9  UR                  5         U R                  5       (       a  UR                  SU R                  S9  OMUR	                  S5        UR                  5         UR                  U R                  5        UR                  S5        UR                  5         UR                  S5        UR                  5         g )Nglyph)name)r   r5   r   r   ref)	glyphnamehexdata)r   	simpletagr   newlinebegintagr   r   r"   r   dumphexr   endtag)r   	xmlWriterr+   s      r   toXMLGlyph.toXMLl   s   # dnn=((,,,, 	 	
 	!!##1H1HIy)dnn-Y'!r   c                     US:X  aF  [        SUS   -   S-   5      n[        R                  " SUR                  U5      5      U l        XPl        g US:X  a  [        U5      U l        g SSKJn  UR                  SU-  5      e)	Nr6   z'''r7   r%   r8   r   r   zcan't handle '%s' element)
r   r*   r/   r0   r   r   r   r   r   r   )r   r5   attrscontentr+   r7   r   s          r   fromXMLGlyph.fromXML   su    5= !{);!;e!CDI#[[v/@/@/KLDN&/#Y$W-DN'""#>#EFFr   )r   r   r   r   r   r   r   r   )NNr   r   NNNr   )__name__
__module____qualname____firstlineno__r   r"   r,   r1   r?   rD   __static_attributes__ r   r   r   r      s>      JDH8&8Gr   r   )fontTools.miscr   fontTools.misc.textToolsr   r   r*   r)   calcsizer'   objectr   rK   r   r   <module>rP      s:    " 6   $,,-BC GF Gr   