
    h                     
   S r SSKJrJrJrJr  SSKJrJrJ	r	J
r
  SSKJr  SSKrSSKr\R                  " \5      rS rS rS rS	 rS
 rS rS rS rS rS/S-  rS\/-  \SS& S\/-  \SS& S\/-  \SS& S\/-  \SS& \\S'   \" \5      S:X  d   e\SS r\\S'   \\S'   \SS r\\S'   \\S'   \\S'   / SQr\ " \5       V Vs0 s H  u  pX_M	     snn r!Sr"S r#/ SQr$S r%\%" S5      r&\%" S5      r'\%" S 5      r(\RR                  4S! jr*\" S5      \" S"5      -   r+S# r, " S$ S%\-5      r. " S& S'\/5      r0/ S(Qr1 " S) S*\05      r2 " S+ S,\25      r3 " S- S.\35      r4 " S/ S0\/5      r5 " S1 S2\55      r6 " S3 S4\/5      r7S5 r8gs  snn f )6zwpsCharStrings.py -- module implementing various kinds of CharStrings:
CFF dictionary data and Type1/Type2 CharStrings.
    )fixedToFloatfloatToFixedfloatToFixedToStrstrToFixedToFloat)bytechrbyteord	bytesjoinstrjoin)	BoundsPenNc                     US:X  a  U[        X#   5      4nUS-   nOUn U R                  U   nU R                  U5      nXc4$ ! [         a    S U4s $ f = f)N      )r   	operatorsKeyErrorhandle_operator)selfb0dataindexopoperatorvalues          N/var/www/html/env/lib/python3.13/site-packages/fontTools/misc/psCharStrings.pyread_operatorr      sp    	Rx'$+&'	>>"%   *E<  U{s   A AAc                     US-
  U4$ )N    r   r   r   r   s       r   	read_byter   "   s    8U?    c                 B    [        X#   5      nUS-
  S-  U-   S-   US-   4$ )N      l   r   r   r   r   r   r   b1s        r   read_smallInt1r(   &   s0    		BHb 3&	11r    c                 D    [        X#   5      nUS-
  * S-  U-
  S-
  US-   4$ )N   r#   r$   r   r%   r&   s        r   read_smallInt2r+   +   s2    		B#X;r!C'22r    c                 J    [         R                  " SX#US-    5      u  nXCS-   4$ )N>h   structunpackr   r   r   r   r   s        r   read_shortIntr3   0   *    }}T4	#:;HU!)r    c                 J    [         R                  " SX#US-    5      u  nXCS-   4$ )N>l   r/   r2   s        r   read_longIntr8   5   r4   r    c                 \    [         R                  " SX#US-    5      u  n[        USS9US-   4$ )Nr6   r7      precisionBits)r0   r1   r   r2   s        r   read_fixed1616r=   :   s3    }}T4	#:;HUR0%!);;r    c                 ,    [         (       d   e[        U4$ N)NotImplementedErrorNotImplementedr   s       r   read_reservedrB   ?   s    5  r    c                     Sn [        X#   5      nUS-   nUS-  S-	  nUS-  nUS:X  a  O!U[        U   -   nUS:X  a  OU[        U   -   nMG  [        U5      U4$ )N r      r7      )r   realNibblesfloat)r   r   r   r   numberbnibble0nibble1s           r   read_realNumberrM   D   s}    F
DK 	t8/d(c>+g..c>+g..  =%r    r#          r"   r7   r*               )0123456789.EE-N-   c                     0 n0 nU  HV  n[        U5      S:X  a  US   XS   '   O
USS  XS   '   [        US   [        5      (       a  US   X#S   '   MK  US   4X#S   '   MX     X4$ )Nr.   r   r   )len
isinstancetuple)operatorListoperopcitems       r   buildOperatorDictrk   |   s|    D
Ct9> GDaM HDaMd1gu%%7CQL G:CQL  9r    )4r   hstem   vstemr7   vmoveto   rlineto   hlineto   vlineto   	rrcurveto
   callsubr   return   endchar)rF   vsindex)r:   blend)   hstemhm)   hintmask)   cntrmask   rmoveto   hmoveto)   vstemhm)   
rcurveline)   
rlinecurve)   	vvcurveto)   	hhcurveto)rR   	callgsubrrS   	vhcurveto   	hvcurveto)r   r   ignore))r   ro   and))r   r7   or))r   rt   not))r   r}   store))r   	   abs))r   r   add))r   r   sub)r   r   div))r      load))r   r   neg))r   rF   eq))r   r   drop))r   r   put))r   r   get))r   r   ifelse))r   r   random))r   r   mul))r   r   sqrt))r   r   dup))r   rQ   exch))r   rR   r   ))r   rS   roll))r   "   hflex))r   #   flex))r   $   hflex1))r   %   flex1c                     U S:X  a  [        S5      n[        S5      nO)U S:X  a  S n[        S5      nOU S:X  d   e[        S5      nS nU[         [        R                  [        R                  U4S jnU$ )NcffrQ   rR   t1rP   t2c                    SU s=::  a  S::  a  O  OU" U S-   5      nU$ SU s=::  a  S::  a$  O  O!U S-
  n U" U S-	  S-   5      U" U S-  5      -   nU$ S	U s=::  a  S
::  a%  O  O"U * S-
  n U" U S-	  S-   5      U" U S-  5      -   nU$ Ub  SU s=::  a  S::  a  O  OXS" SU 5      -   nU$ Uc)  [         R                  S5        U" S5      U" SU 5      -   nU$ X" SU 5      -   nU$ )Nik   r   r$   k  r}   r"   rP   iir*   i i  r-   zk4-byte T2 number got passed to the IntType handler. This should happen only when reading in old XML files.
