+
    K<i/D                         ^ RI HtHtHt R t ! R R]4      t ! R R]4      tR tR t	 ! R	 R
]4      t
 ! R R]4      tR tR tRR/R R lltR tR tR# )    )SimpleT2DecompilerT2WidthExtractorcalcSubrBiasc                 *    \        \        V 4      4      # N)sortedset)ls   &=/usr/lib/python3/dist-packages/fontTools/cffLib/transforms.py
_uniq_sortr      s    #a&>    c                       ] tR t^tRtR# )StopHintCountEvent N)__name__
__module____qualname____firstlineno____static_attributes__r   r   r   r   r      s    r   r   c                   R   a  ] tR t^t o R
tRR ltR tR tR tR t	R t
R tR	tV tR# )_DesubroutinizingT2DecompilerNc                4    \         P                  ! WW#4       R # r   )r   __init__)self
localSubrsglobalSubrsprivates   &&&&r   r   &_DesubroutinizingT2Decompiler.__init__   s    ##DkKr   c                R   R V n         V P                   F  p\        WV P                  4       K  	  \	        VR4      '       d@   V P                   '       d,   V P
                  '       d    \        P                  ! W4       R# R# . Vn	        \        P                  ! W4       VP                  R,          p\        VP                  4       Fw  w  rEV^8  g   Q hW4^,
          ,          R9   g   Q W4^,
          ,          4       h\        W4^,
          ,          4      \        8X  g   Q hVR,          R8X  d   VRR pWSV^,
          V% Ky  	  V P                  P                  '       g#   RV9   d   VRVP!                  R4      ^,            pW1n        V=	R#   \         d    T P
                  R  R# i ; i)T_desubroutinizedN:NNNreturnendchar)callsubr	callgsubr)need_hintcountstop_hintcount_opssetattrstop_hint_counthasattrcallingStackr   executer   _patchesprogramreversedtypeintr   in_cff2indexr    )r   
