+
    f7i/D  c                   s    ^ 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# )i    )SimpleT2DecompilerT2WidthExtractorcalcSubrBiasc                 s*    \        \        V 4      4      # N)Zsortedset)Zl   &B/usr/lib64/python3.14/site-packages/fontTools/cffLib/transforms.py
_uniq_sortr      s    #a&>    c                   s    ] tR t^tRtR# )StopHintCountEvent N)__name__
__module____qualname____firstlineno____static_attributes__r
   r   r   r	   r	      s    r   r	   c                   sR   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                s4    \         P                  ! WW#4       R # r   )r    __init__)self
localSubrsglobalSubrsprivates   &&&&r   r   Z&_DesubroutinizingT2Decompiler.__init__   s    ##DkKr   c                s   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       F#  w  rEVR,          R8X  d   VRR pWSV^,
          V% K%  	  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:NNNZreturnendchar)need_hintcountstop_hintcount_opssetattrstop_hint_counthasattrcallingStackr    executer	   _patchesprogramreversedr   Zin_cff2indexr   )r   
charStringop_nameZdesubroutinizedidxZ	expansions   &&    r   r   Z%_DesubroutinizingT2Decompiler.execute   s8   "..GD4#7#78 / :122
 """t'8'8'8.&..t@  
""44$,,Q/&z':':;NC }(%crN	-6C!Gc* < ||###O+"1:o++I6:# '6#3 * .))"-.s   (D6 6EE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   r#   subr   && r   r,   Z)_DesubroutinizingT2Decompiler.op_callsubrD   s@    t004t~~EF&&t3%r   c                r'   r(   )r   r*   
globalBiasr    op_callgsubrr-   r.   r0   r   r2   Z*_DesubroutinizingT2Decompiler.op_callgsubrI   sB     1 1" 5 GH''4%r   c                s    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   Zargsr%   css   &*  r   r   Z-_DesubroutinizingT2Decompiler.stop_hint_countN   sP    #..GD4( /r"2)**$&& +r   c                sz    \         P                  ! W4       V P                  '       d   V P                  4        R # R # r   )r    op_hintmaskr   r   r   r#      &&r   r4   Z)_DesubroutinizingT2Decompiler.op_hintmaskV   s-    &&t3  " r   c                s    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   r#   r/   r3   s   &&& r   r-   Z)_DesubroutinizingT2Decompiler.processSubr[   s@    r"r-..KK'<'<=> /r   )r   )r4   op_cntrmaskZ
op_rmovetoZ
op_hmovetoZ
op_vmovetor   )r   r   r   r   r   r   r   r,   r2   r   r4   r-   r   __classdictcell__Z__classdict__   @r   r   r      s7     L& P&
&
'#
? ?r   r   c                s    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!   )r3   subrs
decompilers   &  r   desubroutinizeCharStringrA   a   sR    LLNBJJ,E.unnbjjQJr$$BJ
r   c                 s   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)Z	fontNamesCharStringsvaluesrA   r   rB   Privater<   rawDictGlobalSubrsZclear)cffZfontNamefontr3   cfdZpds   &      r   desubroutinizerL   k   s    MM}A$Q'  4##llZZ2w''bjj(

7+ # Br7##H"**$JJw'% "( OOr   c                   s2   a  ] tR t^t o R tR tR tRtV tR# )_MarkingT2Decompilerc                s    \         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   rN   )r   r   r   r   r?   s   &&&& r   r   Z_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   rN   addr*   r+   r    r,   r5   r6   r   r,   Z _MarkingT2Decompiler.op_callsubr   s<    !!$"3"3B"7$.."HI&&t3r   c                rO   r(   )r   rN   rP   r*   r1   r    r2   r5   r6   r   r2   Z!_MarkingT2Decompiler.op_callgsubr   s>    ""4#4#4R#84??#JK''4r   r
   N)	r   r   r   r   r   r,   r2   r   r9   r:   r;   r   rM   rM      s     $45 5r   rM   c                   s   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                   s&   a  ] tR t^t o R tRtV tR# )_DehintingT2Decompiler.Hintsc                sZ    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   r   r   r   Z%_DehintingT2Decompiler.Hints.__init__   s4    
 "DMDN !"D DK %DDNr   )rX   rS   rW   rU   rT   rV   N)r   r   r   r   r   r   r9   r:   r;   r   HintsrR      s     	 . 	r   rY   Nc                sN    Wn         \        P                  ! WW4V4       W`n        R # r   )_cssr   r   r   )r   cssr   r   nominalWidthXdefaultWidthXr   s   &&&&&&&r   r   Z_DehintingT2Decompiler.__init__   s%     	!!k-	
 r   c                sx   \        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   R# R# )_hintsN)r   r^   rY   r   r   rS   rW   rZ   rP   rV   rangerU   lenr!   
isinstancestr)r   r$   Z	old_hintshintsi   &&   r   r   Z_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9r   c                r'   r(   )r   r*   r+   r   r,   r-   r.   r0   r   r,   Z"_DehintingT2Decompiler.op_callsubr   s@    t004t~~EF$$T1%r   c                r'   r(   )r   r*   r1   r   r2   r-   r.   r0   r   r2   Z#_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processHintr5   r6   r   rg   Z_DehintingT2Decompiler.op_hstem       !!$.r   c                rf   r   )r   op_vstemrh   r5   r6   r   rj   Z_DehintingT2Decompiler.op_vstem   ri   r   c                rf   r   )r   
op_hstemhmrh   r5   r6   r   rk   Z!_DehintingT2Decompiler.op_hstemhm       ##D0r   c                rf   r   )r   
op_vstemhmrh   r5   r6   r   rm   Z!_DehintingT2Decompiler.op_vstemhm   rl   r   c                T    \         P                  ! W4      pV P                  V4       V# r   )r   r4   processHintmaskr   r#   Zrvr0   r   r4   Z"_DehintingT2Decompiler.op_hintmask   %    ))$6U#	r   c                rn   r   )r   r8   ro   rp   r0   r   r8   Z"_DehintingT2Decompiler.op_cntrmask   rq   r   c                sp   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^   rW   rV   r_   rU   ra   r!   rb   rS   rT   )r   r#   r3   rc   rd   re   r   ro   Z&_DehintingT2Decompiler.processHintmask   s    r"		!<<15--uqy9bjjmS11#$EL : "&"'!) "QYr   c                sj    V P                   R,          pVP                  pRVn        Wn        Wn        R# rr   )r   r^   rS   rT   rU   )r   r#   r3   rc   s   &&  r   rh   Z"_DehintingT2Decompiler.processHint  s-    r"		"r   c                sv   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# rr   )r   r^   rV   r_   rU   ra   r!   rb   rS   rT   rX   r7   Zmax)r   r#   r/   r3   rc   Z
subr_hintsrd   s   &&&    r   r-   Z"_DehintingT2Decompiler.processSubr  s    r"		[[
 <<15--uqy9bjjmS11#$EL : "'<<1"""!% $$)&+O&+aiEO!#OO""5)5<<):):;r   )rZ   r   r   )r   r   r   r   ZobjectrY   r   r   r,   r2   rg   rj   rk   rm   r4   r8   ro   rh   r-   r   r9   r:   r;   r   rQ   rQ      sW      480&
