AlkantarClanX12

Your IP : 18.222.166.127


Current Path : /proc/self/root/lib64/python3.8/tkinter/__pycache__/
Upload File :
Current File : //proc/self/root/lib64/python3.8/tkinter/__pycache__/font.cpython-38.opt-1.pyc

U

e5d@�@szdZddlZddlZdZdZdZdZdd�ZGd	d
�d
�Zd dd�Z	d!d
d�Z
edk�rve��Z
edded�Zee���ee�d��ee�d��ee���ee�d��ee�d��ee
��ee�d�e�d��eeje
d��edd�Zee�d�ejde
d��eje
ded�Ze��eje
de
jd�Ze��eedd���Zejed�ejed�e��dS)"z0.9�NZnormalZroman�boldZitaliccCst|dd�S)zFGiven the name of a tk named font, returns a Font representation.
    T)�name�exists)�Font�r�r�$/usr/lib64/python3.8/tkinter/font.py�
nametofontsr	c@s�eZdZdZe�d�Zdd�Zdd�Zdd�Z	d#dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd$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)

    �cCs:g}|��D]$\}}|�d|�|�t|��qt|�S�N�-)�items�append�str�tuple)�self�kw�options�k�vrrr�_set1s
z	Font._setcCs$g}|D]}|�d|�qt|�Sr)rr)r�argsrrrrr�_get8sz	Font._getcCs:i}tdt|�d�D] }||d|||dd�<q|S)Nr�r
)�range�len)rrr�irrr�_mkdict>szFont._mkdictNFcKs�|st�d�}t|d|�}|r4|�|�dd|��}n
|�|�}|sTdtt|j��}||_	|r�d|_
|j	|�|�dd��kr�tj�d|j	f��|r�|jdd|j	f|��n|jdd	|j	f|��d
|_
||_
|j|_|j|_dS)Nzuse font�tk�font�actualF�namesz$named font %s does not already exist�	configureZcreateT)�tkinter�_get_default_root�getattr�	splitlist�callrr�next�counterr�delete_fontZ_tkinterZTclError�_tk�_split�_call)r�rootrrrrrrrr�__init__Ds,


�z
Font.__init__cCs|jS�Nr�rrrr�__str__cszFont.__str__cCs&t|t�stS|j|jko$|j|jkSr0)�
isinstancer�NotImplementedrr+)r�otherrrr�__eq__fs
zFont.__eq__cCs
|�|�Sr0)�cget)r�keyrrr�__getitem__kszFont.__getitem__cCs|jf||i�dSr0)r")rr8�valuerrr�__setitem__nszFont.__setitem__cCs4z|jr|�dd|j�Wntk
r.YnXdS)Nr�delete)r*r-r�	Exceptionr1rrr�__del__qs
zFont.__del__cCst|jf|���S)z*Return a distinct copy of the current font)rr+r r1rrr�copyxsz	Font.copycCs^d}|rd|f}|r8|d|f}|jdd|jf|��S|�|�|jdd|jf|����SdS)zReturn actual font attributesr�
-displayofrrr N)r-rrr,)r�option�	displayofrrrrr |s�zFont.actualcCs|�dd|jd|�S)zGet font attributer�configr)r-r)rrArrrr7�sz	Font.cgetc	KsB|r"|jdd|jf|�|���n|�|�|�dd|j���SdS)zModify font attributesrrCN)r-rrrr,)rrrrrrC�s��zFont.configcCs2|f}|rd||f}|j�|jdd|jf|���S)zReturn text widthr@r�measure)r+�getintr-r)r�textrBrrrrrD�s
zFont.measurecOs�d}|�dd�}|rd|f}|rL||�|�}|j�|jdd|jf|���S|�|jdd|jf|���}i}tdt|�d�D](}|j�||d	�|||d	d�<q||SdS)
z}Return font metrics.

        For best performance, create a dummy widget
        using this font before calling this method.rrBNr@r�metricsrrr
)	�poprr+rEr-rr,rr)rrrrrB�resrrrrrG�s�&zFont.metrics)NNNF)NN)N)�__name__�
__module__�__qualname__�__doc__�	itertools�countr)rrrr/r2r6r9r;r>r?r r7rCr"rDrGrrrrrs$


	
rcCs6|st�d�}d}|rd|f}|j�|jjd|���S)zGet font families (as a tuple)zuse font.families()rr@r�families)rrP�r#r$rr&r')r.rBrrrrrP�s
rPcCs$|st�d�}|j�|j�dd��S)z'Get names of defined fonts (as a tuple)zuse font.names()rr!rQ)r.rrrr!�s
r!�__main__�times�)�family�size�weightrUrWZhelloZ	linespace)rB)ZCourier�r)rzHello, world)rFrzQuit!)rFZcommandr)rW)NN)N)�__version__rNr#ZNORMALZROMANZBOLDZITALICr	rrPr!rJZTkr.�f�printr rCr7rDrGZLabel�wZpackZButtonZdestroyr?ZfbZmainlooprrrr�<module>sB