charStringop_namedesubroutinizedidx	expansions   &&    r   r,   %_DesubroutinizingT2Decompiler.execute   s   "..GD4#7#78 / :122
 """t'8'8'8.&..t@  
""44$,,Q/&z':':;NC!8O8"7+ 0  ( Qw'(  a01S888}(%crN	-6C!Gc* < ||###O+"1:o++I6:# '6#3 * .))"-.s   (F
 
F&%F&c                    V P                   V P                  R,          V P                  ,           ,          p\        P                  ! W4       V P                  W4       R#    Nr#   )r   operandStack	localBiasr   op_callsubrprocessSubrr   r3   subrs   && r   r?   )_DesubroutinizingT2Decompiler.op_callsubrD   s@    t004t~~EF&&t3%r   c                    V P                   V P                  R,          V P                  ,           ,          p\        P                  ! W4       V P                  W4       R# r;   )r   r=   
globalBiasr   op_callgsubrr@   rA   s   && r   rF   *_DesubroutinizingT2Decompiler.op_callgsubrI   sB     1 1" 5 GH''4%r   c                    R V n         V P                   F  p\        WR4       K  	  V P                  R,          p\	        VR4      '       d   \        4       hR# )FNr    r#   )r&   r'   r(   r+   r*   r   )r   argsr5   css   &*  r   r)   -_DesubroutinizingT2Decompiler.stop_hint_countN   sP    #..GD4( /r"2)**$&& +r   c                z    \         P                  ! W4       V P                  '       d   V P                  4        R # R # r   )r   op_hintmaskr&   r)   r   r3   s   &&r   rM   )_DesubroutinizingT2Decompiler.op_hintmaskV   s-    &&t3  " r   c                    V P                   R,          p\        VR4      '       g)   VP                  P                  WP                  34       R# R# )r<   r    Nr#   )r+   r*   r-   appendr    )r   r3   rB   rJ   s   &&& r   r@   )_DesubroutinizingT2Decompiler.processSubr[   s@    r"r-..KK'<'<=> /r   )r&   )rM   op_cntrmask
op_rmoveto
op_hmoveto
op_vmovetor   )r   r   r   r   r'   r   r,   r?   rF   r)   rM   r@   r   __classdictcell____classdict__s   @r   r   r      s7     L& P&
&
'#
? ?r   r   c                    V P                  4        \        V P                  R. 4      p\        WP                  V P                  4      pVP                  V 4       V P                  V n        V =R# )z%Desubroutinize a charstring in-place.SubrsN)	decompilegetattrr   r   r   r,   r    r.   )rJ   subrs
decompilers   &  r   desubroutinizeCharStringr`   a   sR    LLNBJJ,E.unnbjjQJr$$BJ
r   c                    V P                    F  pW,          pVP                  pVP                  4        F  p\        V4       K  	  \	        VR 4      '       dV   VP
                   FC  pVP                  p\	        VR4      '       d   V=RVP                  9   g   K6  VP                  R KE  	  K  VP                  p\	        VR4      '       d   V=RVP                  9   g   K  VP                  R K  	  V P                  P                  4        R# )FDArrayr[   N)	fontNamesCharStringsvaluesr`   r*   rb   Privater[   rawDictGlobalSubrsclear)cfffontNamefontrJ   cfdpds   &      r   desubroutinizerp   k   s    MM}A$Q'  4##llZZ2w''bjj(

7+ # Br7##H"**$JJw'% "( OOr   c                   2   a  ] tR t^t o R tR tR tRtV tR# )_MarkingT2Decompilerc                    \         P                  ! WW#4       W3 F0  pV'       g   K  \        VR 4      '       d   K!  \        4       Vn        K2  	  R# )_usedN)r   r   r*   r	   rt   )r   r   r   r   r^   s   &&&& r   r   _MarkingT2Decompiler.__init__   s9    ##DkK .EuWUG44!e /r   c                    V P                   P                  P                  V P                  R,          V P                  ,           4       \
        P                  ! W4       R# r;   )r   rt   addr=   r>   r   r?   rN   s   &&r   r?    _MarkingT2Decompiler.op_callsubr   s<    !!$"3"3B"7$.."HI&&t3r   c                    V P                   P                  P                  V P                  R,          V P                  ,           4       \
        P                  ! W4       R# r;   )r   rt   rw   r=   rE   r   rF   rN   s   &&r   rF   !_MarkingT2Decompiler.op_callgsubr   s>    ""4#4#4R#84??#JK''4r   r   N)	r   r   r   r   r   r?   rF   r   rW   rX   s   @r   rr   rr      s     $45 5r   rr   c                      a  ] tR t^t o  ! R R]4      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V tR# )_DehintingT2Decompilerc                   &   a  ] tR t^t o R tRtV tR# )_DehintingT2Decompiler.Hintsc                Z    R V n         ^ V n        ^ V n        ^ V n        R V n        . V n        R# )FN)has_hint	last_hintlast_checkedstatushas_hintmask	deletions)r   s   &r   r   %_DehintingT2Decompiler.Hints.__init__   s4    
 "DMDN !"D DK %DDNr   )r   r   r   r   r   r   N)r   r   r   r   r   r   rW   rX   s   @r   Hintsr~      s     	 . 	r   r   Nc                N    Wn         \        P                  ! WW4V4       W`n        R # r   )_cssr   r   r   )r   cssr   r   nominalWidthXdefaultWidthXr   s   &&&&&&&r   r   _DehintingT2Decompiler.__init__   s%     	!!k-	
 r   c                   \        VR 4      '       d   VP                  MRpV P                  4       Vn        \        P                  ! W4       VP                  pVP
                  '       g   VP                  '       d   V P                  P                  V4       VP                  ^8w  d   \        VP                  \        VP                  4      ^,
          4       F:  p\        VP                  V,          \        4      '       d
   ^Vn	         M^Vn	        K<  	  \        VP                  4      Vn        V'       d    VP                   VP                   8X  g   Q hR# R# )_hintsN)r*   r   r   r   r,   r   r   r   rw   r   ranger   lenr.   
isinstancestr__dict__)r   r4   	old_hintshintsis   &&   r   r,   _DehintingT2Decompiler.execute   s    )0X)F)FJ%%D	 JJL
  2!!>>>U///IIMM*%<<15--s:3E3E/F/JKj003S99#$EL#$EL L "%Z%7%7!8E>>Y%7%7777 r   c                    V P                   V P                  R,          V P                  ,           ,          p\        P                  ! W4       V P                  W4       R# r;   )r   r=   r>   r   r?   r@   rA   s   && r   r?   "_DehintingT2Decompiler.op_callsubr   s@    t004t~~EF$$T1%r   c                    V P                   V P                  R,          V P                  ,           ,          p\        P                  ! W4       V P                  W4       R# r;   )r   r=   rE   r   rF   r@   rA   s   && r   rF   #_DehintingT2Decompiler.op_callgsubr   sB     1 1" 5 GH%%d2%r   c                T    \         P                  ! W4       V P                  V4       R # r   )r   op_hstemprocessHintrN   s   &&r   r   _DehintingT2Decompiler.op_hstem       !!$.r   c                T    \         P                  ! W4       V P                  V4       R # r   )r   op_vstemr   rN   s   &&r   r   _DehintingT2Decompiler.op_vstem   r   r   c                T    \         P                  ! W4       V P                  V4       R # r   )r   
op_hstemhmr   rN   s   &&r   r   !_DehintingT2Decompiler.op_hstemhm       ##D0r   c                T    \         P                  ! W4       V P                  V4       R # r   )r   
op_vstemhmr   rN   s   &&r   r   !_DehintingT2Decompiler.op_vstemhm   r   r   c                T    \         P                  ! W4      pV P                  V4       V# r   )r   rM   processHintmaskr   r3   rvs   && r   rM   "_DehintingT2Decompiler.op_hintmask   %    ))$6U#	r   c                T    \         P                  ! W4      pV P                  V4       V# r   )r   rS   r   r   s   && r   rS   "_DehintingT2Decompiler.op_cntrmask   r   r   c                p   V P                   R,          pVP                  pRVn        VP                  ^8w  dq   \	        VP
                  V^,
          4       F3  p\        VP                  V,          \        4      '       g   K,  ^Vn         M	  RVn	        V^,           Vn
        ^ Vn        V^,           Vn        R# r<   TNr#   )r+   r   r   r   r   r   r   r.   r   r   r   )r   r3   rJ   r   r   s   &&   r   r   &_DehintingT2Decompiler.processHintmask   s    r"		!<<15--uqy9bjjmS11#$EL : "&"'!) "QYr   c                j    V P                   R,          pVP                  pRVn        Wn        Wn        R# r   )r+   r   r   r   r   )r   r3   rJ   r   s   &&  r   r   "_DehintingT2Decompiler.processHint  s-    r"		"r   c                v   V P                   R,          pVP                  pVP                  pVP                  ^8w  d[   \        VP                  V^,
          4       F3  p\        VP                  V,          \        4      '       g   K,  ^Vn         M	  Wn        VP                  ^8w  dA   VP                  '       d.   RVn        VP                  ^ 8X  d   Wn	        M;V^,
          Vn	        M,VP                  ^ 8X  d   VP                  P                  V4       \        VP                  VP                  4      Vn        R# r   )r+   r   r   r   r   r   r.   r   r   r   r   rQ   max)r   r3   rB   rJ   r   
subr_hintsr   s   &&&    r   r@   "_DehintingT2Decompiler.processSubr  s    r"		[[
 <<15--uqy9bjjmS11#$EL : "'<<1"""!% $$)&+O&+aiEO!#OO""5)5<<):):;r   )r   r   r   )r   r   r   r   objectr   r   r,   r?   rF   r   r   r   r   rM   rS   r   r   r@   r   rW   rX   s   @r   r|   r|      sW      480&
