+
    5i#                         ^ RI t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHtH	t	 ^ RI
HtHtHtHtHtHtHtHt ^ RIHt ^RIHt R R	 ltR
 R ltR R ltR R lt]R R l4       tR R ltRR R lltRR R lltR# )    N)contextmanager)unified_diff)Pool	cpu_count)AnyCallableIterableIteratorListOptionalTextTuple)TTFont)get_file_modtimec                &   V ^8  d   QhR\         R\         R\         R\        \        \         ,          ,          R\        \        \         ,          ,          R\        R\        R\        R	\
        \         \         \         \         \         \         3,          /	# )
   
filepath_a
filepath_b
tmpdirpathinclude_tablesexclude_tablesfont_number_afont_number_buse_multiprocessreturn)r   r   r   intboolr   )formats   "Y/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/fontTools/diff/diff.py__annotate__r       s     W WWW W T$Z(	W
 T$Z(W W W W 4tT4-.W    c           	          \        W4      w  rr\        WR 7      p\        WR 7      p\        P                  P	                  VR4      p\        P                  P	                  VR4      p\        VVVVVVV4       WWW3# ))
fontNumberzleft.ttxz	right.ttx)_get_pre_post_pathsr   ospathjoin_mp_save_ttx_xml)r   r   r   r   r   r   r   r   post_pathnamepostpathpre_pathnameprepathtt_lefttt_rightleft_ttxpathright_ttxpaths   &&&&&&&&        r   _get_fonts_and_save_xmlr1      s     6I62M\ W7Gh9H77<<
J7LGGLL[9M }VVr!   c          
      r    V ^8  d   QhR\         R\         R\        \         \         \         \         3,          /# )r   r   r   r   )r   r   )r   s   "r   r    r    2   s4     : ::: 4tT!":r!   c                     T pTpT pTpWSWB3# N )r   r   r,   r*   r+   r)   s   &&    r   r$   r$   2   s#     GHLML99r!   c                    V ^8  d   QhR\         R\         R\        R\        R\        \        \        ,          ,          R\        \        \        ,          ,          R\        RR	/# )
r   r-   r.   r/   r0   r   r   r   r   Nr   r   r   r   r   )r   s   "r   r    r    =   st     R RRR R 	R
 T$Z(R T$Z(R R 
Rr!   c                    V'       dM   \        4       ^8  d>   WWT3WWT3.p\        ^R7      ;_uu_ 4       pVP                  \        V4       RRR4       R# \        WWT4       \        WWT4       R#   + '       g   i     R# ; i)   )	processesN)r   r   starmap_ttfont_save_xml)	r-   r.   r/   r0   r   r   r   mp_args_listpools	   &&&&&&&  r   r(   r(   =   sp     IK!O NCnE
 A$LL)<8  	O.Q s   A//B 	c          
          V ^8  d   QhR\         R\        R\        \        \        ,          ,          R\        \        \        ,          ,          R\        /# )r   ttffilepathr   r   r   r7   )r   s   "r   r    r    Y   sL      	 T$Z( T$Z(	
 
r!   c                ,    V P                  WVR7       R# )z;Writes TTX specification formatted XML to disk on filepath.)tables
skipTablesT)saveXML)r@   rA   r   r   s   &&&&r   r<   r<   Y   s     KKNKKr!   c                0   V ^8  d   QhR\         R\         R\        \        \         ,          ,          R\        \        \         ,          ,          R\        R\        R\        R\
        \        \         \         \         \         \         \         3,          ,          /# )	r   r   r   r   r   r   r   r   r   )r   r   r   r   r   r
   r   )r   s   "r   r    r    e   s     
 


 T$Z(
 T$Z(	

 
 
 
 eD$dD$678
r!   c              #      "   \         P                  ! 4       ;_uu_ 4       p\        V VVVVVVV4      x  R R R 4       R #   + '       g   i     R # ; i5ir4   )tempfileTemporaryDirectoryr1   )r   r   r   r   r   r   r   r   s   &&&&&&& r   _saved_ttx_filesrJ   d   sK      
	$	$	&	&*%	
 		
 
'	&	&	&s   A?
AA	
	Ac                ^   V ^8  d   QhR\         R\         R\        \        \         ,          ,          R\        \        \         ,          ,          R\        R\        R\        R\
        \         \         \         \         \         \         .\        \         ,          3,          R	\        \         ,          /	# )
r   r   r   r   r   r   r   r   create_differr   )r   r   r   r   r   r   r	   r
   )r   s   "r   r    r    {   s     !
 !
