+
    f7i̩  c                   s   R t ^ RIHtHtHtHt ^ RIHtHtH	t	H
t
 ^ RIHt ^ RIt^ RIt]P                  ! ]4      tR tR tR tR tR	 tR
 tR tR tR tR.R,          t^ ].,          ]R&   ^].,          ]R&   ^].,          ]R&   ^].,          ]R&   ]]^&   ]R,          t]]^&   ]]^&   ]R,          t]]^&   ]]^&   ]]^&   . R.Ot]! ]4       U Uu/ uF  w  rWbK	  	  upp t ^t!R t". R/NR0NR1NR2NR3NR4NR5NR6NR7NR8NR9NR:NR;NR<NR=NR>NR?NR@NRANRBNRCNRDNRENRFNRGNRHNRINRJNRKNRLNRMNRNNRONRPNRQNRRNRSNRTNRUNRVNRWNRXNRYNRZNR[NR\NR]NR^NR_NR`NRaNRbNt#R t$]$! R4      t%]$! R4      t&]$! R4      t']PP                  3R lt)]! ^4      ]! ^4      ,           t*R t+ ! R R],4      t- ! R R].4      t/. RcOt0 ! R R ]/4      t1 ! R! R"]/4      t2 ! R# R$]24      t3 ! R% R&]34      t4 ! R' R(].4      t5 ! R) R*]54      t6 ! R+ R,].4      t7R- t8R# u upp i )dzwpsCharStrings.py -- module implementing various kinds of CharStrings:
CFF dictionary data and Type1/Type2 CharStrings.
)fixedToFloatfloatToFixedfloatToFixedToStrstrToFixedToFloat)bytechrbyteord	bytesjoinstrjoin)	BoundsPenNc                 s    V^8X  d   V\        W#,          4      3pV^,           pMTp V P                  V,          pT P                  T4      pYc3#   \         d    RT3u # i ; i)   N)r   	operatorsKeyErrorhandle_operator)selfb0dataindexZopoperatorvalues   &&&&   C/usr/lib64/python3.14/site-packages/fontTools/misc/psCharStrings.pyread_operatorr      sp    	Rx'$+&'	>>"%   *E<  U{s   A A! A!c                 s    V^,
          V3# )i    r   r   r   r      &&&&r   	read_byter   "   s    8U?    c                 sr    \        W#,          4      pV^,
          R,          V,           ^l,           V^,           3# )      r   r   r   r   r   Zb1   &&&& r   read_smallInt1r   &   s0    		BHb 3&	11r   c                 st    \        W#,          4      pV^,
          ) R,          V,
          ^l,
          V^,           3# )   r   r   r   r   r   read_smallInt2r!   +   s2    		B#X;r!C'22r   c                 sZ    \         P                  ! R W#V^,            4      w  pWC^,           3# )>hstructunpackr   r   r   r   r   r   r   read_shortIntr'   0   *    }}T4	#:;HU!)r   c                 sZ    \         P                  ! R W#V^,            4      w  pWC^,           3# )>lr#   r&   r   r   read_longIntr*   5   r(   r   c                 sr    \         P                  ! R W#V^,            4      w  p\        V^R7      V^,           3# )r)   ZprecisionBits)r$   r%   r    r&   r   r   read_fixed1616r,   :   s3    }}T4	#:;HUR0%!);;r   c                 s    \         V3# N)ZNotImplementedr   r   r   read_reservedr.   ?   s    5  r   c                 s    R p \        W#,          4      pV^,           pV^,          ^,	          pV^,          pV^8X  d   M2V\        V,          ,           pV^8X  d   MV\        V,          ,           pKn  \        V4      V3# )Z )r   realNibblesfloat)r   r   r   r   ZnumberbZnibble0Znibble1s   &&&&    r   read_realNumberr2   D   sv    F
DK 	t8/d(c>+g..c>+g..=%r   r   :        N:r4   r   N:r   r    N:r    i   NNNNc                 s   / p/ pV  F|  p\        V4      ^8X  d   V^,          W^ ,          &   MVR,          W^ ,          &   \        V^ ,          \        4      '       d   V^ ,          W#^,          &   Ki  V^ ,          3W#^,          &   K~  	  W3#       NN)len
isinstancetuple)ZoperatorListZoperZopcZitem   &   r   buildOperatorDictr>   |   sz    D
Ct9> GDaM HDaMd1gu%%7CQL G:CQL  9r   c                 s    V R 8X  d   \        ^4      p\        ^4      pM"V R8X  d   Rp\        ^4      pM\        ^4      pRpV\         \        P                  \        P                  V3R lpV# )cfft1Nc                 s8   RT u;8:  d   ^k8:  d   M MV! V ^,           4      pV# ^lT u;8:  d   R8:  d9   M M5V ^l,
          p V! V ^,	          ^,           4      V! V ^,          4      ,           pV# RT u;8:  d   R8:  d:   M M6V ) ^l,
          p V! V ^,	          ^,           4      V! V ^,          4      ,           pV# Ve$   R	T u;8:  d   R8:  d   M MWS! RV 4      ,           pV# Vf.   \         P                  R4       V! ^4      V! RV 4      ,           pV# W! RV 4      ,           pV# )
ik   k  i  r"   zk4-byte T2 number got passed to the IntType handler. This should happen only when reading in old XML files.
r)   iiii )logZwarning)r   
fourByteOpr   packr%   	twoByteOpZcodes   &&&&&& r   	encodeIntZ getIntEncoder.<locals>.encodeInt   s%    5C53;'D4 3 E!T!CKEEQJ#-.1FFD. - e#t#FSLEEQJ#-.1FFD( ' "v'?%'?tD%00D$ #  KK#
 3<$tU"33D  T5 11Dr   )r   r$   rD   r%   )ZformatrE   rC   rF   r=   r   getIntEncoderrG      sg    BK	R[
	4	S\
 BK	
 [[}}#J r   r?   r@   Zt2c                s|    \        V ^R7      pVR,          ^ 8X  d   \        V^,	          4      # RV! RV4      ,           # )zFor T2 onlyr+   i  s   r)   )r   encodeIntT2)frD   r      && r   encodeFixedrK      s;    "-Ev~5B;''dE***r   c                 s   V R 8X  d   \         # RV ,          pVR,          R8X  d   VR,          pMVR,          R8X  d   RVR,          ,           pMVP                  R	4      '       d7   VP                  R
4      pRV\        V4      \        V4      ,
          3,          pMVP	                  R4      pVP	                  R4      pVR8w  dZ   VR8w  dS   VRV pW^,           V p\        W^,           R 4      pV\        V4      ,
          pV^8X  d   V: V: R
2pMRWVV3,          pVP                  R4      '       d8   VP                  R^4      w  rRWP                  R
4      \        V4      3,          p. p
V'       d   V^ ,          pVR,          pVR8X  dM   VR,          pVR8X  d   VR,          pRpMVR8X  d
   VR,          pVP                  R
