• File: fontconfig_pattern.pyo
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/proc/self/root/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/fontconfig_pattern.pyo
  • Date Modified: 07/22/2015 11:41 PM
  • File size: 6.49 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

)Uc@sdZddlZddlmZmZmZmZmZmZm	Z	dZ
ejde
jZ
ejde
jZdZejdejZejdejZddd	YZejZd
ZdS(s
A module for parsing and generating fontconfig patterns.

See the `fontconfig pattern specification
<http://www.fontconfig.org/fontconfig-user.html>`_ for more
information.
iN(tLiteralt
ZeroOrMoretOptionaltRegext	StringEndtParseExceptiontSuppresss\\\-:,s\\([%s])s([%s])s\\=_:,tFontconfigPatternParsercBs
eZdZid+d6d,d6d-d6d.d6d/d6d0d6d1d6d2d	6d3d
6d4d6d5d6d6d6d7d6d8d6d9d6d:d6d;d6d<d6d=d6d>d6d?d6d@d6dAd6dBd!6Zd"Zd#Zd$Zd%Zd&Zd'Z	d(Z
d)Zd*ZRS(CsA simple pyparsing-based parser for fontconfig-style patterns.

    See the `fontconfig pattern specification
    <http://www.fontconfig.org/fontconfig-user.html>`_ for more
    information.
    tweighttlighttthint
extralightt
ultralighttbooktregulartnormaltmediumtdemiboldtsemiboldtbolds
extra boldt	extraboldtblacktheavytslanttromantitalictobliquetwidthsultra-condensedtultracondensedsextra-condensedtextracondensedt	condensedssemi-condensedt
semicondensedtexpandedsextra-expandedt
extraexpandedsultra-expandedt
ultraexpandedc	CsUtdttfj|j}tdj|j}tdj|j}tdttfj|j}|tt	d|j|j
}|tt	d|j|j}|tt	d|ttt	d||Bj|j
}t|tt	d|tt	d|t}||_t|_dS(Ns([^%s]|(\\[%s]))*s([0-9]+\.?[0-9]*|\.[0-9]+)s[a-z]+t,t=t-t:(Rtfamily_punctsetParseActiont_familyt_sizet_namet
value_punct_valueRRt	_familiest_point_sizesRt	_propertyRRt_parserR(	tselftfamilytsizetnametvaluetfamiliestpoint_sizestpropertytpattern((sP/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/fontconfig_pattern.pyt__init__Es8		
;	cCs]i}|_y|jj|Wn,|jk
rO}td||fnXd|_|S(s
        Parse the given fontconfig *pattern* and return a dictionary
        of key/value pairs useful for initializing a
        :class:`font_manager.FontProperties` object.
        s$Could not parse font string: '%s'
%sN(t_propertiesR1tparseStringRt
ValueErrortNone(R2R:tpropste((sP/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/fontconfig_pattern.pytparseus
	cCstdt|dgS(Ns\1i(tfamily_unescapetstr(R2tstlocttokens((sP/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/fontconfig_pattern.pyR)scCst|dgS(Ni(tfloat(R2RERFRG((sP/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/fontconfig_pattern.pyR*scCst|dgS(Ni(RD(R2RERFRG((sP/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/fontconfig_pattern.pyR+scCstdt|dgS(Ns\1i(tvalue_unescapeRD(R2RERFRG((sP/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/fontconfig_pattern.pyR-scCs*g|D]}t|^q|jd<gS(NR3(RDR<(R2RERFRGtx((sP/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/fontconfig_pattern.pyR.s&cCs*g|D]}t|^q|jd<gS(NR4(RDR<(R2RERFRGRJ((sP/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/fontconfig_pattern.pyR/s&cCst|dkr^|d|jkr|j|d\}}|jj|gj|qn0|d}|d}|jj|gj|gS(Nii(tlent
_constantsR<t
setdefaulttappendtextend(R2RERFRGtkeytval((sP/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/fontconfig_pattern.pyR0s"

(RR	(RR	(RR	(RR	(RR
(RR(RR(RR(RR(RR(RR(Rs
extra bold(RR(RR(RR(RR(RR(swidthsultra-condensed(swidthsextra-condensed(swidthR(swidthssemi-condensed(swidthsexpanded(swidthsextra-expanded(swidthsultra-expanded(
t__name__t
__module__t__doc__RLR;RBR)R*R+R-R.R/R0(((sP/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/fontconfig_pattern.pyR"sF
	0							cCsg}d}d}xdjD]}t|d|}|dk	r|gkrt|tkrg|D]'}|dk	rltdt|^ql}|gkrdj|}qn|jd||fqqWdj|S(s[
    Given a dictionary of key/value pairs, generates a fontconfig
    pattern string.
    ts-family style variant weight stretch file sizetget_s\\\1R#s:%s=%sN(	tsplittgetattrR?ttypetlisttvalue_escapeRDtjoinRN(tdR@R7R4RPRQRJ((sP/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/fontconfig_pattern.pytgenerate_fontconfig_patterns4((RTtret	pyparsingRRRRRRRR'tcompiletsubRCt
family_escapeR,RIR[RRBtparse_fontconfig_patternR^(((sP/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/fontconfig_pattern.pyt<module>s4