r6   )logwarning)r   
fourByteOpr   packr1   	twoByteOpcodes          r   	encodeInt 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   r0   r   r1   )formatr   r   r   s       r   getIntEncoderr      sq    BK	R[
	4	S\
~~BK	
 [[}}#J r    r   r   r   c                 \    [        U SS9nUS-  S:X  a  [        US-	  5      $ SU" SU5      -   $ )zFor T2 onlyr:   r;   i  r      r6   )r   encodeIntT2)fr   r   s      r   encodeFixedr      s;    "-Ev~5B;''dE***r    rF   c                 8   U S:X  a  [         $ SU -  nUS S S:X  a  USS  nOUS S S:X  a	  SUSS  -   nOUR                  S	5      (       a.  UR                  S
5      nSU[        U5      [        U5      -
  4-  nOoUR	                  S5      nUR	                  S5      nUS:w  aG  US:w  aA  US U nXS-   U n[        XS-   S  5      nU[        U5      -
  nUS:X  a
  U< U< S
3nOSXVU4-  nUR                  S5      (       a3  UR                  SS5      u  pSXR                  S
5      [        U5      4-  n/ n
U(       aj  US   nUSS  nUS:X  a9  US S nUS:X  a  USS  nSnOUS:X  a  USS  nUR                  S
5      (       a  USS  nU
R                  [        U   5        U(       a  Mj  U
R                  S5        [        U
5      S-  (       a  U
R                  S5        [        S5      n[        S[        U
5      S5       H  nU[        X   S-  XS-      -  5      -   nM      U$ )Ng        z%.8Gr.   z0.r   ro   z-0.ra   000rT   z%sE%dr^   r_   z%s%sE%d)z.0z-.0z%s%sE-%dr   r`   +rF   rS   r7   )realZeroBytesendswithrstriprd   findint
startswithsplitlstripappendrealNibblesDictr   range)r   ssignificantDigitsdotIndexeIndexintegerPartfractionalPartexponentnewExponentsignnibblescc2dis                  r   encodeFloatr     s;   Cx 	
A!u}abE	
2A%!AB%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abE82ABSyabEsabE||C  abEq)* ! NN3
7|asA1c'lA&
a'a%.899 'Hr    c                       \ rS rSrSrg)CharStringCompileErrori?  r   N)__name__
__module____qualname____firstlineno____static_attributes__r   r    r   r   r   ?  s    r    r   c                      \ rS rSrS-S jrS rS rS rS rS r	S	 r
S
 rS rS rS rS rS rS rS rS r\rS rS rS rS rS rS rS rS rS rS rS rS r S r!S  r"S! r#S" r$S# r%S$ r&S% r'S& r(S' r)S( r*S) r+S* r,S+ r-S,r.g).SimpleT2DecompileriC  Nc                     Xl         [        U5      U l        X l        [        U5      U l        X0l        X@l        U R                  5         g r?   )
localSubrscalcSubrBias	localBiasglobalSubrs
globalBiasprivateblenderreset)r   r  r	  r  r  s        r   __init__SimpleT2Decompiler.__init__D  s8    $%j1&&{3

r    c                 X    / U l         / U l        SU l        SU l        SU l        SU l        g Nr   )callingStackoperandStack	hintCounthintMaskBytes
numRegionsvsIndexr   s    r   r  SimpleT2Decompiler.resetM  s/    r    c                    U R                   R                  U5        UR                  5       nU(       a  / nUR                  nOS nU R                  R                  nSn UR	                  U5      u  pxnUc  OZU" U5        U(       aA  SU-   n	[        X	S 5      n
U
b  U
" U5      nU(       a  Uu  pU" U5        OU R                  5         OU" U5        Mr  U(       a  UR                  W5        U R                   S	 g )Nc                     g r?   r   )xs    r   <lambda>,SimpleT2Decompiler.execute.<locals>.<lambda>\  s    dr    r   op_r   )r  r   needsDecompilationr  getTokengetattrpopall
setProgram)r   
charStringr   programpushToProgrampushToStackr   token
isOperatorhandlerNamehandlerrvr  s                r   executeSimpleT2Decompiler.executeU  s      ,'::<G#NNM*M''..'1':':5'A$Eu}% #em!$T:& B/1,%m4KKME"! " !!'*b!r    c                 >    U R                   S   nU R                   S	 U$ Nr   r  r   r   s     r   popSimpleT2Decompiler.popt  s%    !!"%b!r    c                 B    U R                   S S  n/ U R                   S S & U$ r?   r2  r   stacks     r   r#  SimpleT2Decompiler.popally  s'    !!!$!!r    c                 :    U R                   R                  U5        g r?   )r  r   r3  s     r   pushSimpleT2Decompiler.push~  s      'r    c                 (    U R                   (       a  g g r?   r2  r   r   s     r   	op_returnSimpleT2Decompiler.op_return  s     r    c                     g r?   r   r>  s     r   
op_endcharSimpleT2Decompiler.op_endchar      r    c                     g r?   r   r>  s     r   	op_ignoreSimpleT2Decompiler.op_ignore  rD  r    c                 |    U R                  5       nU R                  X R                  -      nU R                  U5        g r?   )r4  r  r  r.  r   r   	subrIndexsubrs       r   op_callsubrSimpleT2Decompiler.op_callsubr  s.    HHJ	y>>9:Tr    c                 |    U R                  5       nU R                  X R                  -      nU R                  U5        g r?   )r4  r	  r
  r.  rI  s       r   op_callgsubrSimpleT2Decompiler.op_callgsubr  s0    HHJ		OO ;<Tr    c                 $    U R                  5         g r?   
countHintsr>  s     r   op_hstemSimpleT2Decompiler.op_hstem      r    c                 $    U R                  5         g r?   rR  r>  s     r   op_vstemSimpleT2Decompiler.op_vstem  rV  r    c                 $    U R                  5         g r?   rR  r>  s     r   
op_hstemhmSimpleT2Decompiler.op_hstemhm  rV  r    c                 $    U R                  5         g r?   rR  r>  s     r   
op_vstemhmSimpleT2Decompiler.op_vstemhm  rV  r    c                     U R                   (       d'  U R                  5         U R                  S-   S-  U l         U R                  S   R	                  XR                   5      u  p!X!4$ )Nrz   r}   r   )r  rS  r  r  getBytes)r   r   r  s      r   op_hintmaskSimpleT2Decompiler.op_hintmask  sX    !!OO"&..1"4!:D#004==eEWEWX##r    c                 d    U R                  5       nU R                  [        U5      S-  -   U l        g Nr.   )r#  r  rd   r   argss     r   rS  SimpleT2Decompiler.countHints  s%    {{}#d)q.8r    c                     [         er?   r@   r>  s     r   op_andSimpleT2Decompiler.op_and      !!r    c                     [         er?   rj  r>  s     r   op_orSimpleT2Decompiler.op_or  rm  r    c                     [         er?   rj  r>  s     r   op_notSimpleT2Decompiler.op_not  rm  r    c                     [         er?   rj  r>  s     r   op_storeSimpleT2Decompiler.op_store  rm  r    c                     [         er?   rj  r>  s     r   op_absSimpleT2Decompiler.op_abs  rm  r    c                     [         er?   rj  r>  s     r   op_addSimpleT2Decompiler.op_add  rm  r    c                     [         er?   rj  r>  s     r   op_subSimpleT2Decompiler.op_sub  rm  r    c                     [         er?   rj  r>  s     r   op_divSimpleT2Decompiler.op_div  rm  r    c                     [         er?   rj  r>  s     r   op_loadSimpleT2Decompiler.op_load  rm  r    c                     [         er?   rj  r>  s     r   op_negSimpleT2Decompiler.op_neg  rm  r    c                     [         er?   rj  r>  s     r   op_eqSimpleT2Decompiler.op_eq  rm  r    c                     [         er?   rj  r>  s     r   op_dropSimpleT2Decompiler.op_drop  rm  r    c                     [         er?   rj  r>  s     r   op_putSimpleT2Decompiler.op_put  rm  r    c                     [         er?   rj  r>  s     r   op_getSimpleT2Decompiler.op_get  rm  r    c                     [         er?   rj  r>  s     r   	op_ifelseSimpleT2Decompiler.op_ifelse  rm  r    c                     [         er?   rj  r>  s     r   	op_randomSimpleT2Decompiler.op_random  rm  r    c                     [         er?   rj  r>  s     r   op_mulSimpleT2Decompiler.op_mul  rm  r    c                     [         er?   rj  r>  s     r   op_sqrtSimpleT2Decompiler.op_sqrt  rm  r    c                     [         er?   rj  r>  s     r   op_dupSimpleT2Decompiler.op_dup  rm  r    c                     [         er?   rj  r>  s     r   op_exchSimpleT2Decompiler.op_exch  rm  r    c                     [         er?   rj  r>  s     r   op_indexSimpleT2Decompiler.op_index  rm  r    c                     [         er?   rj  r>  s     r   op_rollSimpleT2Decompiler.op_roll  rm  r    c                     U R                   S:X  a  U R                  R                  5       U l         U R                  5       nX R                   S-   -  nU R                  c  U R
                  X2-
  * S 2	 g [        U R
                  5      U-
  nXB-   =pVXE:  a]  X`R                   -   nU R
                  Xg nU R	                  U R                  U5      n	U R
                  U==   U	-  ss'   UnUS-  nXE:  a  M]  / U R
                  US & g Nr   r   )r  r  getNumRegionsr4  r  r  rd   r  )
r   r   	numBlendsnumOpsargiend_argstupleinext_tideltasdeltas
             r   op_blend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                 p    U R                  5       nX l        U R                  R                  U5      U l        g r?   )r4  r  r  r  r  )r   r   vis      r   
op_vsindexSimpleT2Decompiler.op_vsindex  s(    XXZ,,44R8r    )r  r  r
  r	  r  r  r  r  r  r  r  r  NN)/r   r   r   r  r  r  r.  r4  r#  r;  r?  rB  rF  rL  rO  rT  rX  r[  r^  rb  op_cntrmaskrS  rk  ro  rr  ru  rx  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  C  s    ">

(

$ K9
"""""""""""""""""""""".*9r    r  )rl   rn   rq   rs   rv   ry   r|   )r   	closepathr   r   )r   hsbwr   r   r   r   r   )r   
dotsection))r   r   vstem3))r   r.   hstem3))r   rw   seac))r   rz   sbwr   ))r   r:   callothersubr))r      r4  ))r   !   setcurrentpointc                   P    \ rS rSr  SS jrS rSS jrS rS rS r	S	 r
S
 rSrg)T2WidthExtractori*  Nc                 J    [         R                  XX%U5        X0l        X@l        g r?   )r  r  nominalWidthXdefaultWidthX)r   r  r	  r  r  r  r  s          r   r  T2WidthExtractor.__init__+  s"     	##DkGT**r    c                 J    [         R                  U 5        SU l        SU l        g r  )r  r  gotWidthwidthr  s    r   r  T2WidthExtractor.reset8  s      &
r    c                    U R                  5       nU R                  (       d_  U[        U5      S-  -  (       a1  U R                  c   S5       eU R                  US   -   U l        USS  nOU R                  U l        SU l        U$ )Nr.   z5CFF2 CharStrings must not have an initial width valuer   r   )r#  r  rd   r  r  r  )r   evenOddrg  s      r   popallWidthT2WidthExtractor.popallWidth=  s~    {{}}}#d)a-( &&2KJK2!//$q'9
ABx!//
DMr    c                 d    U R                  5       nU R                  [        U5      S-  -   U l        g re  )r  r  rd   rf  s     r   rS  T2WidthExtractor.countHintsL  s(    !#d)q.8r    c                 $    U R                  5         g r?   r  r>  s     r   
op_rmovetoT2WidthExtractor.op_rmovetoP      r    c                 &    U R                  S5        g Nr   r  r>  s     r   
op_hmovetoT2WidthExtractor.op_hmovetoS      r    c                 &    U R                  S5        g r  r  r>  s     r   
op_vmovetoT2WidthExtractor.op_vmovetoV  r  r    c                 $    U R                  5         g r?   r  r>  s     r   rB  T2WidthExtractor.op_endcharY  r  r    )r  r  r  r  r  r  r   )r   r   r   r  r  r  r  rS  r  r  r  rB  r  r   r    r   r  r  *  s2     +
9r    r  c                   b  ^  \ rS rSr  S7S jrS rU 4S jrS rS rS r	S r
S	 rS
 rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS r S r!S  r"S! r#S" r$S# r%S$ r&S% r'S& r(S' r)S( r*S) r+S* r,S+ r-S, r.S- r/S. r0S/ r1S0 r2S1 r3S2 r4S3 r5S4 r6S5 r7S6r8U =r9$ )8T2OutlineExtractori]  c           	      T    [         R                  U UUUUUU5        Xl        SU l        g r  )r  r  pen	subrLevel)r   r  r  r	  r  r  r  r  s           r   r  T2OutlineExtractor.__init__^  s5     	!!	
 r    c                 X    [         R                  U 5        SU l        SU l        SU l        g )Nr   r   r   )r  r  currentPoint	sawMoveTor  r  s    r   r  T2OutlineExtractor.resett  s&    t$"r    c                    > U =R                   S-  sl         [        TU ]	  U5        U =R                   S-  sl         U R                   S:X  a  U R                  5         g g Nr   r   )r  superr.  endPath)r   r%  	__class__s     r   r.  T2OutlineExtractor.executez  sE    !
#!>>QLLN r    c                 J    U R                   u  p#X!S   -   X1S   -   4nXl         U$ r  )r  )r   pointr  ys       r   
_nextPointT2OutlineExtractor._nextPoint  s0      !Ha(l*!r    c                 f    U R                   R                  U R                  U5      5        SU l        g r  )r  moveTor  r  r   r  s     r   rMoveToT2OutlineExtractor.rMoveTo  s"    ./r    c                     U R                   (       d  U R                  S5        U R                  R                  U R	                  U5      5        g Nr  )r  r  r  lineTor  r  s     r   rLineToT2OutlineExtractor.rLineTo  s.    ~~LL ./r    c                     U R                   (       d  U R                  S5        U R                  nU R                  R	                  U" U5      U" U5      U" U5      5        g r  )r  r  r  r  curveTo)r   pt1pt2pt3	nextPoints        r   rCurveToT2OutlineExtractor.rCurveTo  s@    ~~LL OO	333Hr    c                 h    U R                   (       a  U R                  R                  5         SU l         g r  )r  r  	closePathr  s    r   r  T2OutlineExtractor.closePath  s     >>HH r    c                 H    U R                   (       a  U R                  5         g g r?   )r  r  r  s    r   r  T2OutlineExtractor.endPath  s    
 >>NN r    c                 b    U R                  5         U R                  U R                  5       5        g r?   r  r  r  r>  s     r   r  T2OutlineExtractor.op_rmoveto  s     T%%'(r    c                 n    U R                  5         U R                  U R                  S5      S   S45        g r  r  r>  s     r   r  T2OutlineExtractor.op_hmoveto  s,    d&&q)!,a01r    c                 n    U R                  5         U R                  SU R                  S5      S   45        g r  r  r>  s     r   r  T2OutlineExtractor.op_vmoveto  s,    a))!,Q/01r    c           	          U R                  5         U R                  5       nU(       aQ  SSKJn  Uu  pEpgX6   nU R                  R                  US5        X7   n	U R                  R                  U	SSSSXE45        g g )Nr   StandardEncodingr   r   r   r   r   r   r   )r  r  $fontTools.encodings.StandardEncodingr!  r  addComponent)
r   r   rg  r!  adxadybcharachar	baseGlyphaccentGlyphs
             r   rB  T2OutlineExtractor.op_endchar  st    !M &*"Ce(/IHH!!)-?@*1KHH!!+1aC/EF r    c                     U R                  5       n[        S[        U5      S5       H  nX#US-    nU R                  U5        M     g )Nr   r.   )r#  r   rd   r	  )r   r   rg  r   r  s        r   
op_rlinetoT2OutlineExtractor.op_rlineto  s=    {{}q#d)Q'AQUOELL (r    c                 &    U R                  S5        g r  alternatingLinetor>  s     r   
op_hlinetoT2OutlineExtractor.op_hlineto      q!r    c                 &    U R                  S5        g r  r0  r>  s     r   
op_vlinetoT2OutlineExtractor.op_vlineto  r4  r    c                     U R                  5       n[        S[        U5      S5       H'  nX#US-    u  nnnnnn	U R                  XE4Xg4X45        M)     g)z${dxa dya dxb dyb dxc dyc}+ rrcurvetor   rw   N)r#  r   rd   r  )
r   r   rg  r   dxadyadxbdybdxcdycs
             r   op_rrcurvetoT2OutlineExtractor.op_rrcurveto  s^    {{}q#d)Q'A QMM3*sj3*= (r    c                     U R                  5       n[        S[        U5      S-
  S5       H$  nX#US-    u  pEpgpU R                  XE4Xg4X45        M&     U R	                  USS 5        g)z-{dxa dya dxb dyb dxc dyc}+ dxd dyd rcurveliner   r.   rw   N)r#  r   rd   r  r	  )
r   r   rg  r   r;  r<  r=  r>  dxddyds
             r   op_rcurveline T2OutlineExtractor.op_rcurveline  sf    {{}q#d)a-+A+/AE?(CcMM3*sj3*= , 	T"#Yr    c                     U R                  5       nUSS n[        S[        U5      S5       H  nU R                  X4US-    5        M     USS u  pVpxpU R	                  XV4Xx4X45        g)z-{dxa dya}+ dxb dyb dxc dyc dxd dyd rlinecurveNir   r.   )r#  r   rd   r	  r  )r   r   rg  lineArgsr   r;  r<  r=  r>  rC  rD  s              r   op_rlinecurve T2OutlineExtractor.op_rlinecurve  sl    {{}9q#h-+ALLa!e,- ,'+BCy$#Csj3*sj9r    c                     U R                  5       n[        U5      S-  (       a  US   nUSS nOSn[        S[        U5      S5       H&  nX$US-    u  pVpxU R                  X54Xg4SU45        SnM(     g)z!dx1? {dya dxb dyb dyc}+ vvcurvetor.   r   r   Nr7   r#  rd   r   r  )	r   r   rg  dx1r   r:  r;  r<  r>  s	            r   op_vvcurvetoT2OutlineExtractor.op_vvcurveto  sw    {{}t9q=q'C8DCq#d)Q'A!%!a%CcMM3*sj1c(;C (r    c                     U R                  5       n[        U5      S-  (       a  US   nUSS nOSn[        S[        U5      S5       H&  nX$US-    u  pVpxU R                  XS4Xg4US45        SnM(     g)z!dy1? {dxa dxb dyb dxc}+ hhcurvetor.   r   r   Nr7   rL  )	r   r   rg  dy1r   r9  r;  r<  r=  s	            r   op_hhcurvetoT2OutlineExtractor.op_hhcurveto  sw    {{}t9q=q'C8DCq#d)Q'A!%!a%CcMM3*sj3(;C (r    c                     U R                  5       nU(       a3  U R                  U5      nU(       a  U R                  U5      nU(       a  M2  gg)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   rg  s      r   op_vhcurvetoT2OutlineExtractor.op_vhcurveto  8     {{}==&D}}T* dr    c                     U R                  5       nU(       a3  U R                  U5      nU(       a  U R                  U5      nU(       a  M2  gg)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#  rV  rU  rW  s      r   op_hvcurvetoT2OutlineExtractor.op_hvcurveto%  rZ  r    c                     U R                  5       u  p#pEpgnS=n	=n
=pU* nU R                  X)4X44XZ45        U R                  Xk4X}4X45        g r  r#  r  )r   r   rM  dx2dy2dx3dx4dx5dx6rQ  dy3dy4dy6dy5s                 r   op_hflexT2OutlineExtractor.op_hflex2  s[    ,0KKM)#Cc !!!c!Cdsj3*sj9sj3*sj9r    c                     U R                  5       u  p#pEpgpppnU R                  X#4XE4Xg45        U R                  X4X4X45        g r?   r_  )r   r   rM  rQ  r`  ra  rb  rf  rc  rg  rd  ri  re  rh  fds                  r   op_flexT2OutlineExtractor.op_flex9  sH    IMF#Cc#Bsj3*sj9sj3*sj9r    c           	          U R                  5       u	  p#pEpgpn
S=pX5-   U-   U-   U	-   * nU R                  X#4XE4Xk45        U R                  X|4X4X45        g r  r_  )r   r   rM  rQ  r`  ra  rb  rc  rd  ri  re  rf  rg  rh  s                 r   	op_hflex1T2OutlineExtractor.op_hflex1>  sc    6:kkm3#Cc	C#%+,sj3*sj9sj3*sj9r    c                    U R                  5       u  p#pEpgppnX$-   U-   U-   U
-   nX5-   U-   U	-   U-   n[        U5      [        U5      :  a  UnU* nOU* nUnU R                  X#4XE4Xg45        U R                  X4X4UU45        g r?   )r#  r   r  )r   r   rM  rQ  r`  ra  rb  rf  rc  rg  rd  ri  d6dxdyre  rh  s                    r   op_flex1T2OutlineExtractor.op_flex1F  s    ?C{{}<#Cc"Y_s"S(Y_s"S(r7SWC#C#CCsj3*sj9sj3*sCj9r    c                     [         er?   rj  r>  s     r   rk  T2OutlineExtractor.op_andT  rm  r    c                     [         er?   rj  r>  s     r   ro  T2OutlineExtractor.op_orW  rm  r    c                     [         er?   rj  r>  s     r   rr  T2OutlineExtractor.op_notZ  rm  r    c                     [         er?   rj  r>  s     r   ru  T2OutlineExtractor.op_store]  rm  r    c                     [         er?   rj  r>  s     r   rx  T2OutlineExtractor.op_abs`  rm  r    c                     [         er?   rj  r>  s     r   r{  T2OutlineExtractor.op_addc  rm  r    c                     [         er?   rj  r>  s     r   r~  T2OutlineExtractor.op_subf  rm  r    c                     U R                  5       nU R                  5       nX2-  nX2-  nXE:X  a  U R                  U5        g U R                  U5        g r?   )r4  r;  )r   r   num2num1d1d2s         r   r  T2OutlineExtractor.op_divi  sA    xxzxxz\[8IIbMIIbMr    c                     [         er?   rj  r>  s     r   r  T2OutlineExtractor.op_loads  rm  r    c                     [         er?   rj  r>  s     r   r  T2OutlineExtractor.op_negv  rm  r    c                     [         er?   rj  r>  s     r   r  T2OutlineExtractor.op_eqy  rm  r    c                     [         er?   rj  r>  s     r   r  T2OutlineExtractor.op_drop|  rm  r    c                     [         er?   rj  r>  s     r   r  T2OutlineExtractor.op_put  rm  r    c                     [         er?   rj  r>  s     r   r  T2OutlineExtractor.op_get  rm  r    c                     [         er?   rj  r>  s     r   r  T2OutlineExtractor.op_ifelse  rm  r    c                     [         er?   rj  r>  s     r   r  T2OutlineExtractor.op_random  rm  r    c                     [         er?   rj  r>  s     r   r  T2OutlineExtractor.op_mul  rm  r    c                     [         er?   rj  r>  s     r   r  T2OutlineExtractor.op_sqrt  rm  r    c                     [         er?   rj  r>  s     r   r  T2OutlineExtractor.op_dup  rm  r    c                     [         er?   rj  r>  s     r   r  T2OutlineExtractor.op_exch  rm  r    c                     [         er?   rj  r>  s     r   r  T2OutlineExtractor.op_index  rm  r    c                     [         er?   rj  r>  s     r   r  T2OutlineExtractor.op_roll  rm  r    c                     U R                  5       nU H+  nU(       a  US4nOSU4nU R                  U5        U(       + nM-     g r  )r#  r	  )r   isHorizontalrg  argr  s        r   r1  $T2OutlineExtractor.alternatingLineto  s@    {{}CaCLL++L r    c                     US S u  p#pEUSS  n[        U5      S:X  a  US   n/ nOSnU R                  SU4X44XV45        U$ Nr7   r   r   rd   r  )r   rg  r:  r;  r<  r=  r>  s          r   rU  T2OutlineExtractor.vcurveto  sX    !"1X#ABxt9>q'CDCq#h
SJ7r    c                     US S u  p#pEUSS  n[        U5      S:X  a  US   n/ nOSnU R                  US4X44Xe45        U$ r  r  )r   rg  r9  r;  r<  r>  r=  s          r   rV  T2OutlineExtractor.hcurveto  sX    !"1X#ABxt9>q'CDCsAh
SJ7r    )r  r  r  r  r  ):r   r   r   r  r  r  r.  r  r  r	  r  r  r  r  r  r  rB  r-  r2  r6  r?  rE  rI  rN  rR  rX  r\  rj  rn  rq  rw  rk  ro  rr  ru  rx  r{  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r1  rU  rV  r  __classcell__r  s   @r   r  r  ]  s    ,0
I
6)22G" ""> :++::
::""""""""""""""""""""",		 	r    r  c                       \ rS rSrS rS rS rSS jrS rS r	S r
S	 rS
 rS rS rS rS rS rS rS rS rS rS rS rS rSrg)T1OutlineExtractori  c                 <    Xl         X l        U R                  5         g r?   )r  subrsr  )r   r  r  s      r   r  T1OutlineExtractor.__init__  s    


r    c                 X    SU l         SU l        SU l        [        R	                  U 5        g r  )flexingr  sbxr  r  r  s    r   r  T1OutlineExtractor.reset  s%    
  &r    c                 h    U R                   (       a  U R                  R                  5         SU l         g r  )r  r  r  r  s    r   r  T1OutlineExtractor.endPath  s     >>HHr    c                 "    U R                  5       $ r?   r#  )r   r  s     r   r  T1OutlineExtractor.popallWidth      {{}r    c                 >    U R                   nUS   US   sUS'   US'   g )NrB  r   r2  r7  s     r   r   T1OutlineExtractor.exch  s)    !!$Ry%)b	59r    c                     U R                   (       a  g U R                  5         U R                  U R                  5       5        g r?   )r  r  r  r#  r>  s     r   r  T1OutlineExtractor.op_rmoveto  s'    <<T[[]#r    c                     U R                   (       a  U R                  S5        g U R                  5         U R                  U R	                  5       S   S45        g r  )r  r;  r  r  r#  r>  s     r   r  T1OutlineExtractor.op_hmoveto  s<    <<IIaLdkkmA&*+r    c                     U R                   (       a"  U R                  S5        U R                  5         g U R                  5         U R	                  SU R                  5       S   45        g r  )r  r;  r   r  r  r#  r>  s     r   r  T1OutlineExtractor.op_vmoveto  sE    <<IIaLIIKaq)*+r    c                 $    U R                  5         g r?   )r  r>  s     r   op_closepathT1OutlineExtractor.op_closepath  s    r    c                 <    U R                  5       nUu  p4X44U l        g r?   )r#  r  )r   r   rg  r  r  s        r   op_setcurrentpoint%T1OutlineExtractor.op_setcurrentpoint  s    {{}Dr    c                 $    U R                  5         g r?   )r  r>  s     r   rB  T1OutlineExtractor.op_endchar  s    r    c                 j    U R                  5       u  p#X0l        X l        X R                  S   4U l        g r  )r#  r  r  r  )r   r   r  wxs       r   op_hsbwT1OutlineExtractor.op_hsbw  s/    ++-
!2!21!55r    c                 $    U R                  5         g r?   r  r>  s     r   op_sbwT1OutlineExtractor.op_sbw      r    c                 d    U R                  5       nU R                  U   nU R                  U5        g r?   )r4  r  r.  rI  s       r   rL  T1OutlineExtractor.op_callsubr  s'    HHJ	zz)$Tr    c                     U R                  5       nU R                  5       nUS:X  a  US:X  a  U R                  5         SU l        g US:X  a  US:X  a  SU l        g g g )Nr   ro   r   )r4  doFlexr  )r   r   rJ  nArgss       r   op_callothersubr#T1OutlineExtractor.op_callothersubr  sP    HHJ	
>eqjKKMDL!^
DL !+^r    c                     g r?   r   r>  s     r   op_popT1OutlineExtractor.op_pop  rD  r    c                 N   U R                  5       nU R                  5       nU R                  5         U R                  5       nU R                  5       nU R                  5       nU R                  5       nU R                  5       nU R                  5       nU R                  5       n	U R                  5       n
U R                  5       nU R                  5       nU R                  5       nU R                  5       nU R                  5       nU R                  5       nU R                  UU-   5        U R                  X-   5        U R                  U5        U R                  U5        U R                  U
5        U R                  U	5        U R                  S 5        U R                  U5        U R                  U5        U R                  U5        U R                  U5        U R                  U5        U R                  U5        U R                  S 5        U R                  U5        U R                  U5        g r?   )r4  r;  r?  )r   finalyfinalxp3yp3xbcp4ybcp4xbcp3ybcp3xp2yp2xbcp2ybcp2xbcp1ybcp1xrpyrpxs                    r   r  T1OutlineExtractor.doFlex  s   
hhjhhj



hhjhhj



hhjhhj 			%#+		%+		%		%		#		#$ 			%		%		%		%		#		#$ 			&		&r    c                 $    U R                  5         g r?   r  r>  s     r   op_dotsection T1OutlineExtractor.op_dotsectionE  r  r    c                 $    U R                  5         g r?   r  r>  s     r   	op_hstem3T1OutlineExtractor.op_hstem3H  r  r    c           	          SSK Jn  U R                  5       u  p4pVnX&   nU R                  R	                  US5        X'   n	X@R
                  -   U-
  nU R                  R	                  U	SSSSXE45        g)zasb adx ady bchar achar seacr   r   r"  r   N)r#  r!  r#  r  r$  r  )
r   r   r!  asbr%  r&  r'  r(  r)  r*  s
             r   op_seacT1OutlineExtractor.op_seacK  sk    I&*kkm##e$+	i);<&-HHns"kAq!Q+ABr    c                 $    U R                  5         g r?   r  r>  s     r   	op_vstem3T1OutlineExtractor.op_vstem3V  r  r    )r  r  r  r  r  r  r  Nr  )r   r   r   r  r  r  r  r  r   r  r  r  r  r  rB  r  r  rL  r  r  r  r  r  r   r  r  r   r    r   r  r    sm    
'
4$,,!
6
(T	Cr    r  c                       \ rS rSr\r\" \5      u  rr	\
r\rSS jrSS jrS rS rS rS rSS	 jrS
 rSS jrS rS rS r\\\4S jrS rS rSS jr S r!Sr"g)T2CharStringiZ  Nc                 X    Uc  / nXl         X l        X0l        Ub  UO/ U l        S U l        g r?   )bytecoder&  r  r	  _cur_vsindex)r   r  r&  r  r	  s        r   r  T2CharString.__init__`  s2    ?G *5*A;r r    c                     U R                   nUc   eUb  Xl        O1U R                  c$  [        US5      (       a  UR                  OSU l        UR	                  U R                  5      $ )Nr   r   )r  r	  hasattrr   r  )r   r   pds      r   r  T2CharString.getNumRegionsi  s^    \\~~ '&.5b).D.D

!D 1 122r    c                     U R                   c$  SU R                  R                  [        U 5      4-  $ SU R                  R                  [        U 5      4-  $ )Nz<%s (source) at %x>z<%s (bytecode) at %x>)r  r  r   idr  s    r   __repr__T2CharString.__repr__r  sH    == (DNN,C,CRX+NNN*dnn.E.Er$x-PPPr    c                     [         $ r?   )r   r  s    r   r   T2CharString.getIntEncoderx      r    c                     [         $ r?   )r   r  s    r   getFixedEncoderT2CharString.getFixedEncoder{  r  r    c                     U R                  5       (       d  g [        U R                  S/ 5      nU R                  XR                  U R                  5      nUR                  U 5        g NSubrs)r   r"  r  decompilerClassr	  r.  )r   r  
decompilers      r   	decompileT2CharString.decompile~  sP    &&((gr2))%1A1A4<<P
4 r    c           	         [        U R                  S/ 5      nU R                  UUU R                  U R                  R                  U R                  R
                  U R                  U5      nUR                  U 5        UR                  U l        g r  )r"  r  outlineExtractorr	  r  r  r.  r  )r   r  r  r  	extractors        r   drawT2CharString.draw  sr    gr2))LL&&LL&&LL
	 	$__
r    c                 R    [        U5      nU R                  U5        UR                  $ r?   )r   r#  bounds)r   glyphSet	boundsPens      r   
calcBoundsT2CharString.calcBounds  s$    h'			)r    c                    U R                   b  g U R                  nU R                  nU(       a  U(       a  US   S;   a  US S nO*U(       a#  [        US   [        5      (       d  [        S5      e/ nU R                  5       nU R                  5       nSn[        U5      nXx:  a  X7   n	US-   n[        U	[        5      (       a:   UR                  S X)    5       5        U	S;   a  UR                  X7   5        US-   nOm[        U	[        5      (       a  UR                  U" U	5      5        O@[        U	[        5      (       a  UR                  U" U	5      5        O S	[        U	5      -  5       eXx:  a  M   [        U5      nU R'                  U5        g ! [         a    [        SU	-  5      ef = f! [          a    ["        R%                  U5        e f = f)
Nr   )r   r   z@T2CharString or Subr has items on the stack after last operator.r   r   c              3   8   #    U  H  n[        U5      v   M     g 7fr?   )r   ).0rJ   s     r   	<genexpr>'T2CharString.compile.<locals>.<genexpr>  s     #G1GAJJs   zillegal operator: %sr   r   zunsupported type: %s)r  opcodesr&  re   strr   r   r  rd   extendr   r   r   rH   typer	   	TypeErrorr   errorsetBytecode)
r   isCFF2r1  r&  r  r   r   r   endr)  s
             r   compile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E3''	% 01E5))E 23>04;>>q! g"	 *H 	"!   Q01G%1OPPQ  	IIh	s   F /F( F%(!G	c                     U R                   S L$ r?   )r  r  s    r   r   T2CharString.needsDecompilation  s    }}D((r    c                     Xl         S U l        g r?   )r&  r  )r   r&  s     r   r$  T2CharString.setProgram  s    r    c                     Xl         S U l        g r?   )r  r&  )r   r  s     r   r7  T2CharString.setBytecode  s     r    c                 >   U R                   bV  X" U R                   5      :  a  gU" U R                   U   5      nUS-   nU R                  U   nU" XU R                   U5      u  pqO*X" U R                  5      :  a  gU R                  U   nUS-   nU" U[        5      nXxU4$ )N)Nr   r   r   )r  operandEncodingr&  r2  )	r   r   rd   r   re   r   r,  r)  r*  s	            r   r!  T2CharString.getToken  s    ==$DMM**!u-.BAIE**2.G"4T]]EBLE5DLL))!LL'EAIEs+