4      '       d
   VR,          pV
P                  \        V,          4       K  V
P                  ^4       \        V
4      ^,          '       d   V
P                  ^4       \        ^4      p\        ^ \        V
4      ^4       F6  pV\        W,          ^,          W^,           ,          ,          4      ,           pK8  	  V# )g        z%.8G:Nr7   Nz0.r8   :N   Nz-0.-:r7   NNZ0000z%sE%d.ENz%s%sE%dz%s%sE-%d:Nr9   NE-Z+)z.0z-.0)realZeroBytesZendswithZrstripr:   ZfindintZ
startswithsplitZlstripappendrealNibblesDictr   range)rI   ZsZsignificantDigitsZdotIndexZeIndexZintegerPartZfractionalPartZexponentZnewExponentZsignZnibblesZcZc2Zdis   &              r   encodeFloatrZ     s#   Cx 	
Au}bE	
2%!B%K	
E		HHSM(#a&37H3I*IJJ66#;r>flIX,K!|f5N1aZ\?+H"S%88Ka*N;k JJ||M""''#q/$s1v66G
aDbE82BSybEsbE||C  bEq)*NN3
7|asA1c'lA&
a'a%.899 'Hr   c                   s    ] tR tRtRtR# )CharStringCompileErrori?  r   N)__name__
__module____qualname____firstlineno____static_attributes__r   r   r   r[   r[   ?  s    r   r[   c                   s&  a  ] tR tRt o R.R ltR tRR/R ltR tR tR	 t	R
 t
R tR tR tR tR tR tR tR tR t]tR tR tR tR tR tR tR tR tR tR tR tR t R  t!R! t"R" t#R# t$R$ t%R% t&R& t'R' t(R( t)R) t*R* t+R+ t,R, t-R-t.V t/R# )/SimpleT2DecompileriC  Nc                s    Wn         \        V4      V n        W n        \        V4      V n        W0n        W@n        V P                  4        R # r-   )
localSubrscalcSubrBias	localBiasglobalSubrs
globalBiasprivateblenderreset)r   rb   re   rg   rh      &&&&&r   __init__ZSimpleT2Decompiler.__init__D  s8    $%j1&&{3

r   c                sZ    . V n         . V n        ^ V n        ^ V n        ^ V n        ^ V n        R# r3   N)callingStackoperandStack	hintCounthintMaskBytes
numRegionsvsIndexr      &r   ri   ZSimpleT2Decompiler.resetM  s/    r   pushToStackc               s   V P                   P                  V4       VP                  4       pV'       d   . pVP                  pMR  pVf   V P                  P                  p^ p VP	                  V4      w  rxpVf   MeV! V4       V'       dL   RV,           p	\        W	R4      p
V
e!   V
! V4      pV'       d   Vw  rV! V4       Ka  Kc  V P                  4        Ku  V! V4       K  V'       d   VP                  X4       V P                   R R# )c                     R # r-   r   )xrt   r   Z<lambda>Z,SimpleT2Decompiler.execute.<locals>.<lambda>\  s    dr   NZop_rR   )rm   rV   needsDecompilationrn   getTokengetattrpopall
setProgram)r   
charStringru   rx   programZpushToProgramr   token
isOperatorZhandlerNamehandlerZrvrp   s   &&$          r   executeZSimpleT2Decompiler.executeU  s      ,'::<G#NNM*M++22K'1':':5'A$Eu}% #em!$T:& B/1,%m4  KKME"!!'*b!r   c                F    V P                   R,          pV P                   R V# r9   rR   rn   r   r      & r   popZSimpleT2Decompiler.popu  s%    !!"%b!r   c                sJ    V P                   R ,          p. V P                   R &   V# r5   r   r   stackr   r   r{   ZSimpleT2Decompiler.popallz  s'    !!!$!!r   c                s<    V P                   P                  V4       R # r-   )rn   rV   r      &&r   pushZSimpleT2Decompiler.push  s      'r   c                s.    V P                   '       d   R # R # r-   r   r   r   r   r   	op_returnZSimpleT2Decompiler.op_return  s     r   c                rv   r-   r   r   r   r   
op_endcharZSimpleT2Decompiler.op_endchar      r   c                rv   r-   r   r   r   r   	op_ignoreZSimpleT2Decompiler.op_ignore  r   r   c                    V P                  4       pV P                  W P                  ,           ,          pV P                  V4       R # r-   )r   rb   rd   r   r   r   	subrIndexZsubr   &&  r   op_callsubrZSimpleT2Decompiler.op_callsubr  s.    HHJ	y>>9:Tr   c                r   r-   )r   re   rf   r   r   r   r   op_callgsubrZSimpleT2Decompiler.op_callgsubr  s0    HHJ		OO ;<Tr   c                &    V P                  4        R # r-   
countHintsr   r   r   op_hstemZSimpleT2Decompiler.op_hstem      r   c                r   r-   r   r   r   r   op_vstemZSimpleT2Decompiler.op_vstem  r   r   c                r   r-   r   r   r   r   
op_hstemhmZSimpleT2Decompiler.op_hstemhm  r   r   c                r   r-   r   r   r   r   
op_vstemhmZSimpleT2Decompiler.op_vstemhm  r   r   c                s    V P                   '       g0   V P                  4        V P                  ^,           ^,          V n         V P                  R,          P	                  WP                   4      w  r!W!3# )   rR   )rp   r   ro   rm   getBytes)r   r   rp   rJ   r   op_hintmaskZSimpleT2Decompiler.op_hintmask  s[    !!!OO"&..1"4!:D#004==eEWEWX##r   c                v    V P                  4       pV P                  \        V4      ^,          ,           V n        R# r7   N)r{   ro   r:   r   argsr   r   r   ZSimpleT2Decompiler.countHints  s%    {{}#d)q.8r   c                    \         hr-   ZNotImplementedErrorr   r   r   op_andZSimpleT2Decompiler.op_and      !!r   c                r   r-   r   r   r   r   op_orZSimpleT2Decompiler.op_or  r   r   c                r   r-   r   r   r   r   op_notZSimpleT2Decompiler.op_not  r   r   c                r   r-   r   r   r   r   op_storeZSimpleT2Decompiler.op_store  r   r   c                r   r-   r   r   r   r   op_absZSimpleT2Decompiler.op_abs  r   r   c                r   r-   r   r   r   r   op_addZSimpleT2Decompiler.op_add  r   r   c                r   r-   r   r   r   r   op_subZSimpleT2Decompiler.op_sub  r   r   c                r   r-   r   r   r   r   op_divZSimpleT2Decompiler.op_div  r   r   c                r   r-   r   r   r   r   op_loadZSimpleT2Decompiler.op_load  r   r   c                r   r-   r   r   r   r   op_negZSimpleT2Decompiler.op_neg  r   r   c                r   r-   r   r   r   r   op_eqZSimpleT2Decompiler.op_eq  r   r   c                r   r-   r   r   r   r   op_dropZSimpleT2Decompiler.op_drop  r   r   c                r   r-   r   r   r   r   op_putZSimpleT2Decompiler.op_put  r   r   c                r   r-   r   r   r   r   op_getZSimpleT2Decompiler.op_get  r   r   c                r   r-   r   r   r   r   	op_ifelseZSimpleT2Decompiler.op_ifelse  r   r   c                r   r-   r   r   r   r   	op_randomZSimpleT2Decompiler.op_random  r   r   c                r   r-   r   r   r   r   op_mulZSimpleT2Decompiler.op_mul  r   r   c                r   r-   r   r   r   r   op_sqrtZSimpleT2Decompiler.op_sqrt  r   r   c                r   r-   r   r   r   r   op_dupZSimpleT2Decompiler.op_dup  r   r   c                r   r-   r   r   r   r   op_exchZSimpleT2Decompiler.op_exch  r   r   c                r   r-   r   r   r   r   op_indexZSimpleT2Decompiler.op_index  r   r   c                r   r-   r   r   r   r   op_rollZSimpleT2Decompiler.op_roll  r   r   c                sH   V P                   ^ 8X  d    V P                  P                  4       V n         V P                  4       pW P                   ^,           ,          pV P                  f   V P
                  W2,
          ) R1 R# \        V P
                  4      V,
          pWB,           ;rVWE8  di   W`P                   ,           pV P
                  Wg pV P	                  V P                  V4      p	V P
                  V;;,          V	,          uu&   TpV^,          pKn  . V P
                  VR% R# rl   )rq   rg   getNumRegionsr   rh   rn   r:   rr   )
r   r   	numBlendsZnumOpsZargiZend_argsZtupleiZnext_tiZdeltasZdelta
   &&        r   op_blendZSimpleT2Decompiler.op_blend  s    ??a"ll88:DOHHJ	oo12<<!!$%' t(()F2D $ 00H/ ??2**6:T\\6:!!$'50' 	+-Dhi(r   c                sr    V P                  4       pW n        V P                  P                  V4      V n        R # r-   )r   rr   rg   r   rq   )r   r   ZvirJ   r   
op_vsindexZSimpleT2Decompiler.op_vsindex  s(    XXZ,,44R8r   )rh   rm   rf   re   ro   rp   rd   rb   rq   rn   rg   rr   NN)0r\   r]   r^   r_   rk   ri   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   r   r   r   r   r   r`   __classdictcell____classdict__   @r   ra   ra   C  s     " "@

