+
    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&   ]]^&   ]! ]4      R8X  g   Q h]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(]PR                  3R lt*]! ^4      ]! ^4      ,           t+R t, ! R R]-4      t. ! R R]/4      t0. RcOt1 ! R R ]04      t2 ! R! R"]04      t3 ! R# R$]34      t4 ! R% R&]44      t5 ! R' R(]/4      t6 ! R) R*]64      t7 ! R+ R,]/4      t8R- t9R# 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.    \         '       g   Q h\        V3# N)NotImplementedErrorZ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_realNumberr3   D   sv    F
DK 	t8/d(c>+g..c>+g..=%r   r   :        N:r5   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V R8X  g   Q h\        ^4      pRpV\         \        P                  \        P                  V3R lpV# )cfft1Nt2c                 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$   rE   r%   )ZformatrF   rD   rG   r=   r   getIntEncoderrH      sq    BK	R[
	4	S\
~~BK	
 [[}}#J r   r?   r@   rA   c                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)frE   r      && r   encodeFixedrL      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)rJ   ZsZsignificantDigitsZdotIndexZeIndexZintegerPartZfractionalPartZexponentZnewExponentZsignZnibblesZcZc2Zdis   &              r   encodeFloatr[     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   rc   rf   rh   ri      &&&&&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# r4   N)callingStackoperandStack	hintCounthintMaskBytes
numRegionsvsIndexr      &r   rj   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   )xru   r   Z<lambda>Z,SimpleT2Decompiler.execute.<locals>.<lambda>\  s    dr   NZop_rS   )rn   rW   needsDecompilationro   getTokengetattrpopall
setProgram)r   
charStringrv   ry   programZpushToProgramr   token
isOperatorZhandlerNamehandlerZrvrq   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   rS   ro   r   r      & r   popZSimpleT2Decompiler.popu  s%    !!"%b!r   c                sJ    V P                   R ,          p. V P                   R &   V# r6   r   r   stackr   r   r|   ZSimpleT2Decompiler.popallz  s'    !!!$!!r   c                s<    V P                   P                  V4       R # r-   )ro   rW   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                rw   r-   r   r   r   r   
op_endcharZSimpleT2Decompiler.op_endchar      r   c                rw   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   rc   re   r   r   r   	subrIndexZsubr   &&  r   op_callsubrZSimpleT2Decompiler.op_callsubr  s.    HHJ	y>>9:Tr   c                r   r-   )r   rf   rg   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# )   rS   )rq   r   rp   rn   getBytes)r   r   rq   rK   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|   rp   r:   r   argsr   r   r   ZSimpleT2Decompiler.countHints  s%    {{}#d)q.8r   c                    \         hr-   r.   r   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# rm   )rr   rh   getNumRegionsr   ri   ro   r:   rs   )
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   rs   rh   r   rr   )r   r   ZvirK   r   
op_vsindexZSimpleT2Decompiler.op_vsindex  s(    XXZ,,44R8r   )ri   rn   rg   rf   rp   rq   re   rc   rr   ro   rh   rs   NN)0r]   r^   r_   r`   rl   rj   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   ra   __classdictcell____classdict__   @r   rb   rb   C  s     " "@

(

$ K9
"""""""""""""""""""""".*9 9r   rb   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# )r4   c                 s|   < SP                   P                  V 4       \        S\        SP                   4      4      oR # r-   )ro   rW   Zmaxr:   )r   maxStackUser   s   &r   rv   Z0T2StackUseExtractor.execute.<locals>.pushToStack0  s.    $$U+k3t/@/@+ABKr   )rv   )superr   )r   r~   rv   r   	__class__s   f& @r   r   ZT2StackUseExtractor.execute-  s$    	C
 	
<r   r   )r]   r^   r_   r`   r   ra   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-   )rb   rl   nominalWidthXdefaultWidthX)r   rc   rf   r   r   rh   ri   s   &&&&&&&r   rl   ZT2WidthExtractor.__init__:  s"     	##DkGT**r   c                sL    \         P                  V 4       ^ V n        ^ V n        R# rm   )rb   rj   gotWidthwidthrt   ru   r   rj   ZT2WidthExtractor.resetG  s      &
r   c                s4   V P                  4       pV P                  '       gv   V\        V4      ^,          ,          '       d?   V P                  f   Q R4       hV P                  V^ ,          ,           V n        VR,          pMV P                  V n        ^V n        V# )r7   z5CFF2 CharStrings must not have an initial width valuer8   )r|   r   r:   r   r   r   )r   evenOddr   rK   r   popallWidthZT2WidthExtractor.popallWidthL  s    {{}}}}#d)a-(( &&2KJK2!//$q'9
Bx!//
DMr   c                r   r   )r   rp   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   rp   r   r   r   r4   )r]   r^   r_   r`   rl   rj   r   r   r   r   r   r   ra   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# rm   )r   rl   pen	subrLevel)r   r   rc   rf   r   r   rh   ri   s   &&&&&&&&r   rl   ZT2OutlineExtractor.__init__m  s5     	!!	
 r   c                sZ    \         P                  V 4       RV n        ^ V n        ^ V n        R# r4   N)r4   r4   )r   rj   currentPoint	sawMoveTor   rt   ru   r   rj   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   pointrx   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# rm   )r   r   	closePathrt   ru   r   r   ZT2OutlineExtractor.closePath  s"    >>>HH r   c                sN    V P                   '       d   V P                  4        R # R # r-   )r   r   rt   ru   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# rm   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# )r4   StandardEncodingNr9   r4   r4   r9   r4   r4   )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# rm   )r|   rY   r:   r   )r   r   r   rZ   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# rm   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|   rY   r:   r   )
r   r   r   rZ   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|   rY   r:   r   r   )
r   r   r   rZ   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|   rY   r:   r   r   )r   r   r   ZlineArgsrZ   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:   rY   r   )	r   r   r   dx1rZ   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   dy1rZ   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   rK   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  rK   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# rm   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# rm   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# rm   )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:r3  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# r2  r4  )r   r   r  r  r	  r  r
  r5  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`   rl   rj   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  ra   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   subrsrj   )r   r   r7     &&&r   rl   ZT1OutlineExtractor.__init__  s    


