����JFIF���������
1#@!#!123s
D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
usr
/
lib64
/
python3.8
/
tkinter
/
__pycache__
/
Filename :
font.cpython-38.pyc
back
Copy
U ����e5d@����������������������@���sz��d�Z�ddlZddlZdZdZdZdZdd��ZG�d 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����eed�d����Zejed��ejed��e����dS�)"z0.9�����NZnormalZroman�boldZitalicc�����������������C���s���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� nametofont���s����r ���c�������������������@���s����e�Zd�ZdZe�d�Zdd��Zdd��Zdd��Z d#dd�Z d d��Zdd��Zdd��Z dd��Zdd��Zdd��Zd$dd�Zdd��Zdd��ZeZd%dd �Zd!d"��Zd S�)&r���a���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) ����c�����������������C���s:���g�}|����D�]$\}}|�d|���|�t|���qt|�S��N�-)�items�append�str�tuple)�self�kw�options�k�vr���r���r����_set1���s ����z Font._setc�����������������C���s$���g�}|D�]}|��d|���qt|�S�r���)r���r���)r����argsr���r���r���r���r����_get8���s����z Font._getc�����������������C���s:���i�}t�dt|�d�D�] }||d��|||�dd���<�q|S�)Nr�������r ���)�range�len)r���r���r����ir���r���r����_mkdict>���s����zFont._mkdictNFc�����������������K���s����|st��d�}t|d|�}|r4|�|�dd|��}n |��|�}|sTdtt|�j���}||�_ |r�d|�_ |�j |�|�dd��kr�t�j�d|�j f���|r�|jdd|�j f|����n|jdd |�j f|����d |�_ ||�_ |j|�_|j|�_d�S�)Nzuse font�tk�font�actualF�namesz$named font %s does not already exist� configureZcreateT)�tkinter�_get_default_root�getattr� splitlist�callr���r����next�counterr����delete_fontZ_tkinterZTclError�_tk�_split�_call)r����rootr���r���r���r���r���r���r���r����__init__D���s,���� �z Font.__init__c�����������������C���s���|�j�S��Nr����r���r���r���r����__str__c���s����zFont.__str__c�����������������C���s&���t�|t�stS�|�j|jko$|�j|jkS�r0���)� isinstancer����NotImplementedr���r+���)r����otherr���r���r����__eq__f���s���� zFont.__eq__c�����������������C���s ���|���|�S�r0���)�cget)r����keyr���r���r����__getitem__k���s����zFont.__getitem__c�����������������C���s���|�j�f�||i��d�S�r0���)r"���)r���r8����valuer���r���r����__setitem__n���s����zFont.__setitem__c�����������������C���s4���z|�j�r|��dd|�j��W�n�tk r.���Y�nX�d�S�)Nr����delete)r*���r-���r���� Exceptionr1���r���r���r����__del__q���s ����zFont.__del__c�����������������C���s���t�|�jf|�����S�)z*Return a distinct copy of the current font)r���r+���r ���r1���r���r���r����copyx���s����z Font.copyc�����������������C���s^���d}|rd|f}|r8|d|�f�}|�j�dd|�jf|���S�|��|��|�j�dd|�jf|�����S�dS�)zReturn actual font attributesr���� -displayofr���r���r ���N)r-���r���r���r,���)r����option� displayofr���r���r���r���r ���|���s�����zFont.actualc�����������������C���s���|���dd|�jd|��S�)zGet font attributer����configr���)r-���r���)r���rA���r���r���r���r7�������s����z Font.cgetc�������������� ���K���sB���|r"|�j�dd|�jf|��|�����n|��|��|���dd|�j���S�dS�)zModify font attributesr���rC���N)r-���r���r���r���r,���)r���r���r���r���r���rC�������s������zFont.configc�����������������C���s2���|f}|rd||f}|�j��|�jdd|�jf|����S�)zReturn text widthr@���r����measure)r+����getintr-���r���)r����textrB���r���r���r���r���rD�������s���� zFont.measurec�����������������O���s����d}|��dd�}|rd|f}|rL||��|��}|�j�|�jdd|�jf|����S�|��|�jdd|�jf|����}i�}tdt|�d�D�](}|�j�||d ���|||�d d��<�q||S�dS�) z}Return font metrics. For best performance, create a dummy widget using this font before calling this method.r���rB���Nr@���r����metricsr���r���r ���) �popr���r+���rE���r-���r���r,���r���r���)r���r���r���r���rB����resr���r���r���r���rG�������s�����&zFont.metrics)NNNF)NN)N)�__name__� __module__�__qualname__�__doc__� itertools�countr)���r���r���r���r/���r2���r6���r9���r;���r>���r?���r ���r7���rC���r"���rD���rG���r���r���r���r���r������s$��� r���c�����������������C���s6���|�st��d�}�d}|rd|f}|�j�|�jjd|����S�)zGet font families (as a tuple)zuse font.families()r���r@���r����families)r���rP����r#���r$���r���r&���r'���)r.���rB���r���r���r���r���rP�������s���� rP���c�����������������C���s$���|�st��d�}�|�j�|�j�dd��S�)z'Get names of defined fonts (as a tuple)zuse font.names()r���r!���rQ���)r.���r���r���r���r!�������s���� r!����__main__�times����)�family�size�weightrU���rW���ZhelloZ linespace)rB���)ZCourier����r���)r���zHello, world)rF���r���zQuit!)rF���Zcommandr���)rW���)NN)N)�__version__rN���r#���ZNORMALZROMANZBOLDZITALICr ���r���rP���r!���rJ���ZTkr.����f�printr ���rC���r7���rD���rG���ZLabel�wZpackZButtonZdestroyr?���ZfbZmainloopr���r���r���r����<module>���sB����