(

$ K9
"""""""""""""""""""""".*9 9r   ra   c                   s2   a a ] tR tRt oV 3R ltRtVtV ;t# )T2StackUseExtractori+  c                s>   <a a ^ oVV 3R lp\         SS `  WR7       S# )r3   c                 s|   < SP                   P                  V 4       \        S\        SP                   4      4      oR # r-   )rn   rV   Zmaxr:   )r   maxStackUser   s   &r   ru   Z0T2StackUseExtractor.execute.<locals>.pushToStack0  s.    $$U+k3t/@/@+ABKr   )ru   )superr   )r   r}   ru   r   	__class__s   f& @r   r   ZT2StackUseExtractor.execute-  s$    	C
 	
<r   r   )r\   r]   r^   r_   r   r`   r   __classcell__r   r      @@r   r   r   +  s     	 	r   r   c                   sX   a  ] tR tRt o RR ltR tRR ltR tR tR t	R	 t
R
 tRtV tR# )T2WidthExtractori9  Nc                sL    \         P                  WW%V4       W0n        W@n        R # r-   )ra   rk   nominalWidthXdefaultWidthX)r   rb   re   r   r   rg   rh   s   &&&&&&&r   rk   ZT2WidthExtractor.__init__:  s"     	##DkGT**r   c                sL    \         P                  V 4       ^ V n        ^ V n        R# rl   )ra   ri   gotWidthwidthrs   rt   r   ri   ZT2WidthExtractor.resetG  s      &
r   c                s
   V P                  4       pV P                  '       ga   V\        V4      ^,          ,          '       d*   V P                  V^ ,          ,           V n        VR,          pMV P
                  V n        ^V n        V# r6   )r{   r   r:   r   r   r   )r   evenOddr   rJ   r   popallWidthZT2WidthExtractor.popallWidthL  sc    {{}}}}#d)a-((
 "//$q'9
Bx!//
DMr   c                r   r   )r   ro   r:   r   r   r   r   ZT2WidthExtractor.countHints[  s(    !#d)q.8r   c                r   r-   r   r   r   r   
op_rmovetoZT2WidthExtractor.op_rmoveto_      r   c                (    V P                  ^4       R# r9   Nr   r   r   r   
op_hmovetoZT2WidthExtractor.op_hmovetob      r   c                r   r   r   r   r   r   
op_vmovetoZT2WidthExtractor.op_vmovetoe  r   r   c                r   r-   r   r   r   r   r   ZT2WidthExtractor.op_endcharh  r   r   )r   r   ro   r   r   r   r3   )r\   r]   r^   r_   rk   ri   r   r   r   r   r   r   r`   r   r   r   r   r   r   9  s2     +
9 r   r   c                   sh  a a ] tR tRt oR7R ltR tV 3R ltR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R  t"R! t#R" t$R# t%R$ t&R% t'R& t(R' t)R( t*R) t+R* t,R+ t-R, t.R- t/R. t0R/ t1R0 t2R1 t3R2 t4R3 t5R4 t6R5 t7R6t8Vt9V ;t:# )8T2OutlineExtractoril  c           	     sV    \         P                  V VVVVVV4       Wn        ^ V n        R# rl   )r   rk   pen	subrLevel)r   r   rb   re   r   r   rg   rh   s   &&&&&&&&r   rk   ZT2OutlineExtractor.__init__m  s5     	!!	
 r   c                sZ    \         P                  V 4       RV n        ^ V n        ^ V n        R# r3   N)r3   r3   )r   ri   currentPoint	sawMoveTor   rs   rt   r   ri   ZT2OutlineExtractor.reset  s&    t$"r   c                s   < V ;P                   ^,          un         \        SV `	  V4       V ;P                   ^,          un         V P                   ^ 8X  d   V P                  4        R# R# r   )r   r   r   endPath)r   r}   r   s   &&r   r   ZT2OutlineExtractor.execute  sE    !
#!>>QLLN r   c                sj    V P                   w  r#W!^ ,          ,           W1^,          ,           3pWn         V# r   )r   )r   pointrw   yr   r   
_nextPointZT2OutlineExtractor._nextPoint  s0      !Ha(l*!r   c                sh    V P                   P                  V P                  V4      4       ^V n        R# r   )r   ZmoveTor   r   r   r   r   r   rMoveToZT2OutlineExtractor.rMoveTo  s"    ./r   c                s    V P                   '       g   V P                  R4       V P                  P                  V P	                  V4      4       R# r   )r   r   r   ZlineTor   r   r   r   rLineToZT2OutlineExtractor.rLineTo  s0    ~~~LL ./r   c                s    V P                   '       g   V P                  R4       V P                  pV P                  P	                  V! V4      V! V4      V! V4      4       R# r   )r   r   r   r   ZcurveTo)r   Zpt1Zpt2Zpt3Z	nextPointr   r   rCurveToZT2OutlineExtractor.rCurveTo  sB    ~~~LL OO	333Hr   c                l    V P                   '       d   V P                  P                  4        ^ V n         R# rl   )r   r   	closePathrs   rt   r   r   ZT2OutlineExtractor.closePath  s"    >>>HH r   c                sN    V P                   '       d   V P                  4        R # R # r-   )r   r   rs   rt   r   r   ZT2OutlineExtractor.endPath  s    
 >>>NN r   c                sd    V P                  4        V P                  V P                  4       4       R # r-   r   r   r   r   r   r   r   ZT2OutlineExtractor.op_rmoveto  s     T%%'(r   c                sx    V P                  4        V P                  V P                  ^4      ^ ,          ^ 34       R# r   r   r   r   r   r   ZT2OutlineExtractor.op_hmoveto  s,    d&&q)!,a01r   c                sx    V P                  4        V P                  ^ V P                  ^4      ^ ,          34       R# rl   r   r   r   r   r   ZT2OutlineExtractor.op_vmoveto  s,    a))!,Q/01r   c           	     s
   V P                  4        V P                  4       pV'       d[   ^ RIHp Vw  rErgW6,          pV P                  P                  VR4       W7,          p	V P                  P                  V	^^ ^ ^WE34       R# R# )r3   StandardEncodingNr9   r3   r3   r9   r3   r3   )r   r   $fontTools.encodings.StandardEncodingr   r   addComponent)
r   r   r   r   adxadybcharachar	baseGlyphaccentGlyphr   r   r   ZT2OutlineExtractor.op_endchar  st    !M &*"Ce(/IHH!!)-?@*1KHH!!+1aC/EF r   c                s    V P                  4       p\        ^ \        V4      ^4       F  pW#V^,            pV P                  V4       K!  	  R# rl   )r{   rX   r:   r   )r   r   r   rY   r      &&   r   
op_rlinetoZT2OutlineExtractor.op_rlineto  s=    {{}q#d)Q'AQUOELL (r   c                r   r   alternatingLinetor   r   r   
op_hlinetoZT2OutlineExtractor.op_hlineto      q!r   c                s(    V P                  ^ 4       R# rl   r   r   r   r   
op_vlinetoZT2OutlineExtractor.op_vlineto  r  r   c                s    V P                  4       p\        ^ \        V4      ^4       F+  pW#V^,            w  pppppp	V P                  WE3Wg3W34       K-  	  R# )z${dxa dya dxb dyb dxc dyc}+ rrcurvetoN)r{   rX   r:   r   )
r   r   r   rY   dxadyadxbdybdxcdycr   r   op_rrcurvetoZT2OutlineExtractor.op_rrcurveto  s^    {{}q#d)Q'A QMM3*sj3*= (r   c                s    V P                  4       p\        ^ \        V4      ^,
          ^4       F(  pW#V^,            w  rErgrV P                  WE3Wg3W34       K*  	  V P	                  VRR 4       R# )z-{dxa dya dxb dyb dxc dyc}+ dxd dyd rcurvelineN)r{   rX   r:   r   r   )
r   r   r   rY   r  r  r	  r
  dxddydr   r   op_rcurvelineZ T2OutlineExtractor.op_rcurveline  sf    {{}q#d)a-+A+/AE?(CcMM3*sj3*= , 	T"#Yr   c                s    V P                  4       pVRR p\        ^ \        V4      ^4       F  pV P                  W4V^,            4       K  	  VRR w  rVrxrV P	                  WV3Wx3W34       R# )z-{dxa dya}+ dxb dyb dxc dyc dxd dyd rlinecurveNi)r{   rX   r:   r   r   )r   r   r   ZlineArgsrY   r  r  r	  r
  r  r  s   &&         r   op_rlinecurveZ T2OutlineExtractor.op_rlinecurve  sl    {{}9q#h-+ALLa!e,- ,'+BCy$#Csj3*sj9r   c                s   V P                  4       p\        V4      ^,          '       d   V^ ,          pVR,          pM^ p\        ^ \        V4      ^4       F*  pW$V^,            w  rVrxV P                  W53Wg3^ V34       ^ pK,  	  R# )z!dx1? {dya dxb dyb dyc}+ vvcurvetor8   Nr{   r:   rX   r   )	r   r   r   dx1rY   r  r  r  r
  	   &&       r   op_vvcurvetoZT2OutlineExtractor.op_vvcurveto  sw    {{}t9q==q'C8DCq#d)Q'A!%!a%CcMM3*sj1c(;C (r   c                s   V P                  4       p\        V4      ^,          '       d   V^ ,          pVR,          pM^ p\        ^ \        V4      ^4       F*  pW$V^,            w  rVrxV P                  WS3Wg3V^ 34       ^ pK,  	  R# )z!dy1? {dxa dxb dyb dxc}+ hhcurvetor8   Nr  )	r   r   r   dy1rY   r  r  r  r	  r  r   op_hhcurvetoZT2OutlineExtractor.op_hhcurveto  sw    {{}t9q==q'C8DCq#d)Q'A!%!a%CcMM3*sj3(;C (r   c                    V P                  4       pV'       d/   V P                  V4      pV'       g   K#  V P                  V4      pK6  R# )zydy1 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r   r   r   rJ   r   op_vhcurvetoZT2OutlineExtractor.op_vhcurveto*  8     {{}==&Dt}}T* r   c                r  )z`dx1 dx2 dy2 dy3 {dya dxb dyb dxc dxd dxe dye dyf}* dxf?
{dxa dxb dyb dyc dyd dxe dye dxf}+ dyf?
N)r{   r  r  r  rJ   r   op_hvcurvetoZT2OutlineExtractor.op_hvcurveto4  r  r   c                s    V P                  4       w  r#rErgp^ ;p	;p
;rV) pV P                  W)3W43WZ34       V P                  Wk3W}3W34       R# rl   r{   r   )r   r   r  dx2dy2dx3dx4dx5dx6r  dy3dy4dy6dy5   &&            r   op_hflexZT2OutlineExtractor.op_hflexA  s[    ,0KKM)#Cc !!!c!Cdsj3*sj9sj3*sj9r   c                s    V P                  4       w  r#rErgrrrpV P                  W#3WE3Wg34       V P                  W3W3W34       R # r-   r  )r   r   r  r  r  r   r!  r%  r"  r&  r#  r(  r$  r'  Zfds   &&             r   op_flexZT2OutlineExtractor.op_flexH  sH    IMF#Cc#Bsj3*sj9sj3*sj9r   c           	     s    V P                  4       w	  r#rErgrp
^ ;rW5,           V,           V,           V	,           ) pV P                  W#3WE3Wk34       V P                  W|3W3W34       R# rl   r  )r   r   r  r  r  r   r!  r"  r#  r(  r$  r%  r&  r'  r)  r   	op_hflex1ZT2OutlineExtractor.op_hflex1M  sc    6:kkm3#Cc	C#%+,sj3*sj9sj3*sj9r   c                sJ   V P                  4       w  r#rErgrrpW$,           V,           V,           V
,           pW5,           V,           V	,           V,           p\        V4      \        V4      8  d   TpV) pMV) pTpV P                  W#3WE3Wg34       V P                  W3W3VV34       R # r-   )r{   absr   )r   r   r  r  r  r   r!  r%  r"  r&  r#  r(  Zd6ZdxZdyr$  r'  s   &&               r   op_flex1ZT2OutlineExtractor.op_flex1U  s    ?C{{}<#Cc"Y_s"S(Y_s"S(r7SWC#C#CCsj3*sj9sj3*sCj9r   c                r   r-   r   r   r   r   r   ZT2OutlineExtractor.op_andc  r   r   c                r   r-   r   r   r   r   r   ZT2OutlineExtractor.op_orf  r   r   c                r   r-   r   r   r   r   r   ZT2OutlineExtractor.op_noti  r   r   c                r   r-   r   r   r   r   r   ZT2OutlineExtractor.op_storel  r   r   c                r   r-   r   r   r   r   r   ZT2OutlineExtractor.op_abso  r   r   c                r   r-   r   r   r   r   r   ZT2OutlineExtractor.op_addr  r   r   c                r   r-   r   r   r   r   r   ZT2OutlineExtractor.op_subu  r   r   c                s    V P                  4       pV P                  4       pW2,          pW2,          pWE8X  d   V P                  V4       R # V P                  V4       R # r-   )r   r   )r   r   Znum2Znum1Zd1Zd2   &&    r   r   ZT2OutlineExtractor.op_divx  sA    xxzxxz\[8IIbMIIbMr   c                r   r-   r   r   r   r   r   ZT2OutlineExtractor.op_load  r   r   c                r   r-   r   r   r   r   r   ZT2OutlineExtractor.op_neg  r   r   c                r   r-   r   r   r   r   r   ZT2OutlineExtractor.op_eq  r   r   c                r   r-   r   r   r   r   r   ZT2OutlineExtractor.op_drop  r   r   c                r   r-   r   r   r   r   r   ZT2OutlineExtractor.op_put  r   r   c                r   r-   r   r   r   r   r   ZT2OutlineExtractor.op_get  r   r   c                r   r-   r   r   r   r   r   ZT2OutlineExtractor.op_ifelse  r   r   c                r   r-   r   r   r   r   r   ZT2OutlineExtractor.op_random  r   r   c                r   r-   r   r   r   r   r   ZT2OutlineExtractor.op_mul  r   r   c                r   r-   r   r   r   r   r   ZT2OutlineExtractor.op_sqrt  r   r   c                r   r-   r   r   r   r   r   ZT2OutlineExtractor.op_dup  r   r   c                r   r-   r   r   r   r   r   ZT2OutlineExtractor.op_exch  r   r   c                r   r-   r   r   r   r   r   ZT2OutlineExtractor.op_index  r   r   c                r   r-   r   r   r   r   r   ZT2OutlineExtractor.op_roll  r   r   c                s    V P                  4       pV F,  pV'       d   V^ 3pM^ V3pV P                  V4       V'       * pK.  	  R# rl   )r{   r   )r   ZisHorizontalr   argr   r   r   r  Z$T2OutlineExtractor.alternatingLineto  s@    {{}CaCLL++L r   c                s    VR ,          w  r#rEVR,          p\        V4      ^8X  d   V^ ,          p. pM^ pV P                  ^ V3W43WV34       V# :N   N:r2  NNr:   r   )r   r   r  r  r  r	  r
     &&     r   r  ZT2OutlineExtractor.vcurveto  sT    !"X#Bxt9>q'CDCq#h
SJ7r   c                s    VR ,          w  r#rEVR,          p\        V4      ^8X  d   V^ ,          p. pM^ pV P                  V^ 3W43We34       V# r1  r3  )r   r   r  r  r  r
  r	  r4  r   r  ZT2OutlineExtractor.hcurveto  sT    !"X#Bxt9>q'CDCsAh
SJ7r   )r   r   r   r   r   );r\   r]   r^   r_   rk   ri   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   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r`   r   r   r   r   r   r   r   l  s    ,0
I
6)22G" ""> :++::
::""""""""""""""""""""",		 	r   r   c                   s   a  ] tR tRt o R tR tR tRR ltR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tRtV tR# )T1OutlineExtractori  c                s>    Wn         W n        V P                  4        R # r-   )r   subrsri   )r   r   r6     &&&r   rk   ZT1OutlineExtractor.__init__  s    


