+
    f7i(  c                    s   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TupleZCoveragec                s    V ^8  d   QhR\         \        .\        3,          R\        \        ,          R\        \        \
        ,          ,          /# )   get_glyph_idglyphsparallel_list)r	   strZintr   r   r   format   "D/usr/lib64/python3.14/site-packages/fontTools/ttLib/reorderGlyphs.py__annotate__r      s>      C5#:&I DI&    c                 s   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   s,   "   T F
  w  rW3x  K  	  R # 5iN ).0ZgZes   &  r   	<genexpr>Z_sort_by_gid.<locals>.<genexpr>$   s     ; :aV :s   c                 s"   < S! V ^ ,          4      # )i    r   )tr   s   &r   <lambda>Z_sort_by_gid.<locals>.<lambda>%   s    ,qt,r   key:NNNN)sortedZzipZmaplist)r   r   r   Z	reorderedZsorted_glyphsZsorted_parallel_lists   f&&   r   _sort_by_gidr#      sR    
 ;F :;,
	 /2$Y.H+/av<81Ir   c                s<    V ^8  d   QhR\         R\        R\         /# )r   valuedotted_attrreturn)r   r   r   r   r   r   r   /   s!      C c c r   c                 s    VP                  R 4      pV'       g   Q hV'       d   VP                  ^ 4      p\        W4      p K&  V # )Z.)ZsplitZpopgetattr)r$   r%   Z
attr_namesZ	attr_names   &&  r   _get_dotted_attrr(   /   s:    ""3'J:
NN1%	)Lr   c                   s@   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   fontr$   r&   Nr    TTFontr   	BaseTabler   __classdict__   "r   r   ZReorderRule.__annotate__=   s"    MM%,,Mv/?/?MDMr   c                s    R # r   r   )selfr,   r$   s   &&&r   applyZReorderRule.apply<   s    JMr   r   N)	__name__
__module____qualname____firstlineno____doc__r   r4   __static_attributes____classdictcell__r1      @r   r)   r)   9   s     OM Mr   r)   T)Zfrozenc                   sJ   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*   r+   r-   r0   r2   r   r   ReorderCoverage.__annotate__H   s1     K K%,, Kv/?/? KD Kr   c                s   \        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   r#   
getGlyphID)r3   r,   r$   Zcoverager   Zcoverage_entrys   &&&   r   r4   Z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                sB   < V ^8  d   Qh/ S[ S[,          ;R&   S[;R&   # )r   rC   rA   )r   r   r0   r2   r   r   r?   @   s#     
 !,  ' r   r   )r5   r6   r7   r8   r9   rC   _COVERAGE_ATTRrA   r4   __annotate_func__r:   r;   r<   r=   r   r>   r>   @   s(     X )-'MK K  r   r>   c                   sB   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*   r+   r-   r0   r2   r   r   ReorderList.__annotate__k   s1     F F%,, Fv/?/? FD Fr   c                s   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                 sN   < SP                  \        V SP                  4      4      # r   )rE   r'   r    )Zvr,   r3   s   &r   r   Z#ReorderList.apply.<locals>.<lambda>n   s    twq$((/CDr   r   N)r(   	list_attrZ
isinstancer"   Zsort)r3   r,   r$   Zlsts   ff& r   r4   ZReorderList.applyk   sG    udnn5#t$$J(88I&JJ$DEr   c                s2   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   # )r   rJ   r    )r   r0   r2   r   r   rI   `   s      N  
H r   r   N)	r5   r6   r7   r8   r9   r4   rG   r:   r;   r<   r=   r   rH   rH   `   s     F F  r   rH   ZValue)rC   PairSetNZPairValueRecordZSecondGlyphr   ZEntryExitRecordZMarkCoveragezMarkArray.MarkRecord)rA   rC   ZBaseCoveragezBaseArray.BaseRecordZLigatureCoveragezLigatureArray.LigatureAttachZMark1CoveragezMark1Array.MarkRecordZMark2CoveragezMark2Array.Mark2RecordZ
PosRuleSetZChainPosRuleSetZBacktrackCoverage)rA   ZInputCoverageZLookAheadCoverageZ
SubRuleSetZChainSubRuleSetZ
SubstituteZAttachPointZLigGlyphZExtendedShapeCoverageZItalicsCorrectionZTopAccentCoverageZTopAccentAttachmentZMathKernCoverageZMathKernInfoRecordsZVertGlyphCoverageZVertGlyphConstructionZHorizGlyphCoverageZHorizGlyphConstruction.c                sf    V ^8  d   QhR\         P                  R\        R\        \        ,          /# )r   rootroot_accessorr&   )r   r/   r   r   SubTablePathr   r   r   r   r      s/      


+.lr   c              #   s<   "   \        WR  4       Rj  xL
  R#  L5i)c                 s$    V P                  V4      # r   )Zextend)frontierZnew   &&r   r   Z!_bfs_base_table.<locals>.<lambda>   s    8??33Gr   N)_traverse_ot_data)rL   rM   rP   r   _bfs_base_tablerR      s      !G  s   c          	      sr    V ^8  d   QhR\         P                  R\        R\        R\        \
        ,          /# )r   rL   rM   add_to_frontier_fnr&   )r   r/   r   AddToFrontierFnr   rN   r   r   r   r   r      s7     2 2


2+.2DS2l2r   c              #   sT  "   \        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)i   N)r   Zappendr   r/   SubTableEntryZpopleftr$   ZiterSubTables)rL   rM   rS   rO   pathZcurrentZnew_entriesZsubtable_entrys   &&&     r   rQ   rQ      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                sZ    V ^8  d   QhR\         P                  R\        \        ,          /# )r   r,   new_glyph_order)r    r.   r   r   r   r   r   r   r      s"     ) ) )tCy )r   c           	      s  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   sZ   <"   T F   pSP                  V4      '       d   K  Vx  K"  	  R # 5ir   )ZisLoaded)r   r   r,   s   & r   r   Z reorderGlyphs.<locals>.<genexpr>  s     G;admmA6F;s   +
+z/Everything should be loaded, following aren't: zfont["z"]ZFormatN>   ZGDEFZGPOSZGSUBZMATHrU   )zCFF ZCFF2)ZgetGlyphOrderrD   Z
ValueErrorZsetZensureDecompiledr!   ZkeysZsetGlyphOrderrR   Ztabler$   rB   r'   _REORDER_RULESZgetr4   ZcffZtopDictIndexZCharStringsZcharStringsZcharset)r,   rX   Zold_glyph_orderZ
not_loadedZcoverage_containersZtagrW   r$   Zreorder_keyZreorderZ	cff_tableZcharstringsZks   f&           r   reorderGlyphsrZ      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%)9r9   Z
__author__Z	fontToolsr    ZfontTools.ttLib.tablesr   r   ZotZabcr   r   Zdataclassesr   Zcollectionsr   Ztypingr   r   r	   r
   r   r   r   rF   r#   r(   r)   r>   rH   Z	SinglePosZPairPosrK   Z
CursivePosZMarkBasePosZ
MarkLigPosZMarkMarkPosZ
ContextPosZChainContextPosZContextSubstZChainContextSubstZReverseChainSingleSubstZ
AttachListZLigCaretListZMarkGlyphSetsDefZMathGlyphInfoZMathItalicsCorrectionInfoZMathTopAccentAttachmentZMathKernInfoZMathVariantsrY   r/   rV   rN   rR   rT   rQ   rZ   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   