HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyo
�
�)�Uc@s�dZddlZddlZddlZddlZddlZyeWn!ek
rmddlm	ZnXddl
Z
ddl
mZddl
mZddl
m
Z
mZddlmZddlmZmZyddlZWnek
rddlZnXeZe
jZi
d	d
6dd6d
d6dd6dd6dd6dd6dd6d
d6de6Zi	dd6dd6dd6dd 6d!d"6d#d$6d%d&6d'd(6d)d*6Zidd+6dd,6dd"6dd-6dd.6d!d6d!d/6d#d06d#d16d#d26d%d36d'd46d'd56d)d66Zed7d8d9d:d;d<d=g�Zd>Zd?d@gZ dAdBdCdDgZ!dEdFdGgZ"er�ej#j$dH�Z%e%ek	r�ej&j'e%dIdJ�Z&e"j(e&�ej&j'e%dK�Z&e!j(e&�nndL�Z)dM�Z*edNdO�Z+dP�Z,edNdQ�Z-dR�Z.dNdS�Z/edNdT�Z0dU�Z1dVe2fdW��YZ3dX�Z4dY�Z5dNdZ�Z6d[e2fd\��YZ7d]�Z8d^�Z9d_�Z:d`fda��YZ;iZ<db�Z=ea>ej&j'e�dc�Z?dd�Z@eo�ejAdekr6ddlBZBdf�ZCeBjDdg�ZEiZFdNdh�ZGnpyVe:e?�a>eHt>di�pdt>jIe;jJkrqe@�net>_KejLdje?�Wne@�nXdk�ZGdS(ls�
A module for finding, managing, and using fonts across platforms.

This module provides a single :class:`FontManager` instance that can
be shared across backends and platforms.  The :func:`findfont`
function returns the best TrueType (TTF) font file in the local or
system font path that matches the specified :class:`FontProperties`
instance.  The :class:`FontManager` also handles Adobe Font Metrics
(AFM) font files for use by the PostScript backend.

The design is based on the `W3C Cascading Style Sheet, Level 1 (CSS1)
font specification <http://www.w3.org/TR/1998/REC-CSS2-19980512/>`_.
Future versions may implement the Level 2 or 2.1 specifications.

