+
    i                        ^ RI Ht ^ RIHt ^ RIHtHtHtHt ]	]
]
3,          tRR R llt]R8X  d   ^ RIt]P                  ! 4        R# R# )	    )annotations)Optional)KerningPairKerningDictKerningGroupsIntFloatNc               4    V ^8  d   QhRRRRRRRRR	R
RR
RR/# )   pairr   kerningr   groupsr   fallbackr   glyphToFirstGroupzOptional[StrDict]glyphToSecondGroupreturn )formats   "x/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/fontTools/ufoLib/kerning.py__annotate__r   
   sW     } }
}} } 	}
 )} *} }    c                   W9   d	   W,          # VRJ VRJ 8w  d   \        R4      hVfj   / p/ pVP                  4        FQ  w  rgVP                  R4      '       d   V F  pWdV&   K	  	  K+  VP                  R4      '       g   KD  V F  pWeV&   K	  	  KS  	  Vf   Q hVf   Q hV w  rR;rV	P                  R4      '       d   T	pRpMVP                  V	4      pT	pV
P                  R4      '       d   T
pRpMVP                  V
4      pT
pW3 UUu. uF  pW3 F  pVf   K	  Vf   K  VV3NK  	  K  	  pppV F  p W9   g   K  W,          u # 	  V# u uppi )a  Retrieve the kerning value (if any) between a pair of elements.

The elments can be either individual glyphs (by name) or kerning
groups (by name), or any combination of the two.

Args:
  pair:
      A tuple, in logical order (first, second) with respect
      to the reading direction, to query the font for kerning
      information on. Each element in the tuple can be either
      a glyph name or a kerning group name.
  kerning:
      A dictionary of kerning pairs.
  groups:
      A set of kerning groups.
  fallback:
      The fallback value to return if no kern is found between
      the elements in ``pair``. Defaults to 0.
  glyphToFirstGroup:
      A dictionary mapping glyph names to the first-glyph kerning
      groups to which they belong. Defaults to ``None``.
  glyphToSecondGroup:
      A dictionary mapping glyph names to the second-glyph kerning
      groups to which they belong. Defaults to ``None``.

Returns:
  The kerning value between the element pair. If no kerning for
  the pair is found, the fallback value is returned.

Note: This function expects the ``kerning`` argument to be a flat
dictionary of kerning pairs, not the nested structure used in a
kerning.plist file.

Examples::

  >>> groups = {
  ...     "public.kern1.O" : ["O", "D", "Q"],
  ...     "public.kern2.E" : ["E", "F"]
  ... }
  >>> kerning = {
  ...     ("public.kern1.O", "public.kern2.E") : -100,
  ...     ("public.kern1.O", "F") : -200,
  ...     ("D", "F") : -300
  ... }
  >>> lookupKerningValue(("D", "F"), kerning, groups)
  -300
  >>> lookupKerningValue(("O", "F"), kerning, groups)
  -200
  >>> lookupKerningValue(("O", "E"), kerning, groups)
  -100
  >>> lookupKerningValue(("O", "O"), kerning, groups)
  0
  >>> lookupKerningValue(("E", "E"), kerning, groups)
  0
  >>> lookupKerningValue(("E", "O"), kerning, groups)
  0
  >>> lookupKerningValue(("X", "X"), kerning, groups)
  0
  >>> lookupKerningValue(("public.kern1.O", "public.kern2.E"),
  ...     kerning, groups)
  -100
  >>> lookupKerningValue(("public.kern1.O", "F"), kerning, groups)
  -200
  >>> lookupKerningValue(("O", "public.kern2.E"), kerning, groups)
  -100
  >>> lookupKerningValue(("public.kern1.X", "public.kern2.X"), kerning, groups)
  0
NzKMust provide both 'glyphToFirstGroup' and 'glyphToSecondGroup', or neither.zpublic.kern1.zpublic.kern2.)
ValueErroritems
startswithget)r   r   r   r   r   r   groupgroupMembersglyphfirstsecond
firstGroupsecondGroup
firstGlyphsecondGlyphabpairss   &&&&&&            r   lookupKerningValuer(   
   s   Z }T!'9T'ABY
 	
  #)<<>E00)E/4e, *!!/22)E05u- * $2 ((()))ME##J((

&**51

))(,,V4 ))A+A 	  	A+ 	) 
  ?=   Os   	E
E
 E
__main__)r   NN)
__future__r   typingr   fontTools.annotationsr   r   r   r   dictstrStrDictr(   __name__doctesttestmodr   r   r   <module>r3      sA    "  S S
sCx.}@ zOO r   