+
    i(                         R t Rt^ RIHt ^ RIHt ^ RIHt ^ RIH	t	H
t
 ^ RIHt ^ RIHt ^ RIHtHtHtHtHtHtHt R	tR
 R ltR R lt ! R R]	4      t]! RR7       ! R R]4      4       t]! RR7       ! R R]4      4       t/ ]P:                  ^3]! 4       .b]P:                  ^3]! RR7      .b]P<                  ^3]! RR7      .b]P>                  R3]! RRR7      .b]P<                  ^3]! 4       .b]P@                  ^3]! RR7      .b]PB                  ^3]! RRR 7      ]! R!R"R 7      .b]PD                  ^3]! RRR 7      ]! R#R$R 7      .b]PF                  ^3]! R%R&R 7      ]! R'R(R 7      .b]PH                  ^3]! R)R7      .b]PH                  ^3]! 4       .b]PH                  ^3]! 4       .b]PJ                  ^3]! R*R7      .b]PJ                  ^3]! 4       .b]PJ                  ^3]! R+R,7      ]! R-R,7      ]! R.R,7      .b]PL                  ^3]! R/R7      .b]PL                  ^3]! 4       .b]PL                  ^3]! 4       .]PN                  ^3]! R0R7      .]PN                  ^3]! 4       .]PN                  ^3]! R+R,7      ]! R-R,7      ]! R.R,7      .]PP                  ^3]! R1R7      ]! R+R,7      ]! R.R,7      .]PR                  R3]! R2R7      .]PT                  R3]! R3R7      .]PV                  R3]! 4       .]PX                  R3]! R4R,7      .]PZ                  R3]! R5R7      .]P\                  R3]! R6R7R 7      .]P^                  R3]! R8R9R 7      .]P`                  R3]! R:R;R 7      ]! R<R=R 7      ./Ct1]]Pd                  Pf                  R>3,          t4R? R@ lt5]]]4,          ]]4,          .R3,          t6RA RB lt7RC RD lt8R# )EzReorder glyphs in a font.zRod Sheeter)ttLib)otBase)otTables)ABCabstractmethod)	dataclass)deque)OptionalAnyCallableDequeIterableListTupleCoveragec                    V ^8  d   QhR\         \        .\        3,          R\        \        ,          R\        \        \
        ,          ,          /# )   get_glyph_idglyphsparallel_list)r   strintr   r	   r
   )formats   "}/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/fontTools/ttLib/reorderGlyphs.py__annotate__r      s>      C5#:&I DI&    c                    a  V'       d@   \        R  \        W4       4       V 3R lR7      p\        \        \        V!  4      w  rEWRR&   M\        VS R7      pWAR&   R# )c              3   ,   "   T F
  w  rW3x  K  	  R # 5iN ).0ges   &  r   	<genexpr>_sort_by_gid.<locals>.<genexpr>$   s     ; :aV :s   c                 "   < S! V ^ ,          4      # )    r   )tr   s   &r   <lambda>_sort_by_gid.<locals>.<lambda>%   s    ,qt,r   key:NNNN)sortedzipmaplist)r   r   r   	reorderedsorted_glyphssorted_parallel_lists   f&&   r   _sort_by_gidr3      sR    
 ;F :;,
	 /2$Y.H+/av<81Ir   c                <    V ^8  d   QhR\         R\        R\         /# )r   valuedotted_attrreturn)r
   r   )r   s   "r   r   r   /   s!      C c c r   c                     VP                  R 4      pV'       g   Q hV'       d   VP                  ^ 4      p\        W4      p K&  V # ).)splitpopgetattr)r5   r6   