r   c                sZ    ^ V n         ^ V n        ^ V n        \        P	                  V 4       R# rm   )flexingr   sbxr   rj   rt   ru   r   rj   ZT1OutlineExtractor.reset  s%    
  &r   c                r   rm   )r   r   r   rt   ru   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  rS   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-   )r9  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# rm   )r9  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# rm   )r9  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   rx   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   r:  r   )r   r   r:  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   r7  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# rm   )r   doFlexr9  )r   r   r   ZnArgsr   r   op_callothersubrZ#T1OutlineExtractor.op_callothersubr  sP    HHJ	
>eqjKKMDL!^
DL !+^r   c                rw   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   rD  ZT1OutlineExtractor.doFlex*  s   
hhjhhj



hhjhhj



hhjhhj 			%#+		%+		%		%		#		#$ 			%		%		%		%		#		#$ 			&		&r   c                r   r-   r<  r   r   r   op_dotsectionZ T1OutlineExtractor.op_dotsectionT  rC  r   c                r   r-   r<  r   r   r   	op_hstem3ZT1OutlineExtractor.op_hstem3W  rC  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   r:  )
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  rC  r   )r   r9  r   r   r:  r7  r   Nr   )r]   r^   r_   r`   rl   rj   r   r   r>  r   r   r   r?  r@  r   rA  rB  r   rE  rF  rD  rG  rH  rI  rJ  ra   r   r   r   r   r6  r6    su     
'
4$,,!
6
(T	C r   r6  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   rh   rf   _cur_vsindex)r   rL  r   rh   rf   rk   r   rl   ZT2CharString.__init__o  s2    ?G *5*A;r r   c                s    V P                   pVf   Q hVe   Wn        M3V P                  f&   \        VR4      '       d   VP                  M^ V n        VP	                  V P                  4      # )Nvsindex)rh   rM  ZhasattrrN  r   )r   rN  ZpdrK   r   r   ZT2CharString.getNumRegionsx  s^    \\~~ '&.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>)rL  r   r]   Zidrt   ru   r   __repr__ZT2CharString.__repr__  sH    == (DNN,C,CRX+NNN*dnn.E.Er$x-PPPr   c                    \         # r-   )rI   rt   ru   r   rH   ZT2CharString.getIntEncoder      r   c                rP  r-   )rL   rt   ru   r   getFixedEncoderZT2CharString.getFixedEncoder  rQ  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)ry   r{   rh   decompilerClassrf   r   )r   r7  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# )rS  N)r{   rh   outlineExtractorrf   r   r   r   r   )r   r   ri   r7  	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   rZ  Zbounds)r   ZglyphSetZ	boundsPenrK   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      '       d   VP                  V! V	4      4       K  Q R\        T	4      ,          4       h \        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.0r2   r   r   Z	<genexpr>Z'T2CharString.compile.<locals>.<genexpr>  s     #G1GAJJs   zillegal operator: %szunsupported type: %srS   )returnendcharhintmaskcntrmask)rL  opcodesr   r;   strr\   rH   rR  r:   extendr   rW   rU   r1   Ztyper   	TypeErrorrC   ZerrorsetBytecode)
r   ZisCFF2ra  r   rL  rG   rL   rZ   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>04;>>q	 *H 	"!   Q01G%1OPPQ  	IIh	s   F7 G 7G"G:c                s    V P                   R J# r-   )rL  rt   ru   r   ry   ZT2CharString.needsDecompilation  s    }}D((r   c                     Wn         R V n        R # r-   )r   rL  )r   r   r   r   r}   ZT2CharString.setProgram  s    r   c                rh  r-   )rL  r   )r   rL  r   r   re  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)Nr4   r4   )rL  operandEncodingr   rb  )	r   r   r:   r   r;   r   r   r   r   s	   &&&&&    r   rz   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MV P                  V,          pV^,           p\        V4      V8X  g   Q hWA3# r-   )rL  r   r:   )r   r   ZnBytesZnewIndexZbytesrY  r   r   ZT2CharString.getBytes  sW    ==$~HMM%1EELL'EAIE5zV###|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# )r4   )
num2binaryNZ r+   r^  )fontTools.misc.textToolsrj  rL  Zdumphexrz   rW   r   r   ZjoinZwriteZnewliner;   r1   r   rb  )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)r4   )
binary2numreadHexZrawNr+   r   r^  )rk  rm  rn  getre  r   rV   r:   rU   rW   Z
ValueErrorr   rY   r   r}   )r   nameZattrsZcontentrm  rn  r   rf  rZ   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,)rM  rL  rf   rh   r   r   )NNNNr-   )F)$r]   r^   r_   r`   t2OperandEncodingri  r>   t2Operatorsr
   ra  rb   rT  r   rW  rl   r   rO  rH   rR  rV  rZ  r[  rg  ry   r}   re  r:   r   r;   rz   r   r   rl  rq  ra   r   r   r   r   rK  rK  i  s     'O*;7Iw(O)!3Q!% 
