Your IP : 216.73.216.213


Current Path : /proc/242857/root/opt/alt/python34/lib64/python3.4/tkinter/__pycache__/
Upload File :
Current File : //proc/242857/root/opt/alt/python34/lib64/python3.4/tkinter/__pycache__/font.cpython-34.pyc

�
h f��@s"dZddlZddlZdZdZdZdZdd�ZGd	d
�d
�Zdddd�Z	dd
d�Z
edkrej�Z
eddddde�Zeej��eejd��eejd��eej��eejd��eejd��ee
��eejd�ejd��eejde
��edd�Zeejd�ejdde
��eje
ddde�Zej�eje
ddde
j�Zej�eded�j�Zejde�ejde�ej�ndS) z0.9�NZnormalZroman�boldZitaliccCstd|dd�S)zFGiven the name of a tk named font, returns a Font representation.
    �name�existsT)�Font)r�r�1/opt/alt/python34/lib64/python3.4/tkinter/font.py�
nametofontsrc@s�eZdZdZejd�Zdd�Zdd�Zdd�Z	d	d	d	d
dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd	d	dd�Zdd�Zdd�ZeZd	dd �Zd!d"�Zd	S)#ra�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)

    �cCsQg}x>|j�D]0\}}|jd|�|jt|��qWt|�S)N�-)�items�append�str�tuple)�self�kw�options�k�vrrr�_set1s
z	Font._setcCs2g}x|D]}|jd|�q
Wt|�S)Nr
)rr)r�argsrrrrr�_get8s
z	Font._getcCsMi}x@tdt|�d�D]&}||d|||dd�<qW|S)Nr�r	)�range�len)rrr�irrr�_mkdict>s$zFont._mkdictNFcKsC|stj}nt|d|�}|rK|j|jdd|��}n|j|�}|s|dtt|j��}n||_	|r�d|_
|j	|j|jdd��kr�tjjd|j	f��n|r|jdd|j	|�qn"|jdd|j	|�d	|_
||_
|j|_|j|_dS)
N�tk�font�actualF�namesz$named font %s does not already exist�	configure�createT)�tkinter�
_default_root�getattr�	splitlist�callrr
�next�counterr�delete_fontZ_tkinterZTclError�_tk�_split�_call)r�rootrrrrrrrr�__init__Ds*!		$			z
Font.__init__cCs|jS)N)r)rrrr�__str__cszFont.__str__cCst|t�o|j|jkS)N)�
isinstancerr)r�otherrrr�__eq__fszFont.__eq__cCs
|j|�S)N)�cget)r�keyrrr�__getitem__iszFont.__getitem__cCs|ji||6�dS)N)r )rr4�valuerrr�__setitem__lszFont.__setitem__cCsYy&|jr%|jdd|j�nWn,ttfk
rC�Yntk
rTYnXdS)NrZdelete)r)r,r�KeyboardInterrupt�
SystemExit�	Exception)rrrr�__del__os	
zFont.__del__cCst|j|j��S)z*Return a distinct copy of the current font)rr*r)rrrr�copyxsz	Font.copycCszf}|rd|f}n|rK|d|f}|jdd|j|�S|j|j|jdd|j|���SdS)zReturn actual font attributesz
-displayofr
rrN)r,rrr+)r�option�	displayofrrrrr|szFont.actualcCs|jdd|jd|�S)zGet font attributer�configr
)r,r)rr=rrrr3�sz	Font.cgetcKsW|r+|jdd|j|j|��n(|j|j|jdd|j���SdS)zModify font attributesrr?N)r,rrrr+)rrrrrr?�s
zFont.configcCs@|f}|r!d||f}nt|jdd|j|��S)zReturn text widthz
-displayofr�measure)�intr,r)r�textr>rrrrr@�s	zFont.measurecOs�f}|jdd�}|r-d|f}n|re||j|�}t|jdd|j|��S|j|jdd|j|��}i}xFtdt|�d�D],}t||d�|||dd�<q�W|SdS)	z}Return font metrics.

        For best performance, create a dummy widget
        using this font before calling this method.r>Nz
-displayofr�metricsrrr	)�poprrAr,rr+rr)rrrrr>�resrrrrrC�s$*zFont.metrics)�__name__�
__module__�__qualname__�__doc__�	itertools�countr(rrrr.r/r2r5r7r;r<rr3r?r r@rCrrrrrs$		rcCsO|stj}nf}|r-d|f}n|jj|jjdd|��S)zGet font families (as a tuple)z
-displayofr�families)r"r#rr%r&)r-r>rrrrrL�srLcCs1|stj}n|jj|jjdd��S)z'Get names of defined fonts (as a tuple)rr)r"r#rr%r&)r-rrrr�sr�__main__Zfamily�times�size�ZweightZhelloZ	linespacer>r�Courier�rBzHello, worldzQuit!Zcommand)rQrRr)�__version__rJr"ZNORMALZROMANZBOLDZITALICrrrLrrFZTkr-�f�printrr?r3r@rCZLabel�wZpackZButtonZdestroyr<ZfbZmainlooprrrr�<module>s@�


%