&
    

'"#< <r   rQ   c                 s   V P                   p\        ^\        V4      4       F  pW4,          R8X  dV   VP                  P	                  W4^,
          ,          VP
                  ,           4      VP                  ,
          W4^,
          &   Ke  W4,          R8X  g   Kt  VP                  P	                  W4^,
          ,          VP
                  ,           4      VP                  ,
          W4^,
          &   K  	  R# )r)   ZcallsubrZ	callgsubrN)r!   r_   r`   rN   r#   	_old_bias	_new_bias)
charstringr?   Zgsubrsprd   s   &&&  r   _cs_subset_subroutinesrw   )  s    A1c!f4:{{((q5EOO)CDuVA!eHT[  ""1U8f.>.>#>?&BRBRR !eH r   c                 s    V P                   pVP                  '       d4   V P                  p\        VP                  4       F  pW#^,
          V1 K  	  VP                  '       d   V P                  VP
                  R V n        V P                  '       g   V P                  P                  R4       \        V R4      '       dg   V P                  V P                  P                  8w  dB   V P                  P                  ^ V P                  V P                  P                  ,
          4       VP                  '       dD   ^ pV P                  pV\        V4      8  d&   W$,          R9   d   W$V^,           1 K*  V^,          pK5  V = R# )   Nr   width)ZhintmaskZcntrmask)r^   rX   r!   r"   rS   rT   r7   r   ry   r   r]   Zinsertr\   rW   r`   )ru   rc   rv   r&   rd   s   &    r   _cs_drop_hintsrz   6  s5   EEOO,C'C-  - ~~~'//0AB
!!!%%i0:w'':#5#5#C#CC
 ""))z''**<*<*J*JJ #a&jt//!a%iLFA 	r   removeUnusedSubrsTc                s$    V ^8  d   QhR\         /# )rx   r{   )Zbool)Zformats   "r   __annotate__r|   ^  s     ?' ?'D ?'r   c          
      s&   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   s8   "   T F  qP                   x  K  	  R # 5ir   )rE   Z.0rK      & r   	<genexpr>Zremove_hints.<locals>.<genexpr>  s     ?,BZZ,s   N)Z
BlueValuesZ
OtherBluesZFamilyBluesZFamilyOtherBluesZ	BlueScaleZ	BlueShiftZBlueFuzzZ	StemSnapHZ	StemSnapVZStdHWZStdVWZ	ForceBoldZLanguageGroupZExpansionFactor)keysrC   r   rD   r=   r>   r   rQ   r   r\   r]   r   ry   rz   r   extendrB   r7   rE   r   remove_unused_subroutines)rH   r{   fontnamerI   r3   r[   rJ   r?   r@   ru   Z	all_privsZprivZks   &$           r   remove_hintsr   ^  sC   HHJ}  eAKKMAIIw3E/		''		''		J q! &&AG  J:&  	4##?$,,??T\\*D  4##DT*# U z !#& r   c                 s    \        V R 4      '       d7   V P                  '       g#   R V P                  9   d   V P                  R  V =R# R# R# r<   N)r   r<   rF   )Zprivate_dictr   r   _pd_delete_empty_subrsr     sE    |W%%l.@.@.@l***$$W- /A%r   c                 sn   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   s   "   T FW  p\        VP                  R 4      '       g   K!  VP                  P                  '       g   K?  VP                  P                  x  KY  	  R# 5ir   )r   rE   r<   r}   r~   r   r   Z,remove_unused_subroutines.<locals>.<genexpr>  sC      &B2::w/ !46JJ4D4D !

  &s   A!A!A!rN   Nfileoffsets)r   rC   rD   r>   r   rM   r   r   rG   r   r   rB   rE   r<   r7   r   rN   r   r   rs   rt   rw   r`   Zitemsr   r   r   )rH   r   rI   r3   rJ   r?   r@   Z	all_subrsZlocal_subrsrd   r/   rK   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)ZfontTools.misc.psCharStringsr    r   r   r   Z	Exceptionr	   r   rA   rL   rM   rQ   rw   rz   r   r   r   r
   r   r   <module>r      sz    	 	N?$6 N?b05- 5 S<- S<l
%P?'4 ?'DH>r   