attr_names	attr_names   &&  r   _get_dotted_attrr?   /   s:    ""3'J:
NN1%	)Lr   c                   @   a  ] tR t^9t o Rt]V 3R lR l4       tRtV tR# )ReorderRulezEA rule to reorder something in a font to match the fonts glyph order.c                R   < V ^8  d   QhRS[ P                  RS[P                  RR/# r   fontr5   r7   Nr   TTFontr   	BaseTable)r   __classdict__s   "r   r   ReorderRule.__annotate__=   s"    MM%,,Mv/?/?MDMr   c                    R # r   r   )selfrD   r5   s   &&&r   applyReorderRule.apply<   s    JMr   r   N)	__name__
__module____qualname____firstlineno____doc__r   rL   __static_attributes____classdictcell__rH   s   @r   rA   rA   9   s     OM Mr   rA   T)frozenc                   J   a  ] tR t^@t o RtRt]tV 3R lR ltV 3R lt	Rt
V tR# )ReorderCoveragezNReorder a Coverage table, and optionally a list that is sorted parallel to it.Nc                R   < V ^8  d   QhRS[ P                  RS[P                  RR/# rC   rE   )r   rH   s   "r   r   ReorderCoverage.__annotate__H   s1     K K%,, Kv/?/? KD Kr   c                   \        W P                  4      p\        V4      \        Jd   R pV P                  '       dg   \        W P                  4      p\        V4      \        J g   Q V P                   R24       h\        V4      \        VP                  4      8X  g   Q R4       h\        VP                  VP                  V4       R # V P                  '       d   Q RV  24       hV F$  p\        VP                  VP                  R 4       K&  	  R # )N should be a listzNothing makes sensez2Can't have multiple coverage AND a parallel list; )	r?   coverage_attrtyper/   parallel_list_attrlenr   r3   
getGlyphID)rK   rD   r5   coverager   coverage_entrys   &&&   r   rL   ReorderCoverage.applyH   s    #E+=+=>>% M&&& 08O8O P'4/A--..?@A/=)S-AAXCXXA(//=I
 +++KCD6JK+"*T__n.C.CTJ #+r   c                B   < V ^8  d   Qh/ S[ S[,          ;R&   S[;R&   # )r   r_   r]   )r	   r   )r   rH   s   "r   r   rZ   @   s#     
 !,  ' r   r   )rN   rO   rP   rQ   rR   r_   _COVERAGE_ATTRr]   rL   __annotate_func__rS   rT   rU   s   @r   rX   rX   @   s(     X )-'MK K  r   rX   c                   B   a  ] tR t^`t o RtV 3R lR ltV 3R ltRtV tR# )ReorderLista+  Reorder the items within a list to match the updated glyph order.

Useful when a list ordered by coverage itself contains something ordered by a gid.
For example, the PairSet table of https://docs.microsoft.com/en-us/typography/opentype/spec/gpos#lookup-type-2-pair-adjustment-positioning-subtable.
c                R   < V ^8  d   QhRS[ P                  RS[P                  RR/# rC   rE   )r   rH   s   "r   r   ReorderList.__annotate__k   s1     F F%,, Fv/?/? FD Fr   c                   a a \        VS P                  4      p\        V\        4      '       g   Q S P                   R 24       hVP	                  VV 3R lR7       R# )r\   c                 N   < SP                  \        V SP                  4      4      # r   )ra   r<   r+   )vrD   rK   s   &r   r(   #ReorderList.apply.<locals>.<lambda>n   s    twq$((/CDr   r*   N)r?   	list_attr
isinstancer/   sort)rK   rD   r5   lsts   ff& r   rL   ReorderList.applyk   sG    udnn5#t$$J(88I&JJ$DEr   c                2   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   # )r   rp   r+   )r   )r   rH   s   "r   r   rk   `   s      N  
H r   r   N)	rN   rO   rP   rQ   rR   rL   rg   rS   rT   rU   s   @r   ri   ri   `   s     F F  r   ri   Value)r_   PairSetNPairValueRecordSecondGlyphr*   EntryExitRecordMarkCoveragezMarkArray.MarkRecord)r]   r_   BaseCoveragezBaseArray.BaseRecordLigatureCoveragezLigatureArray.LigatureAttachMark1CoveragezMark1Array.MarkRecordMark2CoveragezMark2Array.Mark2Record
PosRuleSetChainPosRuleSetBacktrackCoverage)r]   InputCoverageLookAheadCoverage
SubRuleSetChainSubRuleSet
SubstituteAttachPointLigGlyphExtendedShapeCoverageItalicsCorrectionTopAccentCoverageTopAccentAttachmentMathKernCoverageMathKernInfoRecordsVertGlyphCoverageVertGlyphConstructionHorizGlyphCoverageHorizGlyphConstruction.c                f    V ^8  d   QhR\         P                  R\        R\        \        ,          /# )r   rootroot_accessorr7   )r   rG   r   r   SubTablePath)r   s   "r   r   r      s/      


+.lr   c              #   <   "   \        WR  4       Rj  xL
  R#  L5i)c                 $    V P                  V4      # r   )extend)frontiernews   &&r   r(   !_bfs_base_table.<locals>.<lambda>   s    8??33Gr   N)_traverse_ot_data)r   r   s   &&r   _bfs_base_tabler      s      !G  s   c          	      r    V ^8  d   QhR\         P                  R\        R\        R\        \
        ,          /# )r   r   r   add_to_frontier_fnr7   )r   rG   r   AddToFrontierFnr   r   )r   s   "r   r   r      s7     2 2


2+.2DS2l2r   c              #   T  "   \        4       pVP                  \        P                  P	                  W4      34       V'       dc   VP                  4       pVR,          P                  pVx  . pVP                  4        F  pVP                  WG3,           4       K  	  V! W64       Kj  R# 5i)   N)r   appendr   rG   SubTableEntrypopleftr5   iterSubTables)r   r   r   r   pathcurrentnew_entriessubtable_entrys   &&&     r   r   r      s     
 %*GHOOV%%33MHJK
!r(..
%335Nt&778 6 	81 s   AB(A$B(c                Z    V ^8  d   QhR\         P                  R\        \        ,          /# )r   rD   new_glyph_order)r   rF   r   r   )r   s   "r   r   r      s"     ) ) )tCy )r   c           	        a  S P                  4       p\        V4      \        V4      8w  d%   \        R \        V4       R\        V4       R24      h\        V4      \        V4      8w  dD   \        R\        V4      \        V4      ,
           R\        V4      \        V4      ,
           24      hS P	                  4        \        V 3R lS P                  4        4       4      pV'       d   \        RV 24      hS P                  V4       0 RmpV F  pVS P                  4       9   g   K  \        S V,          P                  RV R24       F]  pVR,          P                  p\        V4      \        VR	R
4      3p\        P                  V. 4       F  p	V	P                  S V4       K  	  K_  	  K  	  R F  pVS 9   g   K  S V,          p
V
P                   P"                  ^ ,          P$                  P&                  pWP                   P"                  ^ ,          n        V Uu/ uF  qVP                  V4      bK  	  upV
P                   P"                  ^ ,          P$                  n        K  	  R
# u upi )zNew glyph order contains z glyphs, but font has z glyphszTNew glyph order does not contain the same set of glyphs as the font:
* only in new: z
* only in old: c              3   Z   <"   T F   pSP                  V4      '       d   K  Vx  K"  	  R # 5ir   )isLoaded)r    r'   rD   s   & r   r#    reorderGlyphs.<locals>.<genexpr>  s     G;admmA6F;s   +
+z/Everything should be loaded, following aren't: zfont["z"]FormatN>   GDEFGPOSGSUBMATHr   )zCFF CFF2)getGlyphOrderr`   
ValueErrorsetensureDecompiledr,   keyssetGlyphOrderr   tabler5   r^   r<   _REORDER_RULESgetrL   cfftopDictIndexCharStringscharStringscharset)rD   r   old_glyph_order
not_loadedcoverage_containerstagr   r5   reorder_keyreorder	cff_tablecharstringsks   f&           r   reorderGlyphsr      s   ((*O
?s?33'O(<'= >01:
 	

 ?s?33!/2S5IIJ K!/2S5IIJL
 	
 	G499;GGJJ:,WXX':"$))+'S	6#b9IJR#E{GE8T,JK-11+rBGMM$.  C K #  $;S	I#--44Q7CCOOK4CMM&&q)1/>E/>!;??1%%EIMM&&q)55A  
Es   I%)9rR   
__author__	fontToolsr   fontTools.ttLib.tablesr   r   otabcr   r   dataclassesr   collectionsr   typingr	   r
   r   r   r   r   r   rf   r3   r?   rA   rX   ri   	SinglePosPairPosrw   
CursivePosMarkBasePos
MarkLigPosMarkMarkPos
ContextPosChainContextPosContextSubstChainContextSubstReverseChainSingleSubst
AttachListLigCaretListMarkGlyphSetsDefMathGlyphInfoMathItalicsCorrectionInfoMathTopAccentAttachmentMathKernInfoMathVariantsr   rG   r   r   r   r   r   r   r   r   r   <module>r      s   
  ) 1 # !    $N# N $Kk K K> $F+ F F$X\\1)*X \\17CDX ZZOoCD	X
 ZZ%6MJKX ZZOo'(X ]]A<MNOX ^^Q(=S	
 	(=S	
	X  ]]A(=S	
 	,=	
	!X2 ^^Q)>U	
 	)>V	
	3XB ]]ALIJCXD ]]A*+EXF ]]A*+GXH oARSTIXJ o/0KXL &9:o6&9:MXX __a?lKLYXZ __a?,-[X\ __a?,-1CT UV1 121&9:o6&9: 
 #<8&9:&9:& ]]DO}MN__doLM$/"3!4t=TUV!!4(+>?+ &-BW	
)
 __d,AV	

 __d-6	
 	.7	
	]Xz V%%33S89 E,/l1CDdJK2*)r   