KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache
System : Linux server112.speedpacket.com 3.10.0-962.3.2.lve1.5.36.el7.x86_64 #1 SMP Mon May 18 02:16:06 EDT 2020 x86_64
User : equistyl ( 1341)
PHP Version : 8.1.30
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/matplotlib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/matplotlib/textpath.pyo
�
r`]c@s�ddlmZddlZddlmZddljZddlmZm	Z	m
Z
mZddlm
Z
ddljZddlZddlZdefd��YZddlmZdd	lmZdd
lmZe�Zdefd��YZdS(
i����(tprint_functionN(tPath(tFT2FonttKERNING_DEFAULTtLOAD_NO_HINTINGtLOAD_TARGET_LIGHT(tMathTextParsert
TextToPathcBs�eZdZdZdZd�Zd�Zd�Zd�Zd�Z	d�Z
d	d
�Zd�Ze
e
d�Zde
d
�Zde
d�Zd�Zde
d�ZRS(sF
    A class that convert a given text to a path using ttf fonts.
    gY@iHcCsMtd�|_d|_ddlm}|d�|_d|_d|_dS(s 
        Initialization
        tpathi����(tmaxdicti2N(	Rtmathtext_parsertNonettex_font_maptmatplotlib.cbookR	t	_ps_fontdt_texmanagert_adobe_standard_encoding(tselfR	((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyt__init__s		cCsPtjd�}tj|�}tgt|j�D]\}}||f^q1�S(Ns8a.enc(tdvireadt
find_tex_filetEncodingtdictt	enumeratetencoding(Rtenc_nametenctitc((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyt_get_adobe_standard_encoding*scCs;tj|�}tt|��}|j|j|j�|S(s"
        find a ttf font.
        (tfont_managertfindfontRtstrtset_sizet
FONT_SCALEtDPI(Rtproptfnametfont((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyt	_get_font/scCstS(N(R(R((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyt_get_hinting_flag9scCs-|j�d}tjd||f�}|S(sO
        Return a unique id for the given font and character-code set.
        iiis%s-%x(iiii(tget_sfntturllibtquote(RR&tccodetps_nametchar_id((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyt_get_char_id<scCs-|j�d}tjd||f�}|S(sY
        Return a unique id for the given font and character-code set (for tex).
        is%s-%d(tget_ps_font_infoR*R+(RR&R,R-R.((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyt_get_char_id_psDsgcCsG|j�\}}|dkr=|dd�dfc|7<n||fS(sB
        convert the ft2font glyph to vertices and codes.
        gNi(tget_path(RR&tcurrxtvertstcodes((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyt
glyph_to_pathMscCsKtdrP|j�}|j�}|j||dd�\}}}|||fS|j�}t|�|j}	|r�|j�}|j|j�|j	j
|d|�\}
}}}
}|
|	||	||	fS|j|�}|j|ddt
�|j�\}}|d:}|d:}|j�}|d:}||	||	||	fS(Nstext.usetextrendereriHgtflagsgP@(trcParamstget_texmanagertget_size_in_pointstget_text_width_height_descentRtfloatR"tcopyR!R
tparseR'tset_textRtget_width_heighttget_descent(RtsR$tismatht
texmanagertfontsizetwthtdtscaletwidththeighttdescentttrashtused_charactersR&((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyR<Vs*

'


cCs9|tkrc|tkrE|j|�}|j||�\}}}q~|j||�\}}}n|j||�\}}}gg}	}
xp|D]h\}}}
}||\}}t|�r�tj|�|||
g}|	j|�|
j|�q�q�Wx.|D]&\}}|	j|�|
j|�qW|	|
fS(sX
        convert text *s* to path (a tuple of vertices and codes for matplotlib.math.Path).

        *prop*
          font property

        *s*
          text to be converted

        *usetex*
          If True, use matplotlib usetex mode.

        *ismath*
          If True, use mathtext parser. Effective only if usetex == False.


        (	tFalseR'tget_glyphs_with_fonttget_glyphs_mathtexttget_glyphs_textlentnptarraytextend(RR$RCRDtusetexR&t
glyph_infot	glyph_maptrectsR4R5tglyph_idt	xpositiont	ypositionRJtverts1tcodes1((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyt
get_text_pathrs"


cCs�|j�}d}d}g}g}	|dkr<t�}n|rNt�}
n|}
x|D]�}t|�}|j|�}
|
dkr�td�}d}
n|dk	r�|j||
t�}nd}|j|dt�}|j	d}|j
||�}||kr|j|�|
|<n||d7}|j|�|	j|�||7}|
}q[Wdgt
|�}dgt
|�}g}t|	|||�|
|fS(sc
        convert the string *s* to vertices and codes using the
        provided ttf font.
        it?R8g�@gP@g�?N(tget_charmapRRtordtgettget_kerningRt	load_charRtlinearHoriAdvanceR/R6tappendRTtzip(RR&RCRZtreturn_new_glyphs_onlytcmaptlastgindR3t
xpositionst	glyph_idst
glyph_map_newRR,tgindtkerntglypht
horiz_advanceR.t
ypositionstsizesR[((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyRQ�sB	
	




cCs&|j�}|j|j�|jj||j|�\}}}}}	|dkr^t�}n|rpt�}
n|}
g}g}g}
g}d\}}x�|D]�\}}}}}|j||�}||kr|j	�|j|j|j�|j
|dt�}|j|�|
|<n|j
|�|j
|�|
j
|�||j}|j
|�q�Wg}x�|	D]�\}}}}||f|||f||||f|||f||fdg}tjtjtjtjtjtjg}|j
||f�qqWt|
|||�|
|fS(s[
        convert the string *s* to vertices and codes by parsing it with mathtext.
        iR8N(ii(ii(R>R!R"R
R?R#RRR/tclearRgRR6RiRtMOVETOtLINETOt	CLOSEPOLYRj(RR$RCRZRkRKRLRMtglyphsR[RpRnRuRoRvR3tcurryR&RFR,toxtoyR.RstsizetmyrectsRGRHtvert1tcode1((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyRR�sD	!




FcCs5|jdkr.ddlm}|�|_n|jS(sO
        return the :class:`matplotlib.texmanager.TexManager` instance
        i����(t
TexManagerN(RRtmatplotlib.texmanagerR�(RR�((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyR:sc)	Csp|j�}|jdkr9tjtjd��|_n|jdkrZ|j�|_n|j�}t	|d�r�|j
||j�}tj||j
�}n*|j||j�}	tj|	|j
�}ztt|��}
Wd|j�X|dkrt�}n|rt�}n|}ggggf\}}
}}xj|
jD]_\}}}}}|jj|j�}|j|j}|dkr�tt|j��}xZd
dgD]2\}}y|j|�Wntk
r�q�XPq�Wd}tjd	|j�|dkrm|jrmtj |j�}tgt!|j�D]'\}}||jj|d�f^q:�}n	t�}||f|j|j<n|\}}t"}|j#||�}||kri|j$�|j%|j|j
�|r�|j|d�} n|} | dk	r$|j&| d
|�}!n/tjd||jf�|j&|d
|�}!|j'|�||<n|j(|�|
j(|�|j(|�|j(|j)|j�qHWg}"x�|
j*D]�\}#}$}%}&|#|$f|#|&|$f|#|&|$|%f|#|$|%f|#|$fdg}'t+j,t+j-t+j-t+j-t+j-t+j.g}(|"j(|'|(f�q�Wt/||
||�||"fS(s^
        convert the string *s* to vertices and codes using matplotlib's usetex mode.
        s
pdftex.maptget_dviNtADOBE_CUSTOMiCBDAtADOBE_STANDARDiBODAts#No supported encoding in font (%s).R8sUThe glyph (%d) of font (%s) cannot be converted with the encoding. Glyph may be wrongi(R�iCBDA(R�iBODA(ii(0R:RRRt
PsfontsMapRRRR;thasattrR�R"tDviFromFileLikeR#tmake_dvitDvitnexttitertcloseRttextRRettexnameRR tfilenametselect_charmapt
ValueErrortwarningstwarnRRRRR1RwR!RgR6RiRtboxesRRxRyRzRj()RR$RCRZRkRERFtdvifileliketdvitdvifiletpageRpRoRnRuRvtx1ty1tdvifontRsRKtfont_and_encodingt
font_bunchR&tcharmap_nametcharmap_codetenc0RRRtft2font_flagR.tcharcodetglyph0R�R}R~RHRGR�R�((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyRSs�
@	



FN(t__name__t
__module__t__doc__R"R#RRR'R(R/R1R6R<RPRaRRQRRR:RS(((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyRs&			
						+<3		(tFontProperties(R9(tAffine2DtTextPathcBszeZdZd
d
ded�Zd�Zd�Zd�Zd�Z	e
e�Ze
e	�Zd�Z
d�Zd	�ZRS(s&
    Create a path from the text.
    ic	Os�|dkrt�}n|dkr3|j�}n||_|j|�d|_|j||d|�\|_|_t	|_
td|_t	|_
||_dS(sK
        Create a path from the text. No support for TeX yet. Note that
        it simply is a path, not an artist. You need to use the
        PathPatch (or other artists) to draw this path onto the
        canvas.

        xy : position of the text.
        s : text
        size : font size
        prop : font property
        RXspath.simplify_thresholdN(RR�R;t_xyR!t_cached_verticesttext_get_vertices_codest	_verticest_codesRPtshould_simplifyR9tsimplify_thresholdt
has_nonfinitet_interpolation_steps(	RtxyRCRR$R�RXtkltkwargs((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyR�s	
	$	
	cCs||_t|_dS(s*
        set the size of the text
        N(t_sizetTruet_invalid(RR((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyR!�s	cCs|jS(s*
        get the size of the text
        (R�(R((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pytget_size�scCs|j�|jS(sH
        Return the cached path after updating it if necessary.
        (t_revalidate_pathR�(R((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyt
_get_vertices�s
cCs|jS(s"
        Return the codes
        (R�(R((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyt
_get_codes�scCsr|js|jdkrnt�j|jtj|jtj�j|j	�}|j
|j�|_t|_ndS(s�
        update the path if necessary.

        The path for the text is initially create with the font size
        of FONT_SCALE, and this path is rescaled to other size when
        necessary.

        N(
R�R�RR�RJR�ttext_to_pathR"t	translateR�t	transformR�RP(Rttr((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyR��s		cCsv|jd�|jd�}|dko5|ddk}tdrL|dfS|r\|tfS|jdd�tfSdS(sM
        Returns True if the given string *s* contains any mathtext.
        t$s\$iistext.usetextTeXN(tcountR9R�treplaceRP(RRCtdollar_countteven_dollars((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pytis_math_text�s


cCsd|r'tj||dt�\}}n3|j|�\}}tj||d|�\}}||fS(s�
        convert the string *s* to vertices and codes using the
        provided font property *prop*. Mostly copied from
        backend_svg.py.
        RXRD(R�RaR�R�(RR$RCRXR4R5t
clean_lineRD((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyR��s
!N(R�R�R�RRPRR!R�R�R�tpropertytverticesR5R�R�R�(((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyR��s#						(t
__future__RR*tmatplotlib.pathRtmatplotlib.font_managerRtmatplotlib.ft2fontRRRRtmatplotlib.mathtextRtmatplotlib.dvireadRtnumpyRUR�tobjectRR�t
matplotlibR9tmatplotlib.transformsR�R�R�(((s9/usr/lib64/python2.7/site-packages/matplotlib/textpath.pyt<module>s"�y	

Anon7 - 2021