r   c                sZ    ^ V n         ^ V n        ^ V n        \        P	                  V 4       R# rl   )flexingr   sbxr   ri   rs   rt   r   ri   ZT1OutlineExtractor.reset  s%    
  &r   c                r   rl   )r   r   r   rs   rt   r   r   ZT1OutlineExtractor.endPath  s"    >>>HHr   c                "    V P                  4       # r-   r{   )r   r   r   r   r   ZT1OutlineExtractor.popallWidth      {{}r   c                sP    V P                   pVR,          VR,          uVR&   VR&   R# )r7   Nr  rR   r   r   r   r   exchZT1OutlineExtractor.exch  s)    !!$Ry%)b	59r   c                s    V P                   '       d   R # V P                  4        V P                  V P                  4       4       R # r-   )r8  r   r   r{   r   r   r   r   ZT1OutlineExtractor.op_rmoveto  s)    <<<T[[]#r   c                s    V P                   '       d   V P                  ^ 4       R# V P                  4        V P                  V P	                  4       ^ ,          ^ 34       R# rl   )r8  r   r   r   r{   r   r   r   r   ZT1OutlineExtractor.op_hmoveto  s>    <<<IIaLdkkmA&*+r   c                s    V P                   '       d$   V P                  ^ 4       V P                  4        R# V P                  4        V P	                  ^ V P                  4       ^ ,          34       R# rl   )r8  r   r=  r   r   r{   r   r   r   r   ZT1OutlineExtractor.op_vmoveto  sG    <<<IIaLIIKaq)*+r   c                r   r-   )r   r   r   r   op_closepathZT1OutlineExtractor.op_closepath  s    r   c                s>    V P                  4       pVw  r4W43V n        R # r-   )r{   r   )r   r   r   rw   r   r   r   op_setcurrentpointZ%T1OutlineExtractor.op_setcurrentpoint  s    {{}Dr   c                r   r-   )r   r   r   r   r   ZT1OutlineExtractor.op_endchar
  s    r   c                st    V P                  4       w  r#W0n        W n        W P                  ^,          3V n        R# r   )r{   r   r9  r   )r   r   r9  Zwxr   r   op_hsbwZT1OutlineExtractor.op_hsbw  s/    ++-
