
    (?e	                     f    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
dS )z"
Low-level text helper utilities.
    N   )_api)KERNING_DEFAULTLOAD_NO_HINTING
LayoutItem)	ft_objectchar	glyph_idxx	prev_kernc           	         t          j        d                    | t          |                               dd                              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nd| cxk    rdk    rn ndnmd| cxk    rdk    rn ndn[d| cxk    rdk    rn ndnId| cxk    rdk    rn ndn7d| 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)           d S d S )*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     8lib/python3.11/site-packages/matplotlib/_text_helpers.pywarn_on_missing_glyphr$      st   299	NN!!'=99@@II	K 	KL L L  9666666666XX9666666666XX#y::::F:::::\\ I777777777YY!Y8888&88888ZZ!Y8888&88888ZZ)5555v55555WW)5555v55555WW9666666666XX I777777777YY"i9999699999[[ I777777777YY 
  HFUFFF	H 	H 	H 	H 	HH H    )	kern_modec             #     K   d}d}|                     |           }|}| D ]}|                    ||          }|                    t          |                    }||                    |||          dz  nd}	||	z  }|                    |t                    }
t          |||||	          V  ||
j        dz  z  }|}dS )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0''D		22	 ) !!.)YGG"LL/1 	 	
T		AAtY488888	U$u,,"# #r%   )__doc__dataclasses r   ft2fontr   r   make_dataclassr   r$   r8    r%   r#   <module>r?      s               5 5 5 5 5 5 5 5 (['FFFH H
H H H. '6 $# $# $# $# $# $# $#r%   