%''r    c                     U R                   b  X-   nU R                   X nUnOU R                  U   nUS-   n[        U5      U:X  d   eXA4$ r  )r  r&  rd   )r   r   nBytesnewIndexbytess        r   ra  T2CharString.getBytes  sW    ==$~HMM%1EELL'EAIE5zV###|r    c                     U$ r?   r   )r   r   s     r   r   T2CharString.handle_operator  s    r    c                    SSK Jn  U R                  b  UR                  U R                  5        g Sn/ n U R	                  U5      u  pgnUc  OU(       a  US;   aa  U R	                  U5      u  pn/ n	U H$  n
U	R                  U" [        U
5      S5      5        M&     [        U	5      nSR                  XVU/-   5      nOSR                  XV/-   5      nUR                  U5        UR                  5         / nO<[        U[        5      (       a  [        USS9nO[        U5      nUR                  U5        M  U(       a#  SR                  U5      nUR                  U5        g g )Nr   )
num2binaryr0  r}    r:   r;   )fontTools.misc.textToolsrM  r  dumphexr!  r   r   r
   joinwritenewlinere   rH   r   r2  )r   	xmlWriterttFontrM  r   rg  r)  r*  hintMaskbitsbytelines               r   toXMLT2CharString.toXML  s4   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SK JnJn  UR                  S5      (       a  U R	                  U" U5      5        g [        U5      nUR                  5       n/ n[        U5      nSnX:  a-  X8   n	US-   n [        U	5      n	UR                  U	5        X:  a  M-  U R                  U5        g ! [         a     [        U	SS9n	UR                  U	5         NA! [         am    UR                  U	5        U	S;   aR  X8   n
Sn[        S[        U
5      S	5       H  nU[        U" XUS	-    5      5      -   nM     UR                  U5        US-   n  Nf = ff = f)
Nr   )
binary2numreadHexrawr   r:   r;   r0  r    r}   )rO  r]  r^  r   r7  r
   r   rd   r   r   
ValueErrorr   r   r   r$  )r   nameattrscontentr]  r^  r&  r9  r   r)  mask	maskBytesjs                r   fromXMLT2CharString.fromXML  sF   @99UWW-.'"--/'lgJEAA&E
  u%) g* 	 !  **-e2FE NN5) " "NN5) 88&z$'	!&q#d)Q!7A(1GJtPQTUPU<W4X(XI "8y1E"*s1   0B% %