!2!21!55r   c                r   r-   r;  r   r   r   op_sbwZT1OutlineExtractor.op_sbw      r   c                sn    V P                  4       pV P                  V,          pV P                  V4       R # r-   )r   r6  r   r   r   r   r   ZT1OutlineExtractor.op_callsubr  s'    HHJ	zz)$Tr   c                s    V P                  4       pV P                  4       pV^ 8X  d!   V^8X  d   V P                  4        ^ V n        R# V^8X  d   V^ 8X  d
   ^V n        R# R# R# rl   )r   doFlexr8  )r   r   r   ZnArgsr   r   op_callothersubrZ#T1OutlineExtractor.op_callothersubr  sP    HHJ	
>eqjKKMDL!^
DL !+^r   c                rv   r-   r   r   r   r   op_popZT1OutlineExtractor.op_pop'  r   r   c                s`   V P                  4       pV P                  4       pV P                  4        V P                  4       pV P                  4       pV P                  4       pV P                  4       pV P                  4       pV P                  4       pV P                  4       p	V P                  4       p
V P                  4       pV P                  4       pV P                  4       pV P                  4       pV P                  4       pV P                  4       pV P                  VV,           4       V P                  W,           4       V P                  V4       V P                  V4       V P                  V
4       V P                  V	4       V P                  R 4       V P                  V4       V P                  V4       V P                  V4       V P                  V4       V P                  V4       V P                  V4       V P                  R 4       V P                  V4       V P                  V4       R # r-   )r   r   r  )r   ZfinalyZfinalxZp3yZp3xZbcp4yZbcp4xZbcp3yZbcp3xZp2yZp2xZbcp2yZbcp2xZbcp1yZbcp1xZrpyZrpxs   &                r   rC  ZT1OutlineExtractor.doFlex*  s   
hhjhhj