*#X) #&w: ( 	$&L !  !r   rK  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   rl   r7  )r   rL  r   r7  r   s   &&&&r   rl   ZT1CharString.__init__I  s    +
r   c                rP  r-   )encodeIntT1rt   ru   r   rH   ZT1CharString.getIntEncoderM  rQ  r   c                s    R  pR# )c                 s    \        R 4      h)z8Type 1 charstrings don't support floating point operands)rd  )r   ru   r   rL   Z1T1CharString.getFixedEncoder.<locals>.encodeFixedQ  s    VWWr   Nr   )r   rL   r   r   rR  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-   )rL  rz   rW   r}   )r   r   r   r   r   s   &    r   rV  ZT1CharString.decompileT  sO    == '+}}U';$Eu}NN5! r   c                st    \        WP                  4      pVP                  V 4       VP                  V n        R # r-   )r6  r7  r   r   )r   r   rX  rK   r   rZ  ZT1CharString.draw`  s)    &sJJ7	$__
r   )r7  r   )NNN)r]   r^   r_   r`   t1OperandEncodingri  r>   t1Operatorsr
   ra  rl   rH   rR  rV  rZ  ra   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{  r8  r   rl   ZDictDecompiler.__init__i  s    
	r   c                s\    \        V P                  4      ^ 8X  g   Q R4       hV P                  # )r4   znon-empty stack)r:   r   rz  rt   ru   r   getDictZDictDecompiler.getDicto  s(    4::!#6%66#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# rm   )r:   r   rW   r   ri  )r   r   r   ZlenDatar   r   r   r   s   &&      r   rV  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   rS   )r;   r<   rY   r:   r{   r   rc  rz  )r   r   ZargTyper   rZ   r1  Z
arghandlerr5  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  outrK   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:   rW   r|   )r   rp  r  Z	blendArgs
numMastersZdummyr0  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WcV,          8X  g   Q h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.
rN  N)rz  ro  r{  r   r   r|   r:   )r   rp  rN  r  r   r   ZnumArgsr   Z	numDeltasrZ   ZprevValZnewValZmasterOffsetZ	blendListr*  r   arg_blendListZDictDecompiler.arg_blendList  s     ))--	1-KK%%g.2 	 HHJ	{{}d)y0000"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  rW   )r   rp  Z	valueListr  Zcurrentvr0  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  rl   r|  rV  r   r|   r   r  r  r  r  r  r  ra   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  rB   i   )r:   )r7  ZnSubrsZbiasrU  r   rd   rd     s?    ZF}
 K	 
% K Kr   )rO   Z1Z2Z3Z4Z5Z6Z7Z8Z9rP   rQ   rR   NrN   r9   ZhstemrM   Zvstemr3  Zvmoveto   Zrlineto   Zhlinetor   Zvlineto   Z	rrcurveto
   Zcallsubr   r\     r]  )   rN  )   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	   r4   Zignore))r	   rM   Zand))r	   r3  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):Z__doc__ZfontTools.misc.fixedToolsr    r   r   r   rk  r   r   r   r   ZfontTools.pens.boundsPenr   r$   ZloggingZ	getLoggerr]   rC   r   r   r   r!   r'   r*   r,   r/   r3   rv  r:   rr  r  r0   Z	enumeraterX   Z
maxOpStackr>   rs  rH   ZencodeIntCFFru  rI   rE   rL   rT   r[   Z	Exceptionr\   Zobjectrb   rw  r   r   r   r6  rK  rt  rx  rd   )rZ   r  s   00r   <module>r     sz    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