E0
C:EA3E EEE)r	  r  r	  r  r&  r  )NNNNr?   )F)#r   r   r   r  t2OperandEncodingrC  rk   t2Operatorsr   r1  r  r  r  r!  r  r  r  r   r  r  r#  r)  r:  r   r$  r7  rd   r   re   r!  ra  r   rZ  rg  r  r   r    r   r  r  Z  s    'O*;7Iw(O)!3Q!% 
*#X) #&w: ( 	$&L !r    r  c                   ^   ^  \ rS rSr\r\" \5      u  rr	SU 4S jjr
S rS rS rS rSrU =r$ )	T1CharStringi6  c                 0   > [         TU ]  X5        X0l        g r?   )r  r  r  )r   r  r&  r  r  s       r   r  T1CharString.__init__:  s    +
r    c                     [         $ r?   )encodeIntT1r  s    r   r   T1CharString.getIntEncoder>  r  r    c                 
    S ng )Nc                     [        S5      e)Nz8Type 1 charstrings don't support floating point operands)r5  )r   s    r   r   1T1CharString.getFixedEncoder.<locals>.encodeFixedB  s    VWWr    r   )r   r   s     r   r  T1CharString.getFixedEncoderA  s    	Xr    c                     U R                   c  g / nSn U R                  U5      u  p4nUc  OUR                  U5        M+  U R                  U5        g r  )r  r!  r   r$  )r   r&  r   r)  r*  s        r   r  T1CharString.decompileE  sV    == '+}}U';$Eu}NN5!	 
 	 r    c                 r    [        XR                  5      nUR                  U 5        UR                  U l        g r?   )r  r  r.  r  )r   r  r"  s      r   r#  T1CharString.drawQ  s)    &sJJ7	$__
