L ifddlmZddlmZmZddlZdZejeZGdde Z y))sstruct)readHexsafeEvalNa > 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 " cBeZdZ ddZdZdZdZdZdZy) GlyphNc ||_||_||_||_||_||_||_||_|j |j ddk(r|j dd|_t|j dkDrddl m } | jdt|j dkr/|xj dddt|j z z c_yyy)NrttLibz7Glyph.graphicType must not be longer than 4 characters.z ) gid glyphNamereferenceGlyphName originOffsetX originOffsetYrawdata graphicType imageDatalen fontToolsr TTLibError) selfrrrrrrrrr s f/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/fontTools/ttLib/tables/sbixGlyph.py__init__zGlyph.__init__s""4** &"    '#t+#'#3#3CR#8 4##$q(+&&MT%%&*  F+Ha#d6F6F2G.G$II + (cB|jdk(xs|jdk(S)zHReturns True if this glyph is a reference to another glyph's image data.dupeflip)r)rs ris_reference_typezGlyph.is_reference_type9s#6)GT-=-=-GGrc^|j|j|_|jddlm}|j dt|jdkDrt|jtkrddlm}|j dtjt|jdt||jr@tjd|jtd\}|j||_n|jtd|_d|_|`|`y)Nrr zNo table data to decompilezGlyph header too short.>H) getGlyphNamerrrrr rrsbixGlyphHeaderFormatSizerunpacksbixGlyphHeaderFormatr structrr)rttFontr rs r decompilezGlyph.decompile=s,,TXX6 <<  '""#?@ @ t|| q 4<< #<<+&&'@AA NN%t||4N5N'OQU %%'tT\\:S:T-UV*0*=*=c*B'!%.G.H!I*.' L Hrc|jddlm}|jdt j d|j |j|_|j d}||_ytj t|}|jr:|t j d|j |jz }||_y|jJ||jz }||_y)Nrr z&Can't compile Glyph without glyph namer"r)rrr rr'pack getGlyphIDrrrr&r rrr)rr(r rs rcompilez Glyph.compileYs >> ! '""#KL L;;tV%6%6t~~%FG    #G ll#8$?G%%'6;;tV->->t?V?V-WXX ~~1114>>) rcl|j.|jd|j|jy|j d|j|j|j |j |j|jr|jd|jnM|j d|j|j|j|jd|j|jd|jy)Nglyph)name)rr0rrref) glyphnamehexdata) r simpletagrnewlinebegintagrrr rdumphexrendtag)r xmlWriterr(s rtoXMLz Glyph.toXMLls    #   dnn  =      ((,,,,     ! ! #   1H1H  I   y )       dnn -   Y '!rc|dk(rFtd|dzdz}tjd|j||_||_y|dk(rt ||_yddlm}|jd|z) Nr1z'''r2r"r3rr zcan't handle '%s' element) rr'r+r,rrrrr r)rr0attrscontentr(r2r s rfromXMLz Glyph.fromXMLsw 5=!{);!;e!CDI#[[v/@/@/KLDN&/D # Y $W-DN '""#>#EF Fr)NNrrNNNr) __name__ __module__ __qualname__rr r)r-r:r>rrrrs>  JDH8&8 Grr) fontTools.miscrfontTools.misc.textToolsrrr'r&calcsizer$objectrrBrrrGs<"6  -G,,-BCGFGr