Your IP : 3.23.102.79


Current Path : /usr/lib64/python2.7/lib-tk/
Upload File :
Current File : //usr/lib64/python2.7/lib-tk/tkFont.pyc

�
zfc@s�dZddlZdZdZdZdZd�Zddd	��YZdd
�Z	dd�Z
edkr�ej�Z
ed
dddde�Zej�GHejd
�GHejd�GHej�GHejd
�GHejd�GHe
�GHejd�Gejd�GHej�GHedd�Zejd�Gejd�GHeje
ddde�Zej�eje
ddde
j�Zej�eded�j�Zejde�ejde�ej�ndS(s0.9i����NtnormaltromantboldtitaliccCstd|dt�S(sFGiven the name of a tk named font, returns a Font representation.
    tnametexists(tFonttTrue(R((s%/usr/lib64/python2.7/lib-tk/tkFont.pyt
nametofontsRcBs�eZdZd�Zd�Zd�Zddded�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zdd�Zd�Zd
�ZeZd�Zd�ZRS(s�Represents a named font.

    Constructor options are:

    font -- font specifier (name, system font, or (family, size, style)-tuple)
    name -- name to use for this font configuration (defaults to a unique name)
    exists -- does a named font by this name already exist?
       Creates a new named font if False, points to the existing font if True.
       Raises _Tkinter.TclError if the assertion is false.

       the following are ignored if font is specified:

    family -- font 'family', e.g. Courier, Times, Helvetica
    size -- font size in points
    weight -- font thickness: NORMAL, BOLD
    slant -- font slant: ROMAN, ITALIC
    underline -- font underlining: false (0), true (1)
    overstrike -- font strikeout: false (0), true (1)

    cCsig}xV|j�D]H\}}t|t�s=t|�}n|jd|�|j|�qWt|�S(Nt-(titemst
isinstancet
basestringtstrtappendttuple(tselftkwtoptionstktv((s%/usr/lib64/python2.7/lib-tk/tkFont.pyt_set/scCs2g}x|D]}|jd|�q
Wt|�S(NR	(RR(RtargsRR((s%/usr/lib64/python2.7/lib-tk/tkFont.pyt_get8s
cCsGi}x:tdt|�d�D] }||d|||d<qW|S(Niii(trangetlen(RRRti((s%/usr/lib64/python2.7/lib-tk/tkFont.pyt_mkdict>scKs=|stj}nt|d|�}|rK|j|jdd|��}n|j|�}|sydtt|��}n||_|r�t	|_
|j|j|jdd��kr�tjjd|jf�n|r|jdd|j|�qn"|jdd|j|�t
|_
||_|j|_|j|_dS(Nttktfonttactualtnamess$named font %s does not already existt	configuretcreate(tTkintert
_default_roottgetattrt	splitlisttcallRR
tidRtFalsetdelete_fontt_tkintertTclErrorRt_tkt_splitt_call(RtrootRRRRR((s%/usr/lib64/python2.7/lib-tk/tkFont.pyt__init__Ds(!		$		cCs|jS(N(R(R((s%/usr/lib64/python2.7/lib-tk/tkFont.pyt__str__ascCst|t�o|j|jkS(N(RRR(Rtother((s%/usr/lib64/python2.7/lib-tk/tkFont.pyt__eq__dscCs
|j|�S(N(tcget(Rtkey((s%/usr/lib64/python2.7/lib-tk/tkFont.pyt__getitem__gscCs|ji||6�dS(N(R (RR5tvalue((s%/usr/lib64/python2.7/lib-tk/tkFont.pyt__setitem__jscCsWy&|jr%|jdd|j�nWn*ttfk
rB�ntk
rRnXdS(NRtdelete(R)R.RtKeyboardInterruptt
SystemExitt	Exception(R((s%/usr/lib64/python2.7/lib-tk/tkFont.pyt__del__ms	
cCst|j|j��S(s*Return a distinct copy of the current font(RR,R(R((s%/usr/lib64/python2.7/lib-tk/tkFont.pytcopyvscCsO|r#|jdd|jd|�S|j|j|jdd|j���SdS(sReturn actual font attributesRRR	N(R.RRR-(Rtoption((s%/usr/lib64/python2.7/lib-tk/tkFont.pyRzscCs|jdd|jd|�S(sGet font attributeRtconfigR	(R.R(RR?((s%/usr/lib64/python2.7/lib-tk/tkFont.pyR4�scKsW|r+|jdd|j|j|��n(|j|j|jdd|j���SdS(sModify font attributesRR@N(R.RRRR-(RR((s%/usr/lib64/python2.7/lib-tk/tkFont.pyR@�s
cCst|jdd|j|��S(sReturn text widthRtmeasure(tintR.R(Rttext((s%/usr/lib64/python2.7/lib-tk/tkFont.pyRA�scGs�|r.t|jdd|j|j|���S|j|jdd|j��}i}x@tdt|�d�D]&}t||d�|||d<qnW|SdS(s}Return font metrics.

        For best performance, create a dummy widget
        using this font before calling this method.RtmetricsiiiN(RBR.RRR-RR(RRtresR((s%/usr/lib64/python2.7/lib-tk/tkFont.pyRD�s%!$N(t__name__t
__module__t__doc__RRRtNoneR(R0R1R3R6R8R=R>RR4R@R RARD(((s%/usr/lib64/python2.7/lib-tk/tkFont.pyRs"														
	cCs1|stj}n|jj|jjdd��S(sGet font families (as a tuple)Rtfamilies(R"R#RR%R&(R/((s%/usr/lib64/python2.7/lib-tk/tkFont.pyRJ�scCs1|stj}n|jj|jjdd��S(s'Get names of defined fonts (as a tuple)RR(R"R#RR%R&(R/((s%/usr/lib64/python2.7/lib-tk/tkFont.pyR�st__main__tfamilyttimestsizeitweightthellot	linespaceRtCourieriRCsHello, worldsQuit!tcommand((RRiR(t__version__R"tNORMALtROMANtBOLDtITALICRRRIRJRRFtTkR/tfRR@R4RARDtLabeltwtpacktButtontdestroyR>tfbtmainloop(((s%/usr/lib64/python2.7/lib-tk/tkFont.pyt<module>	s>	�	



?>