r    )r  r  )NNN)r   r   r   r  t1OperandEncodingrC  rk   t1Operatorsr   r1  r  r   r  r  r#  r  r  r  s   @r   rl  rl  6  s6    'O*;7IwX
!% %r    rl  c                   d    \ rS rSr\rSS jrS rS rS r	S r
S rS	 rS
 rS rS rS rS rSrg)DictDecompileriW  Nc                 8    / U l         Xl        0 U l        X l        g r?   )r8  stringsdictparent)r   r  r  s      r   r  DictDecompiler.__init__Z  s    
	r    c                 Z    [        U R                  5      S:X  d   S5       eU R                  $ )Nr   znon-empty stack)rd   r8  r  r  s    r   getDictDictDecompiler.getDict`  s(    4::!#6%66#yyr    c                     Sn[        U5      nU R                  R                  nX#:  a?  [        X   5      nUS-   nU R                  U   nU" XX5      u  prUb  U" U5        X#:  a  M>  g g r  )rd   r8  r   r   rC  )r   r   r   lenDatar;  r   r,  r   s           r   r  DictDecompiler.decompiled  sk    d)zz  o%BAIE**2.G"4T9LE U or    c                 >    U R                   S   nU R                   S	 U$ r1  r8  r3  s     r   r4  DictDecompiler.popp  s    

2JJrNr    c                 B    U R                   S S  nU R                   S S 2	 U$ r?   r  rf  s     r   r#  DictDecompiler.popallu  s    zz!}JJqMr    c                 H   Uu  p[        U[        5      (       aB  Sn[        [        U5      S-
  SS5       H"  nX$   n[	        U SU-   5      nU" U5      4U-   nM$     O[	        U SU-   5      nU" U5      nUS:X  a  U R
                  R                  U5        g X0R                  U'   g )Nr   r   r   arg_r   )re   rf   r   rd   r"  r8  r3  r  )r   r   argTyper   r   r  
arghandlers          r   r   DictDecompiler.handle_operatorz  s    $gu%%E3w<!+R4j$T6C<8
#H-/%7 5
 !v'78Jx(EwJJe$"'IIhr    c                     [        U R                  S   [        5      (       a  U R                  U R                  5      nU$ U R	                  5       nU$ r  )re   r8  listarg_blend_numberr4  )r   ra  outs      r   
arg_numberDictDecompiler.arg_number  sD    djjmT**''

3C 
 ((*C
r    c                     / nU R                  5       n[        U5      nUR                  U5        UR                  S5        U R                  5       nU$ )Nr   )r4  rd   r   r#  )r   ra  r  	blendArgs
numMastersdummys         r   r  DictDecompiler.arg_blend_number  sD    HHJ	^


9

7r    c                 <    U R                   U R                  5          $ r?   )r  r4  r   ra  s     r   arg_SIDDictDecompiler.arg_SID  s    ||DHHJ''r    c                 "    U R                  5       $ r?   r  r  s     r   	arg_arrayDictDecompiler.arg_array  r  r    c                 `   U R                   R                  SS5      nU R                  R                  U5      S-   nU R	                  5       nU R                  5       n[        U5      nXcU-  :X  d   eS/U-  nUS-
  nSn	Sn
X:  a*  XY   U
-   nUn
XIU-  -   nU/X\X-    -   nXU	'   U	S-  n	X:  a  M*  U$ )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.
r   r   r   N)r  r   r  r  r4  r#  rd   )r   ra  r   r  r  rg  numArgsr   	numDeltasr   prevValnewValmasterOffset	blendLists                 r   arg_blendList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 m r    c                     U R                  5       n/ nU(       a  [        US   [        5      (       a  UnU$ SnU H  nXE-   nUR                  U5        M     U$ r  )r#  re   r  r   )r   ra  	valueListr  currentvs         r   	arg_deltaDictDecompiler.arg_delta  s\    KKM	IaL$77C 
	 G!+