hhjhhj



hhjhhj 			%#+		%+		%		%		#		#$ 			%		%		%		%		#		#$ 			&		&r   c                r   r-   r;  r   r   r   op_dotsectionZ T1OutlineExtractor.op_dotsectionT  rB  r   c                r   r-   r;  r   r   r   	op_hstem3ZT1OutlineExtractor.op_hstem3W  rB  r   c           	     s   ^ RI Hp V P                  4       w  r4rVpW&,          pV P                  P	                  VR4       W',          p	W@P
                  ,           V,
          pV P                  P	                  V	^^ ^ ^WE34       R# )zasb adx ady bchar achar seacr   Nr   )r   r   r{   r   r   r9  )
r   r   r   Zasbr   r   r   r   r   r   r   r   op_seacZT1OutlineExtractor.op_seacZ  sk    I&*kkm##e$+	i);<&-HHns"kAq!Q+ABr   c                r   r-   r;  r   r   r   	op_vstem3ZT1OutlineExtractor.op_vstem3e  rB  r   )r   r8  r   r   r9  r6  r   Nr   )r\   r]   r^   r_   rk   ri   r   r   r=  r   r   r   r>  r?  r   r@  rA  r   rD  rE  rC  rF  rG  rH  rI  r`   r   r   r   r   r5  r5    su     
'
4$,,!
6
(T	C r   r5  c                   s   a  ] tR tRt o ]t]! ]4      w  tt	]
t]tRR ltRR ltR tR tR tR tRR	 ltR
 tRR ltR tR tR t]]]3R ltR tR tRR lt R t!Rt"V t#R# )T2CharStringii  Nc                s^    Vf   . pWn         W n        W0n        Ve   TM. V n        R V n        R # r-   )bytecoder~   rg   re   _cur_vsindex)r   rK  r~   rg   re   rj   r   rk   ZT2CharString.__init__o  s2    ?G *5*A;r r   c                s    V P                   pVe   Wn        M3V P                  f&   \        VR4      '       d   VP                  M^ V n        VP	                  V P                  4      # )Nvsindex)rg   rL  ZhasattrrM  r   )r   rM  ZpdrJ   r   r   ZT2CharString.getNumRegionsx  sT    \\ '&.5b).D.D

!D 1 122r   c                s    V P                   f)   RV P                  P                  \        V 4      3,          # RV P                  P                  \        V 4      3,          # )Nz<%s (source) at %x>z<%s (bytecode) at %x>)rK  r   r\   Zidrs   rt   r   __repr__ZT2CharString.__repr__  sH    == (DNN,C,CRX+NNN*dnn.E.Er$x-PPPr   c                    \         # r-   )rH   rs   rt   r   rG   ZT2CharString.getIntEncoder      r   c                rO  r-   )rK   rs   rt   r   getFixedEncoderZT2CharString.getFixedEncoder  rP  r   c                s    V P                  4       '       g   R # \        V P                  R. 4      pV P                  WP                  V P                  4      pVP                  V 4       R # )NSubrs)rx   rz   rg   decompilerClassre   r   )r   r6  Z
decompiler   &  r   	decompileZT2CharString.decompile  sP    &&((gr2))%1A1A4<<P
4 r   c           	     s   \        V P                  R . 4      pV P                  VVV P                  V P                  P                  V P                  P
                  V P                  V4      pVP                  V 4       VP                  V n        R# )rR  N)rz   rg   outlineExtractorre   r   r   r   r   )r   r   rh   r6  	extractor   &&&  r   drawZT2CharString.draw  sr    gr2))LL&&LL&&LL
	 	$__
