B
    Mô`  ã               @   s&   d Z ddlmZmZ edœdd„ZdS )z
Text layouting utilities.
é   )ÚKERNING_DEFAULTÚLOAD_NO_HINTING)Ú	kern_modec      	      c   sx   d}d}xj| D ]b}|  t|ƒ¡}|dk	r6| |||¡ndd }||7 }|j|td�}||fV  ||jd 7 }|}qW 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
    é    Né@   )Úflagsi   )Zget_char_indexÚordZget_kerningZ
load_glyphr   ZlinearHoriAdvance)	ÚstringÚfontr   ÚxZlast_glyph_idxÚcharZ	glyph_idxÚkernZglyph© r   ú;/tmp/pip-unpacked-wheel-0c1wfn4v/matplotlib/_text_layout.pyÚlayout   s    

r   N)Ú__doc__Zft2fontr   r   r   r   r   r   r   Ú<module>   s   