7#  
r    )r  r  r8  r  r?   )r   r   r   r  cffDictOperandEncodingrC  r  r  r  r4  r#  r   r  r  r  r  r  r  r  r   r    r   r}  r}  W  sD    ,O


( ( Dr    r}  c                 H    [        U 5      nUS:  a  SnU$ US:  a  SnU$ SnU$ )Ni  r   il  r   i   )rd   )r  nSubrsbiass      r   r  r    s?    ZF}
 K	 
% K Kr    )9__doc__fontTools.misc.fixedToolsr   r   r   r   rO  r   r   r	   r
   fontTools.pens.boundsPenr   r0   logging	getLoggerr   r   r   r   r(   r+   r3   r8   r=   rB   rM   rz  rd   ri  r  rG   	enumerater   
maxOpStackrk   rj  r   encodeIntCFFrp  r   r   r   r   r   	Exceptionr   objectr  r{  r  r  r  r  rl  r}  r  )r   r  s   00r   <module>r     s?    J I .   !2
3


<
!
   FSL -0 !B %)4 "S 'N+;; #c 'N+;; #c % # 
$ $$%a( % " ' # *1- ) r , r + s " %.k$:;$:DA14$:;
8v1h U#D!D!  + gcl*1h	Y 	F9 F9R<0) 0fa) aHV+ VrY!6 Y!x%< %BvV vrs* <s   E?