r   c                sR    \        V4      pV P                  V4       VP                  # r-   )r   rY  Zbounds)r   ZglyphSetZ	boundsPenrJ   r   
calcBoundsZT2CharString.calcBounds  s$    h'			)r   c                s   V P                   e   R # V P                  pV P                  pV'       d   V'       d   VR,          R9   d   VR R pM0V'       d)   \        VR,          \        4      '       g   \        R4      h. pV P                  4       pV P                  4       p^ p\        V4      pWx8  d   W7,          p	V^,           p\        V	\        4      '       dK    VP                  R W),           4       4       T	R9   d#   TP                  Y7,          4       T^,           pKu  Kw  \        V	\        4      '       d   VP                  V! V	4      4       K  \        V	\        4      '       g   K  VP                  V! V	4      4       K   \        V4      pT P%                  T4       R #   \         d    \        RT	,          4      hi ; i  \         d    \         P#                  T4       h i ; i)Nz@T2CharString or Subr has items on the stack after last operator.c              3   s8   "   T F  p\        V4      x  K  	  R # 5ir-   )r   )Z.0r1   r   r   Z	<genexpr>Z'T2CharString.compile.<locals>.<genexpr>  s     #G1GAJJs   zillegal operator: %srR   )returnendcharhintmaskcntrmask)rK  opcodesr~   r;   strr[   rG   rQ  r:   extendr   rV   rT   r0   r   	TypeErrorrB   ZerrorsetBytecode)
r   ZisCFF2r`  r~   rK  rF   rK   rY   endr   r   r   compileZT2CharString.compile  s   ==$,,,,72;*??!#2,ZS99(R  &&(	**,'lgJEAA%%%QOO#G#GG 44OOGJ/AA 5 E3''	% 01E5))E 23	 *H 	"!   Q01G%1OPPQ  	IIh	s   F" G "G "G%c                s    V P                   R J# r-   )rK  rs   rt   r   rx   ZT2CharString.needsDecompilation  s    }}D((r   c                     Wn         R V n        R # r-   )r~   rK  )r   r~   r   r   r|   ZT2CharString.setProgram  s    r   c                rg  r-   rK  r~   )r   rK  r   r   rd  ZT2CharString.setBytecode  s     r   c                sp   V P                   ee   W! V P                   4      8  d   R# V! V P                   V,          4      pV^,           pV P                  V,          pV! WV P                   V4      w  rqM4W! V P                  4      8  d   R# V P                  V,          pV^,           pV! V\        4      pWxV3# )N)Nr3   r3   )rK  operandEncodingr~   ra  )	r   r   r:   r   r;   r   r   r   r   s	   &&&&&    r   ry   ZT2CharString.getToken  s    ==$DMM**!!u-.BAIE**2.G"4T]]EBLE5DLL))!!LL'EAIEs+
%''r   c                s    V P                   e   W,           pV P                   W pTpWA3# V P                  V,          pV^,           pWA3# r-   rh  )r   r   ZnBytesZnewIndexZbytesrX  r   r   ZT2CharString.getBytes  sQ    ==$~HMM%1EE
 | LL'EAIE|r   c                s    V# r-   r   )r   r   r   r   r   ZT2CharString.handle_operator  s    r   c                s   ^ RI Hp V P                  e   VP                  V P                  4       R# ^ p. p V P	                  V4      w  rgpVf   MV'       d   VR9   df   V P	                  V4      w  rp. p	V F$  p
V	P                  V! \        V
4      ^4      4       K&  	  \        V	4      pRP                  WVV.,           4      pMRP                  WV.,           4      pVP                  V4       VP                  4        . pK  \        V\        4      '       d   \        V^R7      pM\        V4      pVP                  V4       EK  V'       d%   RP                  V4      pVP                  V4       R# R# )r3   )
num2binaryNZ r+   r]  )fontTools.misc.textToolsrj  rK  Zdumphexry   rV   r   r   ZjoinZwriteZnewliner;   r0   r   ra  )r   Z	xmlWriterZttFontrj  r   r   r   r   ZhintMaskZbitsZbyteZlines   &&&         r   toXMLZT2CharString.toXML  s-   7==$dmm,ED+/==+?(5= 886:mmE6J3e!$,D KK
74=!(DE %-#*4="xxx/@(@A"xxw7OOD)%%'D!%// 1%r J #E
KK& xx~% r   c                s   ^ RI HpHp VP                  R4      '       d   V P	                  V! V4      4       R# \        V4      pVP                  4       p. p\        V4      p^ pW8  d1   W8,          p	V^,           p \        V	4      p	VP                  V	4       K6  V P                  V4       R#   \         d     \        T	^R7      p	TP                  T	4        Kv    \         d    TP                  T	4       T	R9   dg   Y8,          p
Rp\        ^ \        T
4      ^4       F$  pT\        T! YT^,            4      4      ,           pK&  	  TP                  T4       T^,           p  K    EK  i ; ii ; i)r3   )
binary2numreadHexZrawNr+   r   r]  )rk  rm  rn  getrd  r   rU   r:   rT   rV   Z
ValueErrorr   rX   r   r|   )r   nameZattrsZcontentrm  rn  r~   re  rY   r   ZmaskZ	maskBytesZjs   &&&&         r   fromXMLZT2CharString.fromXML"  sA   @99UWW-.'"--/'lgJEAA&E
  u% !  **-e2FE NN5) " "NN5) 88&z$'	!&q#d)Q!7A(1GJtPQTUPU<W4X(XI "8y1E 9"*s7   ;B, ,E,8CE,BE(E,"E,'E((E,)rL  rK  re   rg   r~   r   )NNNNr-   )F)$r\   r]   r^   r_   t2OperandEncodingri  r>   t2Operatorsr
   r`  ra   rS  r   rV  rk   r   rN  rG   rQ  rU  rY  rZ  rf  rx   r|   rd  r:   r   r;   ry   r   r   rl  rq  r`   r   r   r   r   rJ  rJ  i  s     'O*;7Iw(O)!3Q!% 
*#X) #&w: ( 	$&L !  !r   rJ  c                   sh   a a ] tR tRt o]t]! ]4      w  tt	RV 3R llt
R tR tR tR tRtVtV ;t# )	T1CharStringiE  c                s2   < \         SV `  W4       W0n        R # r-   )r   rk   r6  )r   rK  r~   r6  r   s   &&&&r   rk   ZT1CharString.__init__I  s    +
r   c                rO  r-   )encodeIntT1rs   rt   r   rG   ZT1CharString.getIntEncoderM  rP  r   c                s    R  pR# )c                 s    \        R 4      h)z8Type 1 charstrings don't support floating point operands)rc  )r   rt   r   rK   Z1T1CharString.getFixedEncoder.<locals>.encodeFixedQ  s    VWWr   Nr   )r   rK   r   r   rQ  ZT1CharString.getFixedEncoderP  s    	Xr   c                s    V P                   f   R # . p^ p V P                  V4      w  r4pVf   MVP                  V4       K-  V P                  V4       R # r-   )rK  ry   rV   r|   )r   r~   r   r   r   s   &    r   rU  ZT1CharString.decompileT  sO    == '+}}U';$Eu}NN5! r   c                st    \        WP                  4      pVP                  V 4       VP                  V n        R # r-   )r5  r6  r   r   )r   r   rW  rJ   r   rY  ZT1CharString.draw`  s)    &sJJ7	$__
r   )r6  r   )NNN)r\   r]   r^   r_   t1OperandEncodingri  r>   t1Operatorsr
   r`  rk   rG   rQ  rU  rY  r`   r   r   r   r   r   rt  rt  E  s8     'O*;7IwX
