Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 2øªj7ƒã5@s2dZddlmZmZmZmZddlmZmZm Z m Z ddl m Z ddl Z ddlZejeƒZdd„Zdd „Zd d „Zd d „Zdd„Zdd„Zdd„Zdd„Zdd„ZdgdZdegedd…<d­egedd…<d®egedd…<d¯egedd…<eed<eeƒdk�st‚edd…Zeed<eed<edd…Zeed<eed<eed<d d!d"d#d$d%d&d'd(d)d*d+d,dd-gZ d.d/„e!e ƒDƒZ"d0Z#d1d2„Z$d°d±d²d³d´dµd¶d·d¸d¹dºd»d¼d½d¾d¿dÀdÁdÂdÃdÄdÅdÆdÇdÈdÊdÌdÎdÐdÒdÔdÖdØdÚdÜdÞdàdâdädædèdêdìdîdðdòdôdödødúdüdþg4Z%d…d†„Z&e&d‡ƒZ'e&dˆƒZ(e&d‰ƒZ)e j*fdŠd‹„Z+edƒedGƒZ,dŒd�„Z-GdŽd�„d�e.ƒZ/Gd�d‘„d‘e0ƒZ1dÿ�d�d�d�d�d�d�d�d�d�d �d �d �d �d �d�d�d�d�d�d�d�d�d�d gZ2GdŸd „d e1ƒZ3Gd¡d¢„d¢e3ƒZ4Gd£d¤„d¤e4ƒZ5Gd¥d¦„d¦e0ƒZ6Gd§d¨„d¨e6ƒZ7Gd©dª„dªe0ƒZ8d«d¬„Z9dS(!zwpsCharStrings.py -- module implementing various kinds of CharStrings: CFF dictionary data and Type1/Type2 CharStrings. é)Ú fixedToFloatÚ floatToFixedÚfloatToFixedToStrÚstrToFixedToFloat)ÚbytechrÚbyteordÚ bytesjoinÚstrjoin)Ú BoundsPenNc Cs`|dkr"|t||ƒf}|d}n|}y|j|}Wntk rLd|fSX|j|ƒ}||fS)Né é)rÚ operatorsÚKeyErrorÚhandle_operator)ÚselfÚb0ÚdataÚindexÚopÚoperatorÚvalue©rúA/tmp/pip-build-_d5lkt3n/fonttools/fontTools/misc/psCharStrings.pyÚ read_operators   rcCs |d|fS)Né‹r)rrrrrrrÚ read_bytesrcCs(t||ƒ}|dd|d|dfS)Né÷éélr )r)rrrrÚb1rrrÚread_smallInt1!s r cCs*t||ƒ}|d d|d|dfS)Néûrrr )r)rrrrrrrrÚread_smallInt2%s r"cCs&tjd|||d…ƒ\}||dfS)Nz>hé)ÚstructÚunpack)rrrrrrrrÚ read_shortInt)sr&cCs&tjd|||d…ƒ\}||dfS)Nz>lé)r$r%)rrrrrrrrÚ read_longInt-sr(cCs.tjd|||d…ƒ\}t|dd�|dfS)Nz>lr'é)Ú precisionBits)r$r%r)rrrrrrrrÚread_fixed16161sr+cCstst‚t|fS)N)ÚNotImplementedErrorÚAssertionErrorÚNotImplemented)rrrrrrrÚ read_reserved5sr/cCsjd}xXt||ƒ}|d}|d@d?}|d@}|dkr8P|t|}|dkrNP|t|}qWt|ƒ|fS)NÚr éðr'é)rÚ realNibblesÚfloat)rrrrÚnumberÚbZnibble0Znibble1rrrÚread_realNumber9s   r7ré rr!éÿéééÚ0Ú1Ú2Ú3Ú4Ú5Ú6Ú7Ú8Ú9Ú.ÚEzE-ú-cCsi|]\}}||“qSrr)Ú.0ÚiÚvrrrú ]srMéÁcCs‚i}i}xp|D]h}t|ƒdkr0|d||d<n|dd…||d<t|dtƒrd|d||d<q|df||d<qW||fS)Nr#r r)ÚlenÚ isinstanceÚtuple)Z operatorListÚoperZopcÚitemrrrÚbuildOperatorDictbs  rTr ÚhsteméÚvstemr'ÚvmovetoéÚrlinetoéÚhlinetoéÚvlinetoéÚ rrcurvetoé Úcallsubré ÚreturnéÚendcharr2Úvsindexr)ÚblendéÚhstemhméÚhintmaskéÚcntrmaskéÚrmovetoéÚhmovetoéÚvstemhméÚ rcurvelineéÚ rlinecurveéÚ vvcurvetoéÚ hhcurvetoÚ callgsubrÚ vhcurvetoéÚ hvcurvetor ÚignoreÚandÚorÚnotÚstoreé ÚabsÚaddÚsubÚdivé ÚloadÚnegÚeqÚdropÚputÚgetÚifelseÚrandomÚmulÚsqrtÚdupÚexchrÚrollé"Úhflexé#Úflexé$Úhflex1é%Úflex1cCsN|dkrtdƒ}n"|dkr$tdƒ}n|dks0t‚d}|ttjtjfdd„}|S)NÚcffr;Út1r9Út2cSsd|kodknr&||dƒ}nÞd|ko8dknrd|d}||d?dƒ||d@ƒ}n d|kovdknr¤| d}||d?dƒ||d@ƒ}n`|dkröd|ko¾d knrØ|d ƒ|d |ƒ}ntjd ƒ|dƒ|d|ƒ}n||d|ƒ}|S)Nékrrikr_rr9r!i€iÿr:z>hzk4-byte T2 number got passed to the IntType handler. This should happen only when reading in old XML files. z>li•ÿÿÿi•ûÿÿi”ÿÿÿi€ÿÿ)ÚlogÚwarning)rÚ fourByteOprÚpackr%ÚcoderrrÚ encodeInt´s  z getIntEncoder..encodeInt)rr-r$r¨r%)Úformatr§rªrrrÚ getIntEncoder«s   r¬r¡r¢r£cCs6t|dd�}|d@dkr$t|d?ƒSd|d|ƒSdS)z For T2 onlyr))r*iÿÿróÿz>lN)rÚ encodeIntT2)Úfr¨rrrrÚ encodeFixedÚs   r°cCs*|dkr tSd|}|dd…dkr2|dd…}n |dd…dkrRd|dd…}g}xl|rÂ|d }|dd…}|d kr²|dd…}|dkrž|dd…}d }n|d kr²|dd…}|jt|ƒqXW|jd ƒt|ƒdrä|jd ƒtdƒ}x8td t|ƒdƒD]$}|t||d>||dBƒ}qþW|S)Ngz%.8Gr#z0.r rVz-0.rIrrHzE-ú+r2r<r')Ú realZeroBytesÚappendÚrealNibblesDictrOrÚrange)r¯ÚsZnibblesÚcÚc2ÚdrKrrrÚ encodeFloatås4       $rºc@s eZdZdS)ÚCharStringCompileErrorN)Ú__name__Ú __module__Ú __qualname__rrrrr»sr»c@sZeZdZdTdd„Zdd„Zdd„Zdd „Zd d „Zd d „Zdd„Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zd d!„ZeZd"d#„Zd$d%„Zd&d'„Zd(d)„Zd*d+„Zd,d-„Zd.d/„Zd0d1„Zd2d3„Zd4d5„Zd6d7„Zd8d9„Zd:d;„Z dd?„Z"d@dA„Z#dBdC„Z$dDdE„Z%dFdG„Z&dHdI„Z'dJdK„Z(dLdM„Z)dNdO„Z*dPdQ„Z+dRdS„Z,dS)UÚSimpleT2DecompilerNcCs2||_t|ƒ|_||_t|ƒ|_||_|jƒdS)N)Ú localSubrsÚ calcSubrBiasÚ localBiasÚ globalSubrsÚ globalBiasÚprivateÚreset)rrÀrÃrÅrrrÚ__init__ s   zSimpleT2Decompiler.__init__cCs"g|_g|_d|_d|_d|_dS)Nr)Ú callingStackÚ operandStackÚ hintCountÚ hintMaskBytesÚ numRegions)rrrrrÆs zSimpleT2Decompiler.resetc CsÊ|jj|ƒ|jƒ}|r$g}|j}ndd„}|jj}d}xv|j|ƒ\}}}|dkrTP||ƒ|r¤d|} t|| dƒ} | dk rš| |ƒ} | r¢| \} }|| ƒq¬|jƒq:||ƒq:W|r¾|j|ƒ|jd=dS)NcSsdS)Nr)ÚxrrrÚ sz,SimpleT2Decompiler.execute..rZop_r éÿÿÿÿ)rÈr³ÚneedsDecompilationrÉÚgetTokenÚgetattrÚpopallÚ setProgram) rZ charStringrÐÚprogramZ pushToProgramZ pushToStackrÚtokenÚ isOperatorZ handlerNameÚhandlerÚrvrËrrrÚexecutes4      zSimpleT2Decompiler.executecCs|jd}|jd=|S)Nr rÏrÏ)rÉ)rrrrrÚpop8s zSimpleT2Decompiler.popcCs |jdd…}g|jdd…<|S)N)rÉ)rÚstackrrrrÓ=szSimpleT2Decompiler.popallcCs|jj|ƒdS)N)rÉr³)rrrrrÚpushBszSimpleT2Decompiler.pushcCs |jrdS)N)rÉ)rrrrrÚ op_returnEszSimpleT2Decompiler.op_returncCsdS)Nr)rrrrrÚ op_endcharIszSimpleT2Decompiler.op_endcharcCsdS)Nr)rrrrrÚ op_ignoreLszSimpleT2Decompiler.op_ignorecCs&|jƒ}|j||j}|j|ƒdS)N)rÛrÀrÂrÚ)rrÚ subrIndexÚsubrrrrÚ op_callsubrOszSimpleT2Decompiler.op_callsubrcCs&|jƒ}|j||j}|j|ƒdS)N)rÛrÃrÄrÚ)rrrárârrrÚ op_callgsubrTszSimpleT2Decompiler.op_callgsubrcCs |jƒdS)N)Ú countHints)rrrrrÚop_hstemYszSimpleT2Decompiler.op_hstemcCs |jƒdS)N)rå)rrrrrÚop_vstem[szSimpleT2Decompiler.op_vstemcCs |jƒdS)N)rå)rrrrrÚ op_hstemhm]szSimpleT2Decompiler.op_hstemhmcCs |jƒdS)N)rå)rrrrrÚ op_vstemhm_szSimpleT2Decompiler.op_vstemhmcCs>|js|jƒ|jdd|_|jdj||jƒ\}}||fS)Nr]r_r rÏ)rËrårÊrÈÚgetBytes)rrrËrrrÚ op_hintmaskbs zSimpleT2Decompiler.op_hintmaskcCs |jƒ}|jt|ƒd|_dS)Nr#)rÓrÊrO)rÚargsrrrråkszSimpleT2Decompiler.countHintscCst‚dS)N)r,)rrrrrÚop_andpszSimpleT2Decompiler.op_andcCst‚dS)N)r,)rrrrrÚop_orrszSimpleT2Decompiler.op_orcCst‚dS)N)r,)rrrrrÚop_nottszSimpleT2Decompiler.op_notcCst‚dS)N)r,)rrrrrÚop_storevszSimpleT2Decompiler.op_storecCst‚dS)N)r,)rrrrrÚop_absxszSimpleT2Decompiler.op_abscCst‚dS)N)r,)rrrrrÚop_addzszSimpleT2Decompiler.op_addcCst‚dS)N)r,)rrrrrÚop_sub|szSimpleT2Decompiler.op_subcCst‚dS)N)r,)rrrrrÚop_div~szSimpleT2Decompiler.op_divcCst‚dS)N)r,)rrrrrÚop_load€szSimpleT2Decompiler.op_loadcCst‚dS)N)r,)rrrrrÚop_neg‚szSimpleT2Decompiler.op_negcCst‚dS)N)r,)rrrrrÚop_eq„szSimpleT2Decompiler.op_eqcCst‚dS)N)r,)rrrrrÚop_drop†szSimpleT2Decompiler.op_dropcCst‚dS)N)r,)rrrrrÚop_putˆszSimpleT2Decompiler.op_putcCst‚dS)N)r,)rrrrrÚop_getŠszSimpleT2Decompiler.op_getcCst‚dS)N)r,)rrrrrÚ op_ifelseŒszSimpleT2Decompiler.op_ifelsecCst‚dS)N)r,)rrrrrÚ op_randomŽszSimpleT2Decompiler.op_randomcCst‚dS)N)r,)rrrrrÚop_mul�szSimpleT2Decompiler.op_mulcCst‚dS)N)r,)rrrrrÚop_sqrt’szSimpleT2Decompiler.op_sqrtcCst‚dS)N)r,)rrrrrÚop_dup”szSimpleT2Decompiler.op_dupcCst‚dS)N)r,)rrrrrÚop_exch–szSimpleT2Decompiler.op_exchcCst‚dS)N)r,)rrrrrÚop_index˜szSimpleT2Decompiler.op_indexcCst‚dS)N)r,)rrrrrÚop_rollšszSimpleT2Decompiler.op_rollcCsB|jdkr|jjƒ|_|jƒ}||jd}|j|| d…=dS)Nrr )rÌrÅÚ getNumRegionsrÛrÉ)rrÚ numBlendsZnumOpsrrrÚop_blendŸs   zSimpleT2Decompiler.op_blendcCs|jƒ}|jj|ƒ|_dS)N)rÛrÅrrÌ)rrÚvirrrÚ op_vsindex¦szSimpleT2Decompiler.op_vsindex)N)-r¼r½r¾rÇrÆrÚrÛrÓrÝrÞrßràrãrärærçrèrérëZ op_cntrmaskrårírîrïrðrñròrórôrõrör÷rørùrúrûrürýrþrÿrrrrrrrrrr¿sT r¿Ú closepathÚhsbwÚ dotsectionÚvstem3r#Úhstem3ÚseacÚsbwÚ callothersubrérÛé!Úsetcurrentpointc@sPeZdZddd„Zdd„Zddd„Zd d „Zd d „Zd d„Zdd„Z dd„Z dS)ÚT2WidthExtractorNcCs tj||||ƒ||_||_dS)N)r¿rÇÚ nominalWidthXÚ defaultWidthX)rrÀrÃrrrÅrrrrÇËszT2WidthExtractor.__init__cCstj|ƒd|_d|_dS)Nr)r¿rÆÚgotWidthÚwidth)rrrrrÆÐs zT2WidthExtractor.resetrcCs`|jƒ}|js\|t|ƒdArN|jdk s0tdƒ‚|j|d|_|dd…}n|j|_d|_|S)Nr#z5CFF2 CharStrings must not have an initial width valuerr )rÓrrOrr-rr)rÚevenOddrìrrrÚ popallWidthÕszT2WidthExtractor.popallWidthcCs |jƒ}|jt|ƒd|_dS)Nr#)rrÊrO)rrìrrrråâszT2WidthExtractor.countHintscCs |jƒdS)N)r)rrrrrÚ op_rmovetoæszT2WidthExtractor.op_rmovetocCs|jdƒdS)Nr )r)rrrrrÚ op_hmovetoészT2WidthExtractor.op_hmovetocCs|jdƒdS)Nr )r)rrrrrÚ op_vmovetoìszT2WidthExtractor.op_vmovetocCs |jƒdS)N)r)rrrrrrßïszT2WidthExtractor.op_endchar)N)r) r¼r½r¾rÇrÆrrårrrrßrrrrrÉs  rc@s¦eZdZdhdd„Zdd„Zdd„Zdd „Zd d „Zd d „Zdd„Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zd d!„Zd"d#„Zd$d%„Zd&d'„Zd(d)„Zd*d+„Zd,d-„Zd.d/„Zd0d1„Zd2d3„Zd4d5„Zd6d7„Zd8d9„Zd:d;„Zdd?„Z!d@dA„Z"dBdC„Z#dDdE„Z$dFdG„Z%dHdI„Z&dJdK„Z'dLdM„Z(dNdO„Z)dPdQ„Z*dRdS„Z+dTdU„Z,dVdW„Z-dXdY„Z.dZd[„Z/d\d]„Z0d^d_„Z1d`da„Z2dbdc„Z3ddde„Z4dfdg„Z5dS)iÚT2OutlineExtractorNcCstj||||||ƒ||_dS)N)rrÇÚpen)rrrÀrÃrrrÅrrrrÇõszT2OutlineExtractor.__init__cCstj|ƒd|_d|_dS)Nr)rr)rrÆÚ currentPointÚ sawMoveTo)rrrrrÆús zT2OutlineExtractor.resetcCs,|j\}}||d||df}||_|S)Nrr )r)rÚpointrÍÚyrrrÚ _nextPointÿs zT2OutlineExtractor._nextPointcCs|jj|j|ƒƒd|_dS)Nr )rZmoveTor#r )rr!rrrÚrMoveToszT2OutlineExtractor.rMoveTocCs&|js|jdƒ|jj|j|ƒƒdS)Nr)rr)r r$rZlineTor#)rr!rrrÚrLineTo s zT2OutlineExtractor.rLineTocCs6|js|jdƒ|j}|jj||ƒ||ƒ||ƒƒdS)Nr)rr)r r$r#rZcurveTo)rZpt1Zpt2Zpt3Z nextPointrrrÚrCurveTos zT2OutlineExtractor.rCurveTocCs|jr|jjƒd|_dS)Nr)r rÚ closePath)rrrrr's zT2OutlineExtractor.closePathcCs |jƒdS)N)r')rrrrÚendPathszT2OutlineExtractor.endPathcCs|jƒ|j|jƒƒdS)N)r(r$r)rrrrrr1szT2OutlineExtractor.op_rmovetocCs$|jƒ|j|jdƒddfƒdS)Nr r)r(r$r)rrrrrr4szT2OutlineExtractor.op_hmovetocCs$|jƒ|jd|jdƒdfƒdS)Nrr )r(r$r)rrrrrr7szT2OutlineExtractor.op_vmovetoc Csh|jƒ|jƒ}|rdddlm}|\}}}}||}|jj|dƒ||} |jj| dddd||fƒdS)Nr)ÚStandardEncodingr )r rrr rr)r(rÚ$fontTools.encodings.StandardEncodingr)rÚ addComponent) rrrìr)ÚadxÚadyÚbcharÚacharÚ baseGlyphÚ accentGlyphrrrrß:s  zT2OutlineExtractor.op_endcharcCs@|jƒ}x2tdt|ƒdƒD]}|||d…}|j|ƒqWdS)Nrr#)rÓrµrOr%)rrrìrKr!rrrÚ op_rlinetoJszT2OutlineExtractor.op_rlinetocCs|jdƒdS)Nr )ÚalternatingLineto)rrrrrÚ op_hlinetoPszT2OutlineExtractor.op_hlinetocCs|jdƒdS)Nr)r3)rrrrrÚ op_vlinetoRszT2OutlineExtractor.op_vlinetoc Cs\|jƒ}xNtdt|ƒdƒD]:}|||d…\}}}}}} |j||f||f|| fƒqWdS)z${dxa dya dxb dyb dxc dyc}+ rrcurvetorr[N)rÓrµrOr&) rrrìrKÚdxaÚdyaÚdxbÚdybÚdxcÚdycrrrÚ op_rrcurvetoXszT2OutlineExtractor.op_rrcurvetoc Csr|jƒ}xRtdt|ƒddƒD]:}|||d…\}}}}}} |j||f||f|| fƒqW|j|dd…ƒdS)z-{dxa dya dxb dyb dxc dyc}+ dxd dyd rcurvelinerr#r[Néþÿÿÿ)rÓrµrOr&r%) rrrìrKr8r9r:r;ÚdxdÚdydrrrÚ op_rcurveline_s z T2OutlineExtractor.op_rcurvelinec Csz|jƒ}|dd…}x.tdt|ƒdƒD]}|j|||d…ƒq&W|dd…\}}}}} } |j||f||f| | fƒdS)z-{dxa dya}+ dxb dyb dxc dyc dxd dyd rlinecurveNr[rr#iúÿÿÿiúÿÿÿ)rÓrµrOr%r&) rrrìZlineArgsrKr8r9r:r;r>r?rrrÚ op_rlinecurvegs  z T2OutlineExtractor.op_rlinecurvec Cs‚|jƒ}t|ƒdr*|d}|dd…}nd}xNtdt|ƒdƒD]:}|||d…\}}}}|j||f||fd|fƒd}q@WdS)z!dx1? {dya dxb dyb dyc}+ vvcurvetor#rr Nr')rÓrOrµr&) rrrìÚdx1rKr7r8r9r;rrrÚ op_vvcurvetops zT2OutlineExtractor.op_vvcurvetoc Cs‚|jƒ}t|ƒdr*|d}|dd…}nd}xNtdt|ƒdƒD]:}|||d…\}}}}|j||f||f|dfƒd}q@WdS)z!dy1? {dxa dxb dyb dxc}+ hhcurvetor#rr Nr')rÓrOrµr&) rrrìÚdy1rKr6r8r9r:rrrÚ op_hhcurveto}s zT2OutlineExtractor.op_hhcurvetocCs.|jƒ}x |r(|j|ƒ}|r |j|ƒ}q WdS)z}dy1 dx2 dy2 dx3 {dxa dxb dyb dyc dyd dxe dye dxf}* dyf? vhcurveto (30) {dya dxb dyb dxc dxd dxe dye dyf}+ dxf? vhcurveto N)rÓÚvcurvetoÚhcurveto)rrrìrrrÚ op_vhcurvetoŠs  zT2OutlineExtractor.op_vhcurvetocCs.|jƒ}x |r(|j|ƒ}|r |j|ƒ}q WdS)zddx1 dx2 dy2 dy3 {dya dxb dyb dxc dxd dxe dye dyf}* dxf? {dxa dxb dyb dyc dyd dxe dye dxf}+ dyf? N)rÓrGrF)rrrìrrrÚ op_hvcurveto”s  zT2OutlineExtractor.op_hvcurvetocCsd|jƒ\}}}}}}}d} } } } | } |j|| f||f|| fƒ|j|| f|| f|| fƒdS)Nr)rÓr&)rrrBÚdx2Údy2Údx3Údx4Údx5Údx6rDÚdy3Údy4Údy6Údy5rrrÚop_hflex¡s zT2OutlineExtractor.op_hflexc CsZ|jƒ\ }}}}}}}} } } } } }|j||f||f||fƒ|j|| f| | f| | fƒdS)N)rÓr&)rrrBrDrJrKrLrPrMrQrNrSrOrRÚfdrrrÚop_flex§s"zT2OutlineExtractor.op_flexc Csp|jƒ\ }}}}}}}} } d} } ||| | |  } |j||f||f|| fƒ|j|| f|| f| | fƒdS)Nr)rÓr&)rrrBrDrJrKrLrMrNrSrOrPrQrRrrrÚ op_hflex1«s zT2OutlineExtractor.op_hflex1c Cs¤|jƒ\ }}}}}}}} } } } ||||| } |||| | }t| ƒt|ƒkrb| }| }n | }| }|j||f||f||fƒ|j|| f| | f||fƒdS)N)rÓr‡r&)rrrBrDrJrKrLrPrMrQrNrSZd6ZdxZdyrOrRrrrÚop_flex1²szT2OutlineExtractor.op_flex1cCst‚dS)N)r,)rrrrrríÀszT2OutlineExtractor.op_andcCst‚dS)N)r,)rrrrrrîÂszT2OutlineExtractor.op_orcCst‚dS)N)r,)rrrrrrïÄszT2OutlineExtractor.op_notcCst‚dS)N)r,)rrrrrrðÆszT2OutlineExtractor.op_storecCst‚dS)N)r,)rrrrrrñÈszT2OutlineExtractor.op_abscCst‚dS)N)r,)rrrrrròÊszT2OutlineExtractor.op_addcCst‚dS)N)r,)rrrrrróÌszT2OutlineExtractor.op_subcCsB|jƒ}|jƒ}||}||}||kr4|j|ƒn |j|ƒdS)N)rÛrÝ)rrZnum2Znum1Zd1Zd2rrrrôÎs zT2OutlineExtractor.op_divcCst‚dS)N)r,)rrrrrrõ×szT2OutlineExtractor.op_loadcCst‚dS)N)r,)rrrrrröÙszT2OutlineExtractor.op_negcCst‚dS)N)r,)rrrrrr÷ÛszT2OutlineExtractor.op_eqcCst‚dS)N)r,)rrrrrrøÝszT2OutlineExtractor.op_dropcCst‚dS)N)r,)rrrrrrùßszT2OutlineExtractor.op_putcCst‚dS)N)r,)rrrrrrúászT2OutlineExtractor.op_getcCst‚dS)N)r,)rrrrrrûãszT2OutlineExtractor.op_ifelsecCst‚dS)N)r,)rrrrrrüåszT2OutlineExtractor.op_randomcCst‚dS)N)r,)rrrrrrýçszT2OutlineExtractor.op_mulcCst‚dS)N)r,)rrrrrrþészT2OutlineExtractor.op_sqrtcCst‚dS)N)r,)rrrrrrÿëszT2OutlineExtractor.op_dupcCst‚dS)N)r,)rrrrrríszT2OutlineExtractor.op_exchcCst‚dS)N)r,)rrrrrrïszT2OutlineExtractor.op_indexcCst‚dS)N)r,)rrrrrrñszT2OutlineExtractor.op_rollcCs@|jƒ}x2|D]*}|r |df}nd|f}|j|ƒ| }qWdS)Nr)rÓr%)rZ isHorizontalrìÚargr!rrrr3÷s   z$T2OutlineExtractor.alternatingLinetocCs\|dd…\}}}}|dd…}t|ƒdkr:|d}g}nd}|jd|f||f||fƒ|S)Nr'r r)rOr&)rrìr7r8r9r:r;rrrrFs  zT2OutlineExtractor.vcurvetocCs\|dd…\}}}}|dd…}t|ƒdkr:|d}g}nd}|j|df||f||fƒ|S)Nr'r r)rOr&)rrìr6r8r9r;r:rrrrG s  zT2OutlineExtractor.hcurveto)N)6r¼r½r¾rÇrÆr#r$r%r&r'r(rrrrßr2r4r5r<r@rArCrErHrIrTrVrWrXrírîrïrðrñròrórôrõrör÷rørùrúrûrürýrþrÿrrrr3rFrGrrrrrósf         rc@s¶eZdZdd„Zdd„Zdd„Zd-dd „Zd d „Zd d „Zdd„Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zd d!„Zd"d#„Zd$d%„Zd&d'„Zd(d)„Zd*d+„Zd,S).ÚT1OutlineExtractorcCs||_||_|jƒdS)N)rÚsubrsrÆ)rrr[rrrrÇszT1OutlineExtractor.__init__cCs d|_d|_d|_tj|ƒdS)Nr)ÚflexingrÚsbxrrÆ)rrrrrÆszT1OutlineExtractor.resetcCs|jr|jjƒd|_dS)Nr)r rr()rrrrr($s zT1OutlineExtractor.endPathrcCs|jƒS)N)rÓ)rrrrrr)szT1OutlineExtractor.popallWidthcCs$|j}|d|d|d<|d<dS)Nr#r r=rÏrÏr=)rÉ)rrÜrrrr—,szT1OutlineExtractor.exchcCs$|jr dS|jƒ|j|jƒƒdS)N)r\r(r$rÓ)rrrrrr3szT1OutlineExtractor.op_rmovetocCs6|jr|jdƒdS|jƒ|j|jƒddfƒdS)Nr)r\rÝr(r$rÓ)rrrrrr8s  zT1OutlineExtractor.op_hmovetocCs>|jr|jdƒ|jƒdS|jƒ|jd|jƒdfƒdS)Nr)r\rÝr—r(r$rÓ)rrrrrr?s  zT1OutlineExtractor.op_vmovetocCs |jƒdS)N)r')rrrrrÚ op_closepathGszT1OutlineExtractor.op_closepathcCs|jƒ}|\}}||f|_dS)N)rÓr)rrrìrÍr"rrrÚop_setcurrentpointIsz%T1OutlineExtractor.op_setcurrentpointcCs |jƒdS)N)r()rrrrrrßNszT1OutlineExtractor.op_endcharcCs,|jƒ\}}||_||_||jdf|_dS)Nr )rÓrr]r)rrr]ZwxrrrÚop_hsbwQs zT1OutlineExtractor.op_hsbwcCs |jƒdS)N)rÓ)rrrrrÚop_sbwVszT1OutlineExtractor.op_sbwcCs |jƒ}|j|}|j|ƒdS)N)rÛr[rÚ)rrrárârrrrãZs zT1OutlineExtractor.op_callsubrcCsJ|jƒ}|jƒ}|dkr0|dkr0|jƒd|_n|dkrF|dkrFd|_dS)NrrVr )rÛÚdoFlexr\)rrráZnArgsrrrÚop_callothersubr^sz#T1OutlineExtractor.op_callothersubrcCsdS)Nr)rrrrrÚop_pophszT1OutlineExtractor.op_popcCs4|jƒ}|jƒ}|jƒ|jƒ}|jƒ}|jƒ}|jƒ}|jƒ}|jƒ}|jƒ} |jƒ} |jƒ} |jƒ} |jƒ} |jƒ}|jƒ}|jƒ}|j||ƒ|j| |ƒ|j| ƒ|j| ƒ|j| ƒ|j| ƒ|jdƒ|j|ƒ|j|ƒ|j|ƒ|j|ƒ|j|ƒ|j|ƒ|jdƒ|j|ƒ|j|ƒdS)N)rÛrÝr<)rZfinalyZfinalxZp3yZp3xZbcp4yZbcp4xZbcp3yZbcp3xZp2yZp2xZbcp2yZbcp2xZbcp1yZbcp1xZrpyZrpxrrrrbksB             zT1OutlineExtractor.doFlexcCs |jƒdS)N)rÓ)rrrrrÚ op_dotsection•sz T1OutlineExtractor.op_dotsectioncCs |jƒdS)N)rÓ)rrrrrÚ op_hstem3—szT1OutlineExtractor.op_hstem3c Cshddlm}|jƒ\}}}}}||}|jj|dƒ||} ||j|}|jj| dddd||fƒdS)zasb adx ady bchar achar seacr)r)r N)r rrr rr)r*r)rÓrr+r]) rrr)Zasbr,r-r.r/r0r1rrrÚop_seac™s zT1OutlineExtractor.op_seaccCs |jƒdS)N)rÓ)rrrrrÚ op_vstem3¢szT1OutlineExtractor.op_vstem3N)r)r¼r½r¾rÇrÆr(rr—rrrr^r_rßr`rarãrcrdrbrerfrgrhrrrrrZs*  * rZc@s¼eZdZeZeeƒ\ZZe Z e Z d%dd„Z d&dd„Zdd„Zdd „Zd d „Zd d „Zdd„Zdd„Zd'dd„Zdd„Zdd„Zdd„Zeeefdd„Zdd„Zdd „Zd(d!d"„Zd#d$„Z dS))Ú T2CharStringNcCs:|dkr g}||_||_||_|dk r*|ng|_d|_dS)N)ÚbytecoderÕrÅrÃÚ _cur_vsindex)rrjrÕrÅrÃrrrrǬszT2CharString.__init__cCsN|j}|dk st‚|dk r"||_n |jdkrBt|dƒr<|jnd|_|j|jƒS)Nrgr)rÅr-rkÚhasattrrgr)rrgÚpdrrrrµs  zT2CharString.getNumRegionscCs6|jdkrd|jjt|ƒfSd|jjt|ƒfSdS)Nz<%s (source) at %x>z<%s (bytecode) at %x>)rjÚ __class__r¼Úid)rrrrÚ__repr__¾s zT2CharString.__repr__cCstS)N)r®)rrrrr¬ÄszT2CharString.getIntEncodercCstS)N)r°)rrrrÚgetFixedEncoderÇszT2CharString.getFixedEncodercCs:|jƒs dSt|jdgƒ}|j||j|jƒ}|j|ƒdS)NÚSubrs)rÐrÒrÅÚdecompilerClassrÃrÚ)rr[Z decompilerrrrÚ decompileÊs zT2CharString.decompilecCsDt|jdgƒ}|j|||j|jj|jj|jƒ}|j|ƒ|j|_dS)Nrr)rÒrÅÚoutlineExtractorrÃrrrÚr)rrr[Ú extractorrrrÚdrawÑs    zT2CharString.drawcCst|ƒ}|j|ƒ|jS)N)r rwZbounds)rZglyphSetZ boundsPenrrrÚ calcBoundsÙs zT2CharString.calcBoundsFc CsŽ|jdk rdS|j}|j}|r<|rX|d d krX|dd…}n|rXt|dtƒ rXtdƒ‚g}|jƒ}|jƒ}d}t|ƒ}xÖ||k�rN||} |d}t| tƒ�ry|j dd„|| DƒƒWn t k rÜtd| ƒ‚YnX| dk�rL|j ||ƒ|d}qzt| t ƒ�r|j || ƒƒqzt| t ƒ�r8|j || ƒƒqzdsztd t| ƒƒ‚qzWy t|ƒ}Wn"tk �r~tj|ƒ‚YnX|j|ƒdS)Nr rdrfz@T2CharString or Subr has items on the stack after last operator.rcss|]}t|ƒVqdS)N)r)rJr6rrrú ÷sz'T2CharString.compile..zillegal operator: %srlrnzunsupported type: %srÏ)rdrfrÏrÏ)rlrn)rjÚopcodesrÕrPÚstrr»r¬rqrOÚextendrr³Úintr4r-ÚtyperÚ TypeErrorr¥ÚerrorÚ setBytecode) rZisCFF2rzrÕrjrªr°rKÚendrÖrrrÚcompileÞsJ         zT2CharString.compilecCs |jdk S)N)rj)rrrrrÐ szT2CharString.needsDecompilationcCs||_d|_dS)N)rÕrj)rrÕrrrrÔ szT2CharString.setProgramcCs||_d|_dS)N)rjrÕ)rrjrrrr�szT2CharString.setBytecodec CsŠ|jdk rR|||jƒkrdS||j|ƒ}|d}|j|}||||j|ƒ\}}n$|||jƒkrddS|j|}|d}||tƒ}|||fS)Nrr )Nrr)Nrr)rjÚoperandEncodingrÕr{) rrrOrrPrrØrÖr×rrrrÑs    zT2CharString.getTokencCsP|jdk r&||}|j||…}|}n|j|}|d}t|ƒ|ksHt‚||fS)Nr )rjrÕrOr-)rrZnBytesZnewIndexÚbytesrrrrê&s  zT2CharString.getBytescCs|S)Nr)rrrrrr1szT2CharString.handle_operatorc Csddlm}|jdk r$|j|jƒnòd}g}xÎ|j|ƒ\}}}|dkrHP|rÎ|d kr¦|j|ƒ\}}}g} x |D]} | j|t| ƒdƒƒqnWt| ƒ}dj|||gƒ} ndj||gƒ} |j | ƒ|j ƒg}q.t |t ƒræt |dd�}nt|ƒ}|j|ƒq.W|�rdj|ƒ} |j | ƒdS) Nr)Ú num2binaryrlrnr_ú r))r*)rlrn)ÚfontTools.misc.textToolsr†rjZdumphexrÑr³rr ÚjoinÚwriteÚnewlinerPr4rr{) rZ xmlWriterZttFontr†rrìrÖr×ZhintMaskÚbitsZbyteÚlinerrrÚtoXML4s8      zT2CharString.toXMLc CsBddlm}m}|jdƒr,|j||ƒƒdSt|ƒ}|jƒ}g}t|ƒ}d}xæ||k�r2||} |d}y t| ƒ} Wn°t k �r$yt | dd�} Wn~t k �r|j | ƒ| d k�r||} d } x4t dt| ƒd ƒD] } | t || | | d …ƒƒ} qÚW|j | ƒ|d}Yn X|j | ƒYqNX|j | ƒqNW|j|ƒdS) Nr)Ú binary2numÚreadHexÚrawr r))r*rlrnór_)rlrn)rˆr�r�r‘r�r ÚsplitrOr}Ú ValueErrorrr³rµrrÔ) rÚnameÚattrsÚcontentr�r�rÕr‚rKrÖÚmaskZ maskBytesÚjrrrÚfromXMLYs:       zT2CharString.fromXML)NNNN)N)F)N)!r¼r½r¾Út2OperandEncodingr„rTÚ t2Operatorsr rzr¿rsrrurÇrrpr¬rqrtrwrxrƒrÐrÔr�rOrrPrÑrêrrŽršrrrrri¥s*   ,  %ricsNeZdZeZeeƒ\ZZd ‡fdd„ Z dd„Z dd„Z dd „Z d d „Z ‡ZS) Ú T1CharStringNcstƒj||ƒ||_dS)N)ÚsuperrÇr[)rrjrÕr[)rnrrrÇszT1CharString.__init__cCstS)N)Ú encodeIntT1)rrrrr¬ƒszT1CharString.getIntEncodercCs dd„}dS)NcSs tdƒ‚dS)Nz8Type 1 charstrings don't support floating point operands)r)rrrrr°‡sz1T1CharString.getFixedEncoder..encodeFixedr)rr°rrrrq†szT1CharString.getFixedEncodercCsN|jdkrdSg}d}x(|j|ƒ\}}}|dkr2P|j|ƒqW|j|ƒdS)Nr)rjrÑr³rÔ)rrÕrrÖr×rrrrtŠs zT1CharString.decompilecCs"t||jƒ}|j|ƒ|j|_dS)N)rZr[rÚr)rrrvrrrrw–s  zT1CharString.draw)NNN)r¼r½r¾Út1OperandEncodingr„rTÚ t1Operatorsr rzrÇr¬rqrtrwÚ __classcell__rr)rnrr�zs  r�c@sreZdZeZddd„Zdd„Zdd„Zdd „Zd d „Z d d „Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„ZdS)ÚDictDecompilerNcCsg|_||_i|_||_dS)N)rÜÚstringsÚdictÚparent)rr¤r¦rrrrÇŸszDictDecompiler.__init__cCst|jƒdkstdƒ‚|jS)Nrznon-empty stack)rOrÜr-r¥)rrrrÚgetDict¥szDictDecompiler.getDictcCsfd}t|ƒ}|jj}xL||kr`t||ƒ}|d}|j|}|||||ƒ\}}|dk r||ƒqWdS)Nrr )rOrÜr³rr„)rrrZlenDatarÝrrØrrrrrt©s   zDictDecompiler.decompilecCs|jd}|jd=|S)Nr rÏrÏ)rÜ)rrrrrrÛ´s zDictDecompiler.popcCs|jdd…}|jdd…=|S)N)rÜ)rrìrrrrÓ¹s zDictDecompiler.popallcCs”|\}}t|tƒrZf}xXtt|ƒdddƒD](}||}t|d|ƒ}||ƒf|}q,Wnt|d|ƒ}||ƒ}|dkr†|jj|ƒn ||j|<dS)Nr Zarg_rhrÏrÏ)rPrQrµrOrÒrÜr|r¥)rrZargTyperrKrYZ arghandlerrrrr¾s zDictDecompiler.handle_operatorcCs*t|jdtƒr|j|jƒ}n|jƒ}|S)Nr)rPrÜÚlistÚarg_blend_numberrÛ)rr•ÚoutrrrÚ arg_numberÎszDictDecompiler.arg_numbercCs4g}|jƒ}t|ƒ}|j|ƒ|jdƒ|jƒ}|S)Nrh)rÛrOr³rÓ)rr•rªZ blendArgsÚ numMastersÚdummyrrrr©Õs  zDictDecompiler.arg_blend_numbercCs|j|jƒS)N)r¤rÛ)rr•rrrÚarg_SIDÞszDictDecompiler.arg_SIDcCs|jƒS)N)rÓ)rr•rrrÚ arg_arrayàszDictDecompiler.arg_arraycCs´|jjddƒ}|jj|ƒd}|jƒ}|jƒ}t|ƒ}|||ksFt‚dg|}|d}d} d} xN| |kr®|| | } | } || |} | g|| | |…} | || <| d7} qbW|S)a³ There may be non-blend args at the top of the stack. We first calculate where the blend args start in the stack. These are the last numMasters*numBlends) +1 args. The blend args starts with numMasters relative coordinate values, the BlueValues in the list from the default master font. This is followed by numBlends list of values. Each of value in one of these lists is the Variable Font delta for the matching region. We re-arrange this to be a list of numMaster entries. Each entry starts with the corresponding default font relative value, and is followed by the delta values. We then convert the default values, the first item in each entry, to an absolute value. rgrr N)r¥r‘r¦rrÛrÓrOr-)rr•rgr¬rrìZnumArgsrZ numDeltasrKZprevValZnewValZ masterOffsetZ blendListrrrÚ arg_blendListâs$      zDictDecompiler.arg_blendListcCsL|jƒ}g}|r$t|dtƒr$|}n$d}x|D]}||}|j|ƒq.W|S)Nr)rÓrPr¨r³)rr•Z valueListrªÚcurrentrLrrrÚ arg_deltas zDictDecompiler.arg_delta)N)r¼r½r¾ÚcffDictOperandEncodingr„rÇr§rtrÛrÓrr«r©r®r¯r°r²rrrrr£›s    r£cCs,t|ƒ}|dkrd}n|dkr$d}nd}|S)NiØr¤il„iki€)rO)r[ZnSubrsZbiasrrrrÁsrÁé×r'r')r rU)rVrW)r'rX)rYrZ)r[r\)r]r^)r_r`)rarb)rcrd)rerf)r2rg)r)rh)rirj)rkrl)rmrn)rorp)rqrr)rsrt)rurv)rwrx)ryrz)r{r|)r;r})r<r~)rr€©r r)rµr�©r rV)r¶r‚©r r')r·rƒ©r rY)r¸r„©r r_)r¹r…©r r†)rºr‡©r ra)r»rˆ©r rc)r¼r‰©r r )r½rŠ©r r‹)r¾rŒ©r re)r¿r�©r r2)rÀrŽ©r ri)rÁr�©r rm)rÂr�©r ro)rÃr‘©r rq)rÄr’©r rs)rÅr“©r ru)rÆr”©r ry)rÇr•©r r{)rÈr–©r r:)rÉr—©r r;)rÊr©r r<)rËr˜©r r™)rÌrš©r r›)rÍrœ©r r�)rÎrž©r rŸ)rÏr )r rU)rVrW)r'rX)rYrZ)r[r\)r]r^)r_r`)r†r)rarb)rcrd)r‹r )rerf)rorp)rqrr)r<r~)rr€©r r)rÐr ©r r )rÑr ©r r#)rÒr ©r r[)rÓr ©r r])rÔr©r r )rÕrŠ©r r))rÖr©r r)r×rÛ©r r)rØr):Ú__doc__ZfontTools.misc.fixedToolsrrrrrˆrrrr ZfontTools.pens.boundsPenr r$ÚloggingÚ getLoggerr¼r¥rrr r"r&r(r+r/r7r rOr-r›r³r3Ú enumerater´Z maxOpStackrTrœr¬Z encodeIntCFFrŸr®r¨r°r²rºÚ Exceptionr»Úobjectr¿r¡rrrZrir�r£rÁrrrrÚs      +  &*&V!u