Experimental support is included for using `fontconfig` on Unix
variant platforms (Linux, OS X, Solaris).  To enable it, set the
constant ``USE_FONTCONFIG`` in this file to ``True``.  Fontconfig has
the advantage that it is the standard way to look up fonts on X11
platforms, so if a font is installed, it is much more likely to be
found.
i����N(tSet(tafm(tft2font(trcParamst
get_configdir(tis_string_like(tparse_fontconfig_patterntgenerate_fontconfig_patterng�I+��?sxx-smallgh��|?5�?sx-smallg-����?tsmallg�?tmediumg333333�?tlargeg
ףp=
�?sx-largeg��S�?sxx-largetlargertsmalleridsultra-condensedi�sextra-condensedi,t	condensedi�ssemi-condensedi�tnormaliXs
semi-expandedi�texpandedi sextra-expandedi�sultra-expandedt
ultralighttlighttregulartbooktromantsemiboldtdemiboldtdemitboldtheavys
extra boldtblacktserifs
sans-serifs
sans seriftcursivetfantasyt	monospacetsanss@Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folderss2SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fontss/SOFTWARE\Microsoft\Windows\CurrentVersion\Fontss/usr/X11R6/lib/X11/fonts/TTF/s/usr/share/fonts/s/usr/local/share/fonts/s)/usr/lib/openoffice/share/fonts/truetype/s/Library/Fonts/s/Network/Library/Fonts/s/System/Library/Fonts/tHOMEtLibrarytFontss.fontscCsidd6dd6dd6|S(ss
    Return a list of file extensions extensions that are synonyms for
    the given file extension *fileext*.
    tttftotfR(R#R$(R#R$(safm((tfontext((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytget_fontext_synonyms�s
cCs�yddl}Wntk
r#noXyZ|j|jt�}z0y|j|d�dSWntk
rjnXWd|j|�XWntk
r�nXtj	j
tjdd�S(s
    Return the user-specified font directory for Win32.  This is
    looked up from the registry key::

      \HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Fonts

    If the key is not found, $WINDIR/Fonts will be returned.
    i����NR"itWINDIR(t_winregtImportErrortOpenKeytHKEY_CURRENT_USERt	MSFolderstQueryValueExtOSErrortCloseKeytostpathtjointenviron(R(tuser((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytwin32FontDirectory�s	


R#cCs�ddl}|dkr$t�}nt|�}di}}x�tD]{}y|j|j|�}Wntk
ryqDnX|s�g}x7|D]/}|jt	j	t
jj|d|���q�W|Sz�x�t
|j|�d�D]�}	y�|j||	�\}}
}t
jj|
�s/t
jj||
�}
nt
jj|
�j�}
t
jj|
�dd|krtd||
<nWq�tk
r�q�q�tk
r�q�q�Xq�W|j�SWd|j|�XqDWdS(s�
    Search for fonts in the specified font directory, or use the
    system directories if none given.  A list of TrueType font
    filenames are returned by default, or AFM fonts if *fontext* ==
    'afm'.
    i����Ns*.i(R(tNoneR5R&tMSFontDirectoriesR*tHKEY_LOCAL_MACHINER.textendtglobR0R1R2trangetQueryInfoKeyt	EnumValuetdirnametabspathtlowertsplitexttEnvironmentErrortWindowsErrortkeysR/(t	directoryR%R(tkeytitemstfontdirtlocaltfilestexttjtdirectany((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytwin32InstalledFonts�s>



-  

c	syg��fd�}x]tD]U}y/tjj|�rPtjj||d�nWqtttt	fk
rpqXqW�S(s�
    Return the system font directories for OS X.  This is done by
    starting at the list of hardcoded paths in
    :attr:`OSXFontDirectories` and returning all nested directories
    within them.
    cs�j|�dS(N(tappend(targRERJ(t	fontpaths(sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytadd�sN(
tOSXFontDirectoriesR0R1tisdirtwalkR6tIOErrorR.t	TypeErrort
ValueError(RSRH((RRsJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytOSXFontDirectory�s
cCs�|dkrt�}nt|�}g}x�|D]�}|dkrk|jtjtjj|d���q1xf|D]^}|jtjtjj|d|���|jtjtjj|d|j����qrWq1W|S(sJ
    Get list of font files on OS X - ignores font suffix by default.
    t*s*.N(	R6RZR&R9R:R0R1R2tupper(RER%RJR1RK((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytOSXInstalledFonts�s
(
)7c	syg��fd�}x]tD]U}y/tjj|�rPtjj||d�nWqtttt	fk
rpqXqW�S(s�
    Return the system font directories for X11.  This is done by
    starting at the list of hardcoded paths in
    :attr:`X11FontDirectories` and returning all nested directories
    within them.
    cs�j|�dS(N(RP(RQRERJ(RR(sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyRSsN(
tX11FontDirectoriesR0R1RURVR6RWR.RXRY(RSRH((RRsJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytx11FontDirectory
s
cCs�t|�}i}y5tjdddgdtj�}|j�d}Wntk
r[|SX|jdkr�xl|jd�D]X}|jd�d}tj	j
|�dd|kr{tj	j|�r{d||<q{q{Wn|S(	s
    Grab a list of all the fonts that are being tracked by fontconfig
    by making a system call to ``fc-list``.  This is an easy way to
    grab all of the fonts the user wants to be made available to
    applications, without needing knowing where all of them reside.
    sfc-listttfiletstdoutis
t:i(R&t
subprocesstPopentPIPEtcommunicateR.t
returncodetsplitR0R1RAtexists(R%t	fontfilestpipetoutputtlinetfname((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytget_fontconfig_fonts!s!
 cCsi}t|�}|dkr	tjdkr�t�}|g}x�t|�D]S}tjj|�\}}t	|�dkrL|dj
�|krLd||<qLqLWq*t�}tjdkr�x$td|�D]}d||<q�WnxBt
|�D]}d||<q�Wn!t|ttf�r*|g}nx�|D]�}g}	xf|D]^}|	jtjtjj|d|���|	jtjtjj|d|j����qDWx$|	D]}
d|tjj|
�<q�Wq1Wg|j�D]}
tjj|
�r�|
^q�S(s4
    Search for fonts in the specified font paths.  If no paths are
    given, will use a standard set of system paths, as well as the
    list of fonts tracked by fontconfig if fontconfig is installed and
    available.  A list of TrueType fonts are returned by default with
    AFM fonts as an option.
    twin32itdarwinR%s*.N(R&R6tsystplatformR5ROR0R1RAtlenR@R_R]Rpt
isinstancetstrtunicodeR9R:R2R\R?RDRj(RRR%RktfontextsRHtftbaseRKR1RJRo((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytfindSystemFonts;s4		(	

)3
cCsht|t�r@yt|j�}Wqdtk
r<d}qdXn$|tddd�kr[n	td�|S(s
    Return the weight property as a numeric value.  String values
    are converted to their corresponding numeric value.
    i�idi�sweight not a valid integer(RvRwtweight_dictR@tKeyErrorR;RY(tweight((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytweight_as_numbergs

	t	FontEntrycBs5eZdZdddddddd�Zd�ZRS(sj
    A class for storing Font properties.  It is used when populating
    the font lookup dictionary.
    R`RR	cCsp||_||_||_||_||_||_ytt|��|_Wnt	k
rk||_nXdS(N(
RotnametstyletvariantRtstretchRwtfloattsizeRY(tselfRoR�R�R�RR�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyt__init__}s							
cCs8d|jtjj|j�|j|j|j|jfS(Ns<Font '%s' (%s) %s %s %s %s>(	R�R0R1tbasenameRoR�R�RR�(R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyt__repr__�s$(t__name__t
__module__t__doc__R�R�(((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyR�xs
cCsa|j}|j�}|jd�}|jd�}|rH|j�}nd}|rc|j�}nd}|jd�dkr�d}n[|jd�dkr�d}n=|jd�dkr�d	}n|jtj@r�d}nd	}|j�dkr�d}nd	}d}x3t	j
�D]%}|j|�dkr|}PqqW|sg|jtj@r^d}qgd
}nt|�}|jd�dks�|jd�dks�|jd�dkr�d}	nW|jd�dkr�d}	n9|jd�dks|jd�dkrd}	nd	}	|j
r$d}
ntt|j���}
d}t|j|||||	|
�S(s�
    A function for populating the :class:`FontKey` by extracting
    information from the TrueType font file.

    *font* is a :class:`FT2Font` instance.
    iiiiR`tobliquetitalicRRtcapitalss
small-capsi�i�tnarrowR
tconds	demi condssemi-condensedtwideRtscalable(iiii(iiii(R�s
small-capsN(tfamily_nametget_sfnttgetR@tfindtstyle_flagsRtITALICR6R}RDtBOLDR�R�RwR�tget_fontsizeR�Ro(tfontR�tsfnttsfnt2tsfnt4R�R�RtwR�R�tsize_adjust((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytttfFontProperty�sZ									*		*	
		c
Cs~|j�}|j�j�}|j�dksK|j�jd�dkrTd}n*|j�jd�dkrxd}nd}|j�dkr�d}nd}t|j�j��}|jd�dks�|jd�dks�|jd	�dkr�d}nW|jd
�dkrd}n9|jd�dksG|jd
�dkrPd
}nd}d}d}	t|||||||�S(s�
    A function for populating a :class:`FontKey` instance by
    extracting information from the AFM font file.

    *font* is a class:`AFM` instance.
    iR�R�RR�s
small-capsR�R
R�s	demi condssemi-condensedR�RR�(scapitalss
small-capsN(	tget_familynametget_fontnameR@t	get_angleR�R�t
get_weightR6R�(
tfontpathR�R�tfontnameR�R�RR�R�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytafmFontProperty�s,-			*		*	c	Cs�g}i}x{|D]s}tjd|d�tjj|�d}||krUqn
d||<|dkr�yt|d�}Wntjd|�qnXy%ztj|�}Wd|j�XWn%t	k
r�tjd|�qnXt
||�}n~ytjt
|��}WnEt	k
r;tjd|�qn!tk
r[tjd	�qnXyt|�}Wn
qnX|j|�qW|S(
s�
    A function to create a font lookup list.  The default is to create
    a list of TrueType fonts.  An AFM font list can optionally be
    created.
    screateFontDict: %stdebugiRtrsCould not open font file %sNsCould not parse font file %ssCannot handle unicode filenames(tverbosetreportR0R1RitopenRtAFMtclosetRuntimeErrorR�RtFT2FontRwtUnicodeErrorR�RP(	RkR%tfontlisttseentfpathRotfhR�tprop((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytcreateFontList8sH





tFontPropertiesc	BseZdZddddddddd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
e
Zd�Zd	�Z
d
�Zd�Zd�Zd
�Zd�Zd�ZeZd�ZeZd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(s�	
    A class for storing and manipulating font properties.

    The font properties are those described in the `W3C Cascading
    Style Sheet, Level 1
    <http://www.w3.org/TR/1998/REC-CSS2-19980512/>`_ font
    specification.  The six properties are:

      - family: A list of font names in decreasing order of priority.
        The items may include a generic font family name, either
        'serif', 'sans-serif', 'cursive', 'fantasy', or 'monospace'.
        In that case, the actual font to be used will be looked up
        from the associated rcParam in :file:`matplotlibrc`.

      - style: Either 'normal', 'italic' or 'oblique'.

      - variant: Either 'normal' or 'small-caps'.

      - stretch: A numeric value in the range 0-1000 or one of
        'ultra-condensed', 'extra-condensed', 'condensed',
        'semi-condensed', 'normal', 'semi-expanded', 'expanded',
        'extra-expanded' or 'ultra-expanded'

      - weight: A numeric value in the range 0-1000 or one of
        'ultralight', 'light', 'normal', 'regular', 'book', 'medium',
        'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy',
        'extra bold', 'black'

      - size: Either an relative value of 'xx-small', 'x-small',
        'small', 'medium', 'large', 'x-large', 'xx-large' or an
        absolute font size, e.g. 12

    The default font property for TrueType fonts (as specified in the
    default :file:`matplotlibrc` file) is::

      sans-serif, normal, normal, normal, normal, scalable.

    Alternatively, a font may be specified using an absolute path to a
    .ttf file, by using the *fname* kwarg.

    The preferred usage of font sizes is to use the relative values,
    e.g.  'large', instead of absolute font sizes, e.g. 12.  This
    approach allows all text sizes to be made larger or smaller based
    on the font manager's default font size.

    This class will also accept a `fontconfig
    <http://www.fontconfig.org/>`_ pattern, if it is the only argument
    provided.  See the documentation on `fontconfig patterns
    <http://www.fontconfig.org/fontconfig-user.html>`_.  This support
    does not require fontconfig to be installed.  We are merely
    borrowing its pattern syntax for use here.

    Note that matplotlib's internal font manager and fontconfig use a
    different algorithm to lookup fonts, so the results of the same pattern
    may be different in matplotlib than in other applications that use
    fontconfig.
    c		Cs)d|_d|_d|_d|_d|_d|_d|_|dk	rb|jj	|j�dSt
|�r�|dkr�|dkr�|dkr�|dkr�|dkr�|dkr�|j|�dSn|j|�|j
|�|j|�|j|�|j|�|j|�|j|�dS(N(R6t_familyt_slantt_variantt_weightt_stretcht_sizet_filet__dict__tupdateRtset_fontconfig_patternt
set_familyt	set_styletset_variantt
set_weighttset_stretchtset_filetset_size(	R�tfamilyR�R�RR�R�Rot_init((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyR��s4
							






cCs
t|�S(N(R(R�tpattern((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyt_parse_fontconfig_pattern�scCsHgt|j�D]"}|t|d|��f^q}tt|��S(NR�(tsortedR�tgetattrthashtrepr(R�tktl((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyt__hash__�s8cCs
|j�S(N(tget_fontconfig_pattern(R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyt__str__�scCs7|jdkr0td}t|�r,|gS|S|jS(sL
        Return a list of font names that comprise the font family.
        sfont.familyN(R�R6RR(R�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyt
get_family�s
cCstjtt|���jS(s\
        Return the name of the font that best matches the font
        properties.
        (RR�RwtfindfontR�(R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytget_name�scCs|jdkrtdS|jS(s^
        Return the font style.  Values are: 'normal', 'italic' or
        'oblique'.
        s
font.styleN(R�R6R(R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyt	get_style�scCs|jdkrtdS|jS(sY
        Return the font variant.  Values are: 'normal' or
        'small-caps'.
        sfont.variantN(R�R6R(R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytget_variant�scCs|jdkrtdS|jS(s�
        Set the font weight.  Options are: A numeric value in the
        range 0-1000 or one of 'light', 'normal', 'regular', 'book',
        'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold',
        'heavy', 'extra bold', 'black'
        sfont.weightN(R�R6R(R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyR��scCs|jdkrtdS|jS(s�
        Return the font stretch or width.  Options are: 'ultra-condensed',
        'extra-condensed', 'condensed', 'semi-condensed', 'normal',
        'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'.
        sfont.stretchN(R�R6R(R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytget_stretchscCs|jdkrtdS|jS(s'
        Return the font size.
        s	font.sizeN(R�R6R(R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytget_sizescCsW|jdk	r7yt|j�SWq7tk
r3q7Xntj�}|tj|j�S(N(R�R6R�RYtfontManagertget_default_sizet
font_scalingsR�(R�tdefault_size((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytget_size_in_pointss
cCs|jS(s=
        Return the filename of the associated font.
        (R�(R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytget_file!scCs
t|�S(s�
        Get a fontconfig pattern suitable for looking up the font as
        specified with fontconfig's ``fc-match`` utility.

        See the documentation on `fontconfig patterns
        <http://www.fontconfig.org/fontconfig-user.html>`_.

        This support does not require fontconfig to be installed or
        support for it to be enabled.  We are merely borrowing its
        pattern syntax for use here.
        (R(R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyR�'scCs=|dkrd|_n!t|�r0|g}n||_dS(s�
        Change the font family.  May be either an alias (generic name
        is CSS parlance), such as: 'serif', 'sans-serif', 'cursive',
        'fantasy', or 'monospace', or a real font name.
        N(R6R�R(R�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyR�5s
cCs(|dkrtd��n||_dS(s[
        Set the font style.  Values are: 'normal', 'italic' or
        'oblique'.
        RR�R�s'style must be normal, italic or obliqueN(snormalsitalicsobliqueN(R6RYR�(R�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyR�CscCs(|dkrtd��n||_dS(sN
        Set the font variant.  Values are: 'normal' or 'small-caps'.
        Rs
small-capss$variant must be normal or small-capsN(snormals
small-capsN(R6RYR�(R�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyR�MscCs|dk	rry4t|�}|dks3|dkr?t��nWqrtk
rn|tkrotd��qoqrXn||_dS(s	
        Set the font weight.  May be either a numeric value in the
        range 0-1000 or one of 'ultralight', 'light', 'normal',
        'regular', 'book', 'medium', 'roman', 'semibold', 'demibold',
        'demi', 'bold', 'heavy', 'extra bold', 'black'
        ii�sweight is invalidN(R6tintRYR}R�(R�R((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyR�Us
cCs|dk	rry4t|�}|dks3|dkr?t��nWqrtk
rn|tkrotd��qoqrXn||_dS(s
        Set the font stretch or width.  Options are: 'ultra-condensed',
        'extra-condensed', 'condensed', 'semi-condensed', 'normal',
        'semi-expanded', 'expanded', 'extra-expanded' or
        'ultra-expanded', or a numeric value in the range 0-1000.
        ii�sstretch is invalidN(R6R�RYtstretch_dictR�(R�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyR�fs
cCsg|dk	rZyt|�}WqZtk
rV|dk	rW|tkrWtd��qWqZXn||_dS(s�
        Set the font size.  Either an relative value of 'xx-small',
        'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'
        or an absolute font size, e.g. 12.
        ssize is invalidN(R6R�RYR�R�(R�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyR�ws
cCs
||_dS(sw
        Set the filename of the fontfile to use.  In this case, all
        other properties will be ignored.
        N(R�(R�Ra((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyR��scCsqxj|j|�j�D]S\}}t|�tkrRt|d|�|d�qt|d|�|�qWdS(sg
        Set the properties by parsing a fontconfig *pattern*.

        See the documentation on `fontconfig patterns
        <http://www.fontconfig.org/fontconfig-user.html>`_.

        This support does not require fontconfig to be installed or
        support for it to be enabled.  We are merely borrowing its
        pattern syntax for use here.
        tset_iN(R�RGttypetlistR�(R�R�RFtval((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyR��s"cCs
td|�S(sReturn a deep copy of selfR�(R�(R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytcopy�sN(R�R�R�R6R�R�R�R�R�R�R�t	get_slantR�R�R�R�R�R�R�R�tset_nameR�t	set_slantR�R�R�R�R�R�R�(((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyR�fsD9#										
													cCs�g}x�|j�D]�}x}|j�D]o}xf|j�D]X}xO|j�D]A}x8|j�D]*}x!|j�D]}|j|�qrWq_WqLWq9Wq&WqW|S(s<
    flatten a ttfdict to all the filenames it contains
    (tvaluesRP(tdtfnamestnamedtstyledtvariantdtweightdtstretchdRo((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytttfdict_to_fnames�s%cCs5t|d�}ztj||�Wd|j�XdS(su
    Equivalent to pickle.dump(data, open(filename, 'w'))
    but closes the file to prevent filehandle leakage.
    R�N(R�tpickletdumpR�(tdatatfilenameR�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytpickle_dump�scCs4t|d�}ztj|�}Wd|j�X|S(so
    Equivalent to pickle.load(open(filename, 'r'))
    but closes the file to prevent filehandle leakage.
    R�N(R�R�tloadR�(R�R�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytpickle_load�s
tFontManagercBs�eZdZdZddd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zddeed�ZRS(s}
    On import, the :class:`FontManager` singleton instance creates a
    list of TrueType fonts based on the font properties: name, style,
    variant, weight, stretch, and size.  The :meth:`findfont` method
    does a nearest neighbor search to find the font that most closely
    matches the specification.  If no good enough match is found, a
    default font is returned.
    iRcCs2|j|_||_||_tjjtddd�tjjtddd�tjjtddd�g}x�ddgD]�}|tjkr|tj|}|j	d�d	kr�|j
|jd��q
|j	d
�d	kr�|j
|jd
��q
|j|�q|q|Wt
jdt|��t|�t�|_idd6d
d6|_i|_xe|jD]F}t
jd|d�|j�j	d�d	kre||jd<PqeqeW|jd	|jd<t|j�|_t|dd�tdd�|_t|jdd�|_d|jd<i|_i|_dS(NtdatapathtfontsR#RtpdfcorefontstTTFPATHtAFMPATHt;iRcsfont search path %ssBitstream Vera Sanst	Helveticastrying fontname %sR�svera.ttfR%(t__version__t_versiont_FontManager__default_weightR�R0R1R2RR3R�R9RiRPR�R�RwR|tttffilest
defaultFamilytdefaultFontR@R�tttflisttafmfilestafmlistR6tttf_lookup_cachetafm_lookup_cache(R�R�RtpathstpathnametttfpathRo((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyR��sB		

	

	cCs|jS(s1
        Return the default font weight.
        (R(R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytget_default_weightscCstdS(s/
        Return the default font size.
        s	font.size(R(R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyR�scCs
||_dS(sN
        Set the default font weight.  The initial value is 'normal'.
        N(R(R�R((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytset_default_weightscCs
t�dS(sd
        Update the font dictionary with new font files.
        Currently not implemented.
        N(tNotImplementedError(R�t	filenames((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytupdate_fontsscCs�|j�}x�t|�D]�\}}|j�}|tkr�|dkrRd}ntd|}g|D]}|j�^qg}||kr�|j|�}dt|�t|�Sq||krdSqWdS(	s
        Returns a match score between the list of font families in
        *families* and the font family name *family2*.

        An exact match anywhere in the list returns 0.0.

        A match by generic font name will return 0.1.

        No match will return 1.0.
        Rs
sans serifs
sans-serifsfont.g�������?gg�?(Rs
sans serif(R@t	enumeratetfont_family_aliasesRtindexR�Ru(R�tfamiliestfamily2titfamily1toptionstxtidx((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytscore_family!s	cCs0||krdS|dkr,|dkr,dSdS(s�
        Returns a match score between *style1* and *style2*.

        An exact match returns 0.0.

        A match between 'italic' and 'oblique' returns 0.1.

        No match returns 1.0.
        gR�R�g�������?g�?(sitalicsoblique(sitalicsoblique((R�tstyle1tstyle2((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytscore_style;s
cCs||krdSdSdS(s~
        Returns a match score between *variant1* and *variant2*.

        An exact match returns 0.0, otherwise 1.0.
        gg�?N((R�tvariant1tvariant2((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyt
score_variantLscCs~yt|�}Wn#tk
r5tj|d�}nXyt|�}Wn#tk
rktj|d�}nXt||�dS(s�
        Returns a match score between *stretch1* and *stretch2*.

        The result is the absolute value of the difference between the
        CSS numeric values of *stretch1* and *stretch2*, normalized
        between 0.0 and 1.0.
        i�g@�@(R�RYR�R�tabs(R�tstretch1tstretch2tstretchval1tstretchval2((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyt
score_stretchWs

cCs~yt|�}Wn#tk
r5tj|d�}nXyt|�}Wn#tk
rktj|d�}nXt||�dS(s�
        Returns a match score between *weight1* and *weight2*.

        The result is the absolute value of the difference between the
        CSS numeric values of *weight1* and *weight2*, normalized
        between 0.0 and 1.0.
        i�g@�@(R�RYR}R�R.(R�tweight1tweight2t
weightval1t
weightval2((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytscore_weightis

cCs~|dkrdSyt|�}Wn$tk
rF|jt|�}nXyt|�}Wntk
rkdSXt||�dS(s�
        Returns a match score between *size1* and *size2*.

        If *size2* (the size specified in the font file) is 'scalable', this
        function always returns 0.0, since any font size can be generated.

        Otherwise, the result is the absolute distance between *size1* and
        *size2*, normalized so that the usual range of font sizes (6pt -
        72pt) will lie between 0.0 and 1.0.
        R�gg�?gR@(R�RYR�R�R.(R�tsize1tsize2tsizeval1tsizeval2((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyt
score_size{s

R#cCst|t�st|�}n|j�}|dk	rNtjd|d�|S|dkro|j}|j}n|j}|j	}|dkr�|j
t|��}	|	r�|	Snd}
d}x|D]}|dk	r�tj
j|j|g�|kr�q�n|j|j�|j�d|j|j�|j�|j|j�|j�|j|j�|j�|j|j�|j�|j|j �|j!�}
|
|
kr�|
}
|}n|
dkr�Pq�q�W|dks�|
dkro|r>t"j#d|j�|j$|f�|j%�}|j&|j$|�|j'|||t(�St"j#d||j)|ft*�|j)|}n,tjd	||j|j|
f�|j}tj
j+|�s�|r�tjd
�t,�t-j'|||t.t(�St/d��n|dkr||t|�<n|S(
s
        Search the font list for the font that most closely matches
        the :class:`FontProperties` *prop*.

        :meth:`findfont` performs a nearest neighbor search.  Each
        font is given a similarity score to the target font
        properties.  The first font with the highest score is
        returned.  If no matches below a certain threshold are found,
        the default font (usually Vera Sans) is returned.

        `directory`, is specified, will only return fonts from the
        given directory (or subdirectory of that directory).

        The result is cached, so subsequent lookups don't have to
        perform the O(n) nearest neighbor search.

        If `fallback_to_default` is True, will fallback to the default
        font family (usually "Bitstream Vera Sans" or "Helvetica") if
        the first lookup hard-fails.

        See the `W3C Cascading Style Sheet, Level 1
        <http://www.w3.org/TR/1998/REC-CSS2-19980512/>`_ documentation
        for a description of the font finding algorithm.
        sfindfont returning %sR�Rg��?�O8Mg$@is6findfont: Font family %s not found. Falling back to %ss*findfont: Could not match %s. Returning %ss1findfont: Matching %s to %s (%s) with score of %fs7findfont: Found a missing font file.  Rebuilding cache.sNo valid font could be foundN(0RvR�R�R6R�R�RRRRR�R�R0R1tcommonprefixRoR'R�R�R*R�R�R-R�R�R8R�RR3R�R�R=R�R�twarningstwarnRR�R�R�tFalseRtUserWarningtisfilet_rebuildR�tTrueRY(R�R�R%REtfallback_to_defaulttrebuild_if_missingRot
font_cacheR�tcachedt
best_scoret	best_fontR�tscoretdefault_proptresult((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyR��sp			
!�		N(R�R�R�R
R6R�RR�RRR'R*R-R3R8R=RER�(((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyR�s1				
						cCs�tjj|�dj�dkr�tj|�}|dkr~t|d�}|jd�}|j	�|dk}|t|<n|St
S(s�
    Returns True if the given font is a Postscript Compact Font Format
    Font embedded in an OpenType wrapper.  Used by the PostScript and
    PDF backends that can not subset these fonts.
    is.otftrbitOTTON(R0R1RAR@t_is_opentype_cff_font_cacheR�R6R�treadR�RA(R�RNtfdttag((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytis_opentype_cff_font�s"

sfontList.cachecCs't�attt�tjd�dS(Nsgenerated new fontManager(RR�R�t_fmcacheR�R�(((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyRDs	
RqcCs�t|�}d|}y5tjdd|gdtj�}|j�d}Wntk
r_dSX|jdkr�xMtj	|�D]9}|j
d�}tjj
|�dd|kr|SqWndS(Nt.sfc-matchs-svRbii(R&RdReRfRgR.R6Rht_fc_match_regextfinditertgroupR0R1RA(R�R%RyRKRlRmtmatchRa((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pytfc_matchs
!
 s\sfile:\s+"([^"]*)"cCsut|�s|j�}ntj|�}|dk	r:|St||�}|dkrgtd|�}n|t|<|S(NRc(RR�t_fc_match_cacheR�R6R\(R�R%RIRN((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyR�-s
Rs"Using fontManager instance from %scKstj||�}|S(N(R�R�(R�tkwR�((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyR�Gs(MR�R0RsR:RdR?tsett	NameErrortsetsRt
matplotlibRRRRtmatplotlib.cbookRtmatplotlib.fontconfig_patternRRtcPickleR�R)RAtUSE_FONTCONFIGR�R6R�R�R}RR,R7R^RTR3R�thomeR1R2RPR&R5RORZR]R_RpR|R�tobjectR�R�R�R�R�R�R�RRRQRUR�RVRDRttreR\tcompileRXR]R�thasattrRR
R�R�(((sJ/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/font_manager.pyt<module>s�<

	


			
			-		,		^	C.�<			�6