!
!
 T$Z(!
 T$Z(	!

 !
 !
 !
 T4tT4@(4.PQ!
 d^!
r!   c           
   #      "   \        V VVVVVV4      ;_uu_ 4       w  pp	p
pppV! VV	V
VVV4       R j  xL
  R R R 4       R #  L  + '       g   i     R # ; i5ir4   )rJ   )r   r   r   r   r   r   r   rL   r/   r0   r+   r,   r)   r*   s   &&&&&&&&      r   _diff_with_saved_ttx_filesrN   {   s      

 

 
 	
 	
!
 
 	
!
 
 
s+   AAAA
AAA		Ac                    V ^8  d   QhR\         R\         R\        R\        \        \         ,          ,          R\        \        \         ,          ,          R\        R\        R\        R	\
        \         ,          /	# )
r   r   r   context_linesr   r   r   r   r   r   )r   r   r   r   r   r
   )r   s   "r   r    r       sx     ? ??? ? T$Z(	?
 T$Z(? ? ? ? d^?r!   c           
   #  Z   a"   R V3R llp\        V VVVVVVV4       Rj  xL
  R#  L5i)av  Performs a unified diff on a TTX serialized data format dump of font binary data using
a modified version of the Python standard libary difflib module.

filepath_a: (string) pre-file local file path
filepath_b: (string) post-file local file path
context_lines: (int) number of context lines to include in the diff (default=3)
include_tables: (list of str) Python list of OpenType tables to include in the diff
exclude_tables: (list of str) Python list of OpentType tables to exclude from the diff
use_multiprocess: (bool) use multi-processor optimizations (default=True)

include_tables and exclude_tables are mutually exclusive arguments.  Only one should
be defined

:returns: Generator of ordered diff line strings that include newline line endings
:raises: KeyError if include_tables or exclude_tables includes a mis-specified table
that is not included in filepath_a OR filepath_b
c                    V ^8  d   QhR\         R\         R\         R\         R\         R\         R\        \         ,          /# )r   r/   r0   r+   r,   r)   r*   r   r   r	   )r   s   "r   r    u_diff.<locals>.__annotate__   sR     
 


 
 	

 
 
 
$
r!   c           
   3   p  <"   \        V 4      ;_uu_ 4       pVP                  4       pR R R 4       \        V4      ;_uu_ 4       pVP                  4       p	R R R 4       \        V4      p
\        V4      p\        XX	VVV
VSR7       R j  xL
  R #   + '       g   i     Ln; i  + '       g   i     LU; i L,5i)N)n)open	readlinesr   r   )r/   r0   r+   r,   r)   r*   ff	fromlinestftolinesfromdatetodaterP   s   &&&&&&      r   _create_unified_diff$u_diff.<locals>._create_unified_diff   s      ,2I  -  BllnG ! $G,!(+
 	
 	
    	
s?   B6BB6B!3B6B4B6B	B6!B1	,	B6NrN   )	r   r   rP   r   r   r   r   r   r_   s	   &&f&&&&& r   u_diffrb      s<     8
 
4 *	 	 	s   +)+c                   V ^8  d   QhR\         R\        \         ,          R\         R\         R\        \        \         ,          ,          R\        \        \         ,          ,          R\        R\        R	\        R
\
        \         ,          /
# )r   	diff_tool	diff_argsr   r   r   r   r   r   r   r   )r   r   r   r   r   r
   )r   s   "r   r    r       s     > >>Dz> > 	>
 T$Z(> T$Z(> > > > d^>r!   c	           
   #  ^   a a"   R VV 3R llp	\        VVVVVVVV	4       Rj  xL
  R#  L5i)a  Performs a unified diff on a TTX serialized data format dump of font binary data using
an external diff executable that is requested by the caller via `command`

diff_tool: (string) command line executable string
diff_args: (list of strings) arguments for the diff tool
filepath_a: (string) pre-file local file path
filepath_b: (string) post-file local file path
include_tables: (list of str) Python list of OpenType tables to include in the diff
exclude_tables: (list of str) Python list of OpentType tables to exclude from the diff
use_multiprocess: (bool) use multi-processor optimizations (default=True)

include_tables and exclude_tables are mutually exclusive arguments.  Only one should
be defined

:returns: Generator of ordered diff line strings that include newline line endings
:raises: KeyError if include_tables or exclude_tables includes a mis-specified table
that is not included in filepath_a OR filepath_b
:raises: IOError if exception raised during execution of `command` on TTX files
c                    V ^8  d   QhR\         R\         R\         R\         R\         R\         R\        \         ,          /# )r   r/   r0   _pre_pathname_prepath_post_pathname	_postpathr   rS   )r   s   "r   r    'run_external_diff.<locals>.__annotate__  sR        	
   
$r!   c              3   (  <"   S.S
,           W.,           p\         P                  ! V\         P                  \         P                  R R7      pVP                   F  pVx  K	  	  VP                  P                  4       p	V	'       d   \        V	4      hR# 5i)utf8)stdoutstderrencodingN)
subprocessPopenPIPEro   rp   readIOError)r/   r0   rh   ri   rj   rk   commandprocesslineerrre   rd   s   &&&&&&    r   _create_external_diff0run_external_diff.<locals>._create_external_diff  sy      +	)\,II""????	
 NNDJ #nn!!##, s   BBBNra   )
rd   re   r   r   r   r   r   r   r   r{   s
   ff&&&&&&& r   run_external_diffr}      s<     > , *	 	 	s    -+-)   NNr   T)NNr   r   T)r%   rr   rH   
contextlibr   difflibr   multiprocessingr   r   typingr   r   r	   r
   r   r   r   r   fontTools.ttLibr   utilsr   r1   r$   r(   r<   rJ   rN   rb   r}   r5   r!   r   <module>r      sf    	   %   + Q Q Q " #W<:R8 
 
,!
V?D> >r!   