ó
    oñ:iä  ã                  ó¨   • S SK Jr  S SKJr  S SKJrJrJrJr  \	\
\
4   r   S             SS jjr\S:X  a  S SKr\R                  " 5         gg)	é    )Úannotations)ÚOptional)ÚKerningPairÚKerningDictÚKerningGroupsÚIntFloatNc                ó|  • X;   a  X   $ USL USL :w  a  [        S5      eUcg  0 n0 nUR                  5        HO  u  pgUR                  S5      (       a  U H  nXdU'   M	     M*  UR                  S5      (       d  MB  U H  nXeU'   M	     MQ     Uc   eUc   eU u  pšS=p¼U	R                  S5      (       a  U	nSnOUR                  U	5      nU	nU
R                  S5      (       a  U
nSnOUR                  U
5      nU
nXÛ4 VVs/ s H  nXì4  H  nUc  M  Uc  M  UU4PM     M     nnnU H  n X;   d  M
  X   s  $    U$ s  snnf )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)ÚpairÚkerningÚgroupsÚfallbackÚglyphToFirstGroupÚglyphToSecondGroupÚgroupÚgroupMembersÚglyphÚfirstÚsecondÚ
firstGroupÚsecondGroupÚ
firstGlyphÚsecondGlyphÚaÚbÚpairss                     Ú[/srv/projetos/modelo_ml_acdoc/venv/lib/python3.13/site-packages/fontTools/ufoLib/kerning.pyÚlookupKerningValuer!   
   s˜  € ðZ ƒØ‰}Ðà˜TÐ!Ð'9¸TÐ'AÓBÜØYó
ð 	
ð Ñ ØÐØÐØ#)§<¡<¦>ÑˆEØ×Ñ ×0Ñ0Û)�EØ/4 eÓ,ó *à×!Ñ! /×2Ó2Û)�EØ05 uÓ-ó *ñ $2ð Ñ(Ð(Ð(ØÑ)Ð)Ð)à�M€EØ#Ð#€JØ×Ñ˜×(Ñ(Øˆ
Ø‰
à&×*Ñ*¨5Ó1ˆ
Øˆ
Ø×Ñ˜×)Ñ)ØˆØ‰à(×,Ñ,¨VÓ4ˆØˆð Ñ)ôâ)ˆAØÔ+ˆAØó 	ð ó 	ˆˆA‹á+ñ 	Ù)ð 
ñ ó ˆØ�?Ø‘=Ò ñ ð €Oùós   Ã<D8ÄD8ÄD8Ú__main__)r   NN)r   r   r   r   r   r   r   r   r   úOptional[StrDict]r   r#   Úreturnr   )Ú
__future__r   Útypingr   ÚfontTools.annotationsr   r   r   r   ÚdictÚstrÚStrDictr!   Ú__name__ÚdoctestÚtestmod© ó    r    Ú<module>r0      s•   ðÝ "å ç SÓ Sà
ˆs�Cˆx‰.€ð Ø+/Ø,0ð}Ø
ð}àð}ð ð}ð ð	}ð
 )ð}ð *ð}ð õ}ð@ ˆzÓÛà‡O‚OÕð r/   