&
    

'"#< <r   r|   c                 v   V P                   p\        ^\        V4      4       EF  pW4,          R8X  d{   \        W4^,
          ,          \        4      '       g   Q hVP
                  P                  W4^,
          ,          VP                  ,           4      VP                  ,
          W4^,
          &   K  W4,          R8X  g   K  \        W4^,
          ,          \        4      '       g   Q hVP
                  P                  W4^,
          ,          VP                  ,           4      VP                  ,
          W4^,
          &   EK  	  R# )r<   r$   r%   N)	r.   r   r   r   r1   rt   r3   	_old_bias	_new_bias)
charstringr^   gsubrspr   s   &&&  r   _cs_subset_subroutinesr   )  s    A1c!f4:aAh,,,,{{((q5EOO)CDuVA!eHT[ aAh,,,,""1U8f.>.>#>?&BRBRR !eH r   c                    V P                   pVP                  '       d4   V P                  p\        VP                  4       F  pW#^,
          V1 K  	  VP                  '       Ed   VP                  '       d%   VP
                  VP                  ^ ,          8:  g   Q hV P                  VP
                  R V n        V P                  '       g   V P                  P                  R4       \        V R4      '       d   V P                  V P                  P                  8w  da   V P                  P                  f   Q R4       hV P                  P                  ^ V P                  V P                  P                  ,
          4       VP                  '       d]   ^ pV P                  pV\        V4      8  d?   W$,          R9   d'   V^,           \        V4      8:  g   Q hW$V^,           1 KC  V^,          pKN  \        V P                  4      '       g   Q hV = R# )   Nr"   widthz5CFF2 CharStrings must not have an initial width value)hintmaskcntrmask)r   r   r.   r/   r   r   rQ   r*   r   r   r   insertr   r   r   )r   r   r   r7   r   s   &    r   _cs_drop_hintsr   6  s   EEOO,C'C-  - ~~~???eoo9K&KKK'//0AB
!!!%%i0:w'':#5#5#C#CC &&44@KJK@""))z''**<*<*J*JJ #a&jt//1uA&!a%iLFAz!!""""r   removeUnusedSubrsTc                $    V ^8  d   QhR\         /# )r   r   )bool)formats   "r   __annotate__r   ^  s     ?' ?'D ?'r   c          
      &   V P                  4        EFf  pW,          pVP                  p\        4       pVP                  4        F  pVP	                  4        \        VP                  R . 4      p\        VVVP                  VP                  P                  VP                  P                  VP                  4      pVP                  V4       VP                  Vn        K  	  V F  p	\        V	4       K  	  ?. p
\        VR4      '       d$   V
P                  R VP                    4       4       MV
P#                  VP$                  4       V
 F+  pR F"  p\        W4      '       g   K  \'        WR4       K$  	  K-  	  EKi  	  V'       d   \)        V 4       R# R# )r[   rb   c              3   8   "   T F  qP                   x  K  	  R # 5ir   )rf   .0rn   s   & r   	<genexpr>remove_hints.<locals>.<genexpr>  s     ?,BZZ,s   N)
BlueValues
OtherBluesFamilyBluesFamilyOtherBlues	BlueScale	BlueShiftBlueFuzz	StemSnapH	StemSnapVStdHWStdVW	ForceBoldLanguageGroupExpansionFactor)keysrd   r	   re   r\   r]   r   r|   r   r   r   r,   r   r   r*   extendrb   rQ   rf   r(   remove_unused_subroutines)rj   r   fontnamerl   rJ   r   rm   r^   r_   r   	all_privsprivks   &$           r   remove_hintsr   ^  sC   HHJ}  eAKKMAIIw3E/		''		''		J q! &&AG  J:&  	4##?$,,??T\\*D  4##DT*# U z !#& r   c                     \        V R 4      '       d7   V P                  '       g#   R V P                  9   d   V P                  R  V =R# R# R# r[   N)r*   r[   rg   )private_dicts   &r   _pd_delete_empty_subrsr     sE    |W%%l.@.@.@l***$$W- /A%r   c                 n   V P                  4        EF  pW,          pVP                  pVP                  4        FK  p\        VP                  R . 4      p\        WTP                  VP                  4      pVP                  V4       KM  	  VP                  .p\        VR4      '       d$   VP                  R VP                   4       4       M]\        VP                  R 4      '       dB   VP                  P                  '       d&   VP                  VP                  P                  4       \        X4      pV Fh  p\        VR4      '       g   \        4       Vn        \#        VP                   4      Vn        \%        V4      Vn        \%        VP                   4      Vn        Kj  	  VP                  4        F0  p\        VP                  R R4      p\+        WEVP                  4       K2  	  V EFa  pWRP                  8X  d   \        VR4      '       g4   \        VP                  R 4      '       d   VP                  P                  pM\        VR4      '       dp   \-        VP                  4      ^8X  dV   \        VP                  ^ ,          P                  R 4      '       d)   VP                  ^ ,          P                  P                  pMRpMTpVP                    U	u. uF  qP.                  V	,          NK  	  up	Vn        \        VR4      '       d   V=\        VR4      '       d   V=VP.                   F  p
\+        WVP                  4       K  	  EKd  	  \        VR4      '       d*   VP                   F  p\5        VP                  4       K  	  M\5        VP                  4       V F	  pV=V=V=K  	  EK  	  R# u up	i )r[   rb   c              3      "   T FW  p\        VP                  R 4      '       g   K!  VP                  P                  '       g   K?  VP                  P                  x  KY  	  R# 5ir   )r*   rf   r[   r   s   & r   r   ,remove_unused_subroutines.<locals>.<genexpr>  sC      &B2::w/ !46JJ4D4D !

  &s   A!A!A!rt   Nfileoffsets)r   rd   re   r]   r   rr   r   r,   rh   r*   r   rb   rf   r[   rQ   r	   rt   r   r   r   r   r   r   itemsr   r   r   )rj   r   rl   rJ   rm   r^   r_   	all_subrslocal_subrsr   rB   rn   s   &           r   r   r     s   HHJ} AAIIw3E-e]]AIINJq! 
 %%&	4## ,, 
 T\\7++0B0B0BT\\//0E
 E5'**!e$U[[1EK*51EO*5;;7EO  AAIIw5E"1T-=-=> 
 E(((tY//GDLL'4R4R"&,,"4"4KD),,DLL)Q.Q 7 7AA #',,q/"9"9"?"?K"&K#38;;?;a;;q>>;?EKuf%%Jui((M&t$:J:JK $- 4 4##ll&rzz2 # #4<<0 EU_eo M j @s   N2N)fontTools.misc.psCharStringsr   r   r   r   	Exceptionr   r   r`   rp   rr   r|   r   r   r   r   r   r   r   r   <module>r      sz    	 	N?$6 N?b05- 5 S<- S<l
%P?'4 ?'DH>r   