!% %r   rt  c                   sp   a  ] tR tRt o ]tRR ltR tR tR t	R t
R tR	 tR
 tR tR tR tR tRtV tR# )DictDecompilerif  Nc                s:    . V n         Wn        / V n        W n        R # r-   )r   stringsdictparent)r   ry  r{  r7  r   rk   ZDictDecompiler.__init__i  s    
	r   c                s    V P                   # r-   )rz  rs   rt   r   getDictZDictDecompiler.getDicto  s    yyr   c                s    ^ p\        V4      pV P                  P                  pW#8  dI   \        W,          4      pV^,           pV P                  V,          pV! WW4      w  rrVf   KD  V! V4       KN  R# rl   )r:   r   rV   r   ri  )r   r   r   ZlenDatar   r   r   r   s   &&      r   rU  ZDictDecompiler.decompiles  si    d)zz  o%BAIE**2.G"4T9LE U r   c                r   r   r   r   r   r   r   ZDictDecompiler.pop  s    

2JJrNr   c                sF    V P                   R ,          pV P                   R  V# r   r}  r   r   r   r{   ZDictDecompiler.popall  s    zz!}JJqMr   c                sx   Vw  r\        V\        4      '       dS   Rp\        \        V4      ^,
          RR4       F.  pW$,          p\	        V RV,           4      pV! V4      3V,           pK0  	  M\	        V RV,           4      pV! V4      pVR8X  d   V P
                  P                  V4       R# W0P                  V&   R# )r9   Zarg_blendNr   rR   )r;   r<   rX   r:   rz   r   rb  rz  )r   r   ZargTyper   rY   r0  Z
arghandlerr4  r   r   ZDictDecompiler.handle_operator  s    $gu%%E3w<!+R4j$T6C<8
#H-/%7 5
 !v'78Jx(EwJJe$"'IIhr   c                s    \        V P                  ^ ,          \        4      '       d   V P                  V P                  4      pV# V P	                  4       pV# r   )r;   r   listarg_blend_numberr   )r   rp  outrJ   r   
arg_numberZDictDecompiler.arg_number  sD    djjmT**''

3C 
 ((*C
r   c                s    . pV P                  4       p\        V4      pVP                  V4       VP                  R 4       V P                  4       pV# )r~  )r   r:   rV   r{   )r   rp  r  Z	blendArgs
numMastersZdummyr/  r   r  ZDictDecompiler.arg_blend_number  sD    HHJ	^


9

7r   c                sD    V P                   V P                  4       ,          # r-   )ry  r   r   rp  r   r   arg_SIDZDictDecompiler.arg_SID  s    ||DHHJ''r   c                r:  r-   r;  r  r   r   	arg_arrayZDictDecompiler.arg_array  r<  r   c                s   V P                   P                  R^ 4      pV P                  P                  V4      ^,           pV P	                  4       pV P                  4       p\        V4      pR.V,          pV^,
          p^ p	^ p
W8  dB   WY,          V
,           pTp
WIV,          ,           pV.W\W,            ,           pWV	&   V	^,          p	KG  V# )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.
rM  N)rz  ro  r{  r   r   r{   r:   )r   rp  rM  r  r   r   ZnumArgsr   Z	numDeltasrY   ZprevValZnewValZmasterOffsetZ	blendListr)  r   arg_blendListZDictDecompiler.arg_blendList  s     ))--	1-KK%%g.2 	 HHJ	{{}d) "N	mWw&FG$I6L4|7O#PPI !HFAr   c                s    V P                  4       p. pV'       d"   \        V^ ,          \        4      '       d   TpV# ^ pV F  pWE,           pVP                  V4       K  	  V# r   )r{   r;   r  rV   )r   rp  Z	valueListr  Zcurrentvr/  r   	arg_deltaZDictDecompiler.arg_delta  s\    KKM	IaL$77C 
	 G!+

7#  
r   )rz  r{  r   ry  r-   )r\   r]   r^   r_   cffDictOperandEncodingri  rk   r|  rU  r   r{   r   r  r  r  r  r  r  r`   r   r   r   r   rx  rx  f  sL     ,O


( ( D r   rx  c                 sL    \        V 4      pVR 8  d   ^kpV# VR8  d   RpV# RpV# )i  il  rA   i   )r:   )r6  ZnSubrsZbiasrT  r   rc   rc     s?    ZF}
 K	 
% K Kr   )rN   Z1Z2Z3Z4Z5Z6Z7Z8Z9rO   rP   rQ   NrM   r9   ZhstemrL   Zvstemr2  Zvmoveto   Zrlineto   Zhlinetor   Zvlineto   Z	rrcurveto
   Zcallsubr   r[     r\  )   rM  )   r~  )   Zhstemhm)i   r^  )   r_     Zrmoveto   Zhmoveto)   Zvstemhm)   Z
rcurveline)i   Z
rlinecurve)   Z	vvcurveto)   Z	hhcurveto)   Z	callgsubr   Z	vhcurvetoi   Z	hvcurveto)r	   r3   Zignore))r	   rL   Zand))r	   r2  Zor))r	   r  Znot))r	   r  Zstore))r	   	   r-  ))r	   r  Zadd))r	   r  Zsub)r	   r	   Zdiv))r	      Zload))r	   r  Zneg))r	   r  Zeq))r	   r  Zdrop))r	   r  Zput))r	   r  ro  ))r	   r  Zifelse))r	   r  Zrandom))r	   r  Zmul))r	   r  Zsqrt))r	   r  Zdup))r	   i   r=  ))r	   r  r   ))r	   r  Zroll))r	   i"   Zhflex))r	   i#   Zflex))r	   i$   Zhflex1))r	   i%   Zflex1)r  r  r  r  r  r  r  )r  Z	closepathr  r  )r  Zhsbwr  r  r  r  r  )r  Z
dotsection))r	   r9   Zvstem3))r	   r7   Zhstem3))r	   r  Zseac))r	   r   Zsbwr  ))r	   r  Zcallothersubr))r	   i   r   ))r	   i!   Zsetcurrentpoint)9Z__doc__ZfontTools.misc.fixedToolsr    r   r   r   rk  r   r   r   r   ZfontTools.pens.boundsPenr   r$   ZloggingZ	getLoggerr\   rB   r   r   r   r!   r'   r*   r,   r.   r2   rv  rr  r  r/   Z	enumeraterW   Z
maxOpStackr>   rs  rG   ZencodeIntCFFru  rH   rD   rK   rS   rZ   Z	Exceptionr[   Zobjectra   rw  r   r   r   r5  rJ  rt  rx  rc   )rY   r  s   00r   <module>r     sh    J I .   !2
3


<
!
   FSL -0 $ %)4 & 'N+;; ' 'N+;; ' % #  &a( % " ' # *1- ) r , r + s " %.k$:;$:DA14$:;
88 8 	8
 8 8 8 8 8 8 8 8 8 8 8  !8" #8$ %8& '8( )8* +8, -8. /82 384 586 788 98< =8> ?8@ A8B C8D E8F G8H I8J K8L M8N O8P Q8R S8T U8V W8X Y8Z [8\ ]8^ _8` a8b c8d e8f g8h i8j k8l m8n o8v1h U#D!D!  + gcl*1h	Y 	G9 G9T<, 0) 0fa) aHV+ VrY!6 Y!x%< %BvV vrQ+ <s   H