+
    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                sR   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:NNNZreturnendchar)callsubr	callgsubr)need_hintcountstop_hintcount_opssetattrstop_hint_counthasattrcallingStackr    executer	   _patchesprogramreversedZtypeintr   Zin_cff2indexr   )r   
charStringop_nameZdesubroutinizedidxZ	expansions   &&    r   r!   Z%_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   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_callgsubrr0   r1   r3   r   r5   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   r7   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&   r2   r6   s   &&& r   r0   Z)_DesubroutinizingT2Decompiler.processSubr[   s@    r"r-..KK'<'<=> /r   )r   )r7   op_cntrmaskZ
op_rmovetoZ
op_hmovetoZ
op_vmovetor   )r   r   r   r   r   r   r!   r/   r5   r   r7   r0   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#   )r6   subrs
decompilers   &  r   desubroutinizeCharStringrD   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valuesrD   r   rE   Privater?   rawDictGlobalSubrsZclear)cffZfontNamefontr6   cfdZpds   &      r   desubroutinizerO   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   rQ   )r   r   r   r   rB   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   rQ   addr-   r.   r    r/   r8   r9   r   r/   Z _MarkingT2Decompiler.op_callsubr   s<    !!$"3"3B"7$.."HI&&t3r   c                rR   r+   )r   rQ   rS   r-   r4   r    r5   r8   r9   r   r5   Z!_MarkingT2Decompiler.op_callgsubr   s>    ""4#4#4R#84??#JK''4r   r
   N)	r   r   r   r   r   r/   r5   r   r<   r=   r>   r   rP   rP      s     $45 5r   rP   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   )r[   rV   rZ   rX   rW   rY   N)r   r   r   r   r   r   r<   r=   r>   r   HintsrU      s     	 . 	r   r\   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                s   \        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   ra   r\   r   r!   rV   rZ   r]   rS   rY   rangerX   lenr#   
isinstancestrZ__dict__)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>>Y%7%7777 r   c                r*   r+   )r   r-   r.   r   r/   r0   r1   r3   r   r/   Z"_DehintingT2Decompiler.op_callsubr   s@    t004t~~EF$$T1%r   c                r*   r+   )r   r-   r4   r   r5   r0   r1   r3   r   r5   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processHintr8   r9   r   rj   Z_DehintingT2Decompiler.op_hstem       !!$.r   c                ri   r   )r   op_vstemrk   r8   r9   r   rm   Z_DehintingT2Decompiler.op_vstem   rl   r   c                ri   r   )r   
op_hstemhmrk   r8   r9   r   rn   Z!_DehintingT2Decompiler.op_hstemhm       ##D0r   c                ri   r   )r   
op_vstemhmrk   r8   r9   r   rp   Z!_DehintingT2Decompiler.op_vstemhm   ro   r   c                T    \         P                  ! W4      pV P                  V4       V# r   )r   r7   processHintmaskr   r&   Zrvr3   r   r7   Z"_DehintingT2Decompiler.op_hintmask   %    ))$6U#	r   c                rq   r   )r   r;   rr   rs   r3   r   r;   Z"_DehintingT2Decompiler.op_cntrmask   rt   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    ra   rZ   rY   rb   rX   rd   r#   re   rV   rW   )r   r&   r6   rf   rg   rh   r   rr   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# ru   )r    ra   rV   rW   rX   )r   r&   r6   rf   s   &&  r   rk   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# ru   )r    ra   rY   rb   rX   rd   r#   re   rV   rW   r[   r:   Zmax)r   r&   r2   r6   rf   Z
subr_hintsrg   s   &&&    r   r0   Z"_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   Zobjectr\   r   r!   r/   r5   rj   rm   rn   rp   r7   r;   rr   rk   r0   r   r<   r=   r>   r   rT   rT      sW      480&
&
    

'"#< <r   rT   c                 sv   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#   rb   rc   rd   r%   rQ   r&   	_old_bias	_new_bias)
charstringrB   Zgsubrsprg   s   &&&  r   _cs_subset_subroutinesrz   )  s    A1c!f4:aAh,,,,{{((q5EOO)CDuVA!eHT[ aAh,,,,""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                  '       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)ZhintmaskZcntrmask)ra   r[   r#   r$   rV   rW   r:   r   r|   r   r`   Zinsertr_   rZ   rc   )rx   rf   ry   r)   rg   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                s$    V ^8  d   QhR\         /# )r{   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?   rE   c              3   s8   "   T F  qP                   x  K  	  R # 5ir   )rH   Z.0rN      & 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)keysrF   r   rG   r@   rA   r   rT   r   r_   r`   r!   r|   r}   r   extendrE   r:   rH   r   remove_unused_subroutines)rK   r~   fontnamerL   r6   r^   rM   rB   rC   rx   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?   rI   )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?   rE   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   rH   r?   r   r   r   r   Z,remove_unused_subroutines.<locals>.<genexpr>  sC      &B2::w/ !46JJ4D4D !

  &s   A!A!A!rQ   Nfileoffsets)r   rF   rG   rA   r   rP   r   r!   rJ   r   r   rE   rH   r?   r:   r   rQ   r   r   rv   rw   rz   rc   Zitemsr   r   r   )rK   r   rL   r6   rM   rB   rC   Z	all_subrsZlocal_subrsrg   r2   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)ZfontTools.misc.psCharStringsr    r   r   r   Z	Exceptionr	   r   rD   rO   rP   rT   rz   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   