B /g^c@szdZddlZddlZdZdZdZdZddZGd d d Zd d d Z d!d dZ e dkrve Z eddedZeeeedeedeeeedeedee eededeeje deddZeedejde deje dedZeeje de jdZeeeddZejedejededS)"z0.9NZnormalZromanboldZitaliccCs t|ddS)NT)nameexists)Fontrr$/usr/lib64/python3.7/tkinter/font.py nametofontsrc@seZdZedZddZddZddZd"d d Z d d Z ddZ ddZ ddZ ddZddZd#ddZddZddZeZd$ddZd d!ZdS)%rcCs>g}x0|D]$\}}|d||t|qWt|SN-)Zitemsappendstrtuple)selfkwoptionskZvrrr_set1s z Font._setcCs(g}x|D]}|d|q Wt|Sr )r r)rargsrrrrr_get8s z Font._getcCs>i}x4tdt|dD] }||d|||dd<qW|S)Nrr )rangelen)rrrirrr_mkdict>s z Font._mkdictNFcKs|s tj}t|d|}|r0||dd|}n ||}|sPdtt|j}||_ |rd|_ |j ||ddkrtj d|j f|r|jdd|j f|n|jdd|j f|d |_ ||_ |j|_|j|_dS) NtkfontactualFnamesz$named font %s does not already exist configureZcreateT)tkinter _default_rootZgetattr splitlistcallrr Znextcounterr delete_fontZ_tkinterZTclError_tk_split_call)rrootrrrrrrrr__init__Ds*  z Font.__init__cCs|jSNrrrrr__str__cz Font.__str__cCst|to|j|jkSr+)Z isinstancerr)rZotherrrr__eq__fr.z Font.__eq__cCs ||Sr+)cget)rkeyrrr __getitem__ir.zFont.__getitem__cCs|jf||idSr+)r)rr1Zvaluerrr __setitem__lr.zFont.__setitem__cCs4y|jr|dd|jWntk r.YnXdS)NrZdelete)r%r(rZ Exceptionr,rrr__del__os z Font.__del__cCst|jf|Sr+)rr&rr,rrrcopyvz Font.copycCs^d}|rd|f}|r8|d|f}|jdd|jf|S|||jdd|jf|SdS)Nr -displayofr rr)r(rrr')roption displayofrrrrrzsz Font.actualcCs|dd|jd|S)Nrconfigr )r(r)rr8rrrr0r6z Font.cgetc KsB|r"|jdd|jf||n|||dd|jSdS)Nrr:)r(rrrr')rrrrrr:s z Font.configcCs2|f}|rd||f}|j|jdd|jf|S)Nr7rmeasure)r&getintr(r)rtextr9rrrrr;s z Font.measurecOsd}|dd}|rd|f}|rL|||}|j|jdd|jf|S||jdd|jf|}i}xs (z Font.metrics)NNNFNNr+)__name__Z __module__Z __qualname__ itertoolsZcountr$rrrr*r-r/r2r3r4r5rr0r:rr;r>rrrrrs"     rcCs2|s tj}d}|rd|f}|j|jjd|S)Nrr7rfamilies)rrBr r!rr"r#)r)r9rrrrrBs rBcCs |s tj}|j|jddS)NrrrC)r)rrrrsrZ__main__Ztimesi)familyZsizeweightrDrEZhelloZ linespace)r9)ZCourierir)rz Hello, world)r=rzQuit!)r=Zcommandr)rEr?r+)Z __version__rAr ZNORMALZROMANZBOLDZITALICrrrBrr@ZTkr)ZfZprintrr:r0r;r>ZLabelZwZpackZButtonZdestroyr5ZfbZmainlooprrrrZsB