
    DVf	                     h    d Z ddlZddlmZ ddlmZmZ  ej                  dg d      Zd Z	ed	d
Z
y)z"
Low-level text helper utilities.
    N   )_api)KERNING_DEFAULTLOAD_NO_HINTING
LayoutItem)	ft_objectchar	glyph_idxx	prev_kernc           	      Z   t        j                  dj                  | t        |       j	                  dd      j                  d                   d| cxk  rdk  rn ndnd| cxk  rdk  rn nd	nd
| cxk  rdk  rn ndnd| cxk  rdk  rn ndnd| cxk  rdk  rn ndnqd| cxk  rdk  rn ndnad| cxk  rdk  rn ndnQd| cxk  rdk  rn ndnAd| cxk  rdk  rn ndn1d| cxk  rd k  rn nd!n!d"| cxk  rd#k  rn nd$nd%| cxk  rd&k  rn nd'nd }|rt        j                  d(| d)       y y )*Nz(Glyph {} ({}) missing from current font.asciinamereplacei  i  Hebrewi   i  Arabici 	  i	  
Devanagarii	  i	  Bengalii 
  i
  Gurmukhii
  i
  Gujaratii   i  Oriyai  i  Tamili   i  Telugui  i  Kannadai   i  	Malayalami  i  Sinhalaz&Matplotlib currently does not support z
 natively.)r   warn_externalformatchrencodedecode)	codepointblocks     a/var/www/html/software/conda/envs/catlas/lib/python3.12/site-packages/matplotlib/_text_helpers.pywarn_on_missing_glyphr$      s%   299	N!!'=9@@I	KL  966X966X#y:F:\ I77Y!Y8&8Z!Y8&8Z)5v5W)5v5W966X I77Y"i969[ I77Y 
 4UG:F	H     )	kern_modec             #   V  K   d}d}|j                  |       }|}| D ]  }|j                  ||      }|j                  t        |            }||j	                  |||      dz  nd}	||	z  }|j                  |t              }
t        |||||	       ||
j                  dz  z  }|} yw)a  
    Render *string* with *font*.  For each character in *string*, yield a
    (glyph-index, x-position) pair.  When such a pair is yielded, the font's
    glyph is set to the corresponding character.

    Parameters
    ----------
    string : str
        The string to be rendered.
    font : FT2Font
        The font.
    kern_mode : int
        A FreeType kerning mode.

    Yields
    ------
    glyph_index : int
    x_position : float
    r   N@   g        )flagsi   )	_get_fontmapgetget_char_indexordget_kerning
load_glyphr   r   linearHoriAdvance)stringfontr&   r   prev_glyph_idxchar_to_font	base_fontr	   r
   kernglyphs              r#   layoutr8   &   s     ( 	
AN$$V,LI #i0''D	2	 ) !!.)YG"L/1 	 	
T		AtY488	U$$u,,"#s   B'B))__doc__dataclasses r   ft2fontr   r   make_dataclassr   r$   r8    r%   r#   <module>r?      s@      5 ([''FH
H. '6 $#r%   