o ­=?hXã@s†ddlZddlZdZgd¢ZdZdZdZdZd!dd „ZGd d „d ƒZ d"d d „Z d!dd„Z e dkrÁe  ¡Ze ddedZee ¡ƒee d¡ƒee d¡ƒee ¡ƒee d¡ƒee d¡ƒee ƒƒee d¡e d¡ƒeejedƒe ddZee d¡ejdedƒejededZe ¡ejedejdZe ¡e edd ¡Zejed ejede ¡dSdS)#éNz0.9)ÚNORMALÚROMANÚBOLDÚITALICÚ nametofontÚFontÚfamiliesÚnamesZnormalZromanÚboldZitaliccCst|d|dS)zFGiven the name of a tk named font, returns a Font representation. T)ÚnameÚexistsÚroot)r)r r ©rú3/opt/alt/python310/lib64/python3.10/tkinter/font.pyrsrc@s¤eZdZdZe d¡Zdd„Zdd„Zdd„Z d%d d „Z d d„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zd&dd„Zdd„Zdd „ZeZd'd!d"„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|ƒ¡qt|ƒS©Nú-)ÚitemsÚappendÚstrÚtuple)ÚselfÚkwÚoptionsÚkÚvrrrÚ_set2s z Font._setcCs$g}|D] }| d|¡qt|ƒSr)rr)rÚargsrrrrrÚ_get9sz Font._getcCs:i}tdt|ƒdƒD]}||d|||dd…<q |S)Nrér)ÚrangeÚlen)rrrÚirrrÚ_mkdict?sz Font._mkdictNFcKsê|dur t d¡}t|d|ƒ}|r| | dd|¡¡}n| |¡}|s,dtt|jƒƒ}||_ |rYd|_ |j | | dd¡¡vrJtj   d|j f¡‚|rX|jdd|j g|¢RŽn|jdd |j g|¢RŽd |_ ||_ |j|_|j|_dS) Nzuse fontÚtkÚfontÚactualFr z$named font %s does not already existÚ configureZcreateT)ÚtkinterÚ_get_default_rootÚgetattrÚ splitlistÚcallrrÚnextÚcounterr Ú delete_fontZ_tkinterZTclErrorÚ_tkÚ_splitÚ_call)rr r%r r rr$rrrÚ__init__Es.    ÿ€ z Font.__init__cCs|jS©N)r ©rrrrÚ__str__dsz Font.__str__cCs"d|jj›d|jj›d|j›dS)Nú<Ú.z object ú>)Ú __class__Ú __module__Ú __qualname__r r5rrrÚ__repr__gsÿz Font.__repr__cCs&t|tƒstS|j|jko|j|jkSr4)Ú isinstancerÚNotImplementedr r0)rÚotherrrrÚ__eq__ks z Font.__eq__cCs | |¡Sr4)Úcget)rÚkeyrrrÚ __getitem__ps zFont.__getitem__cCs|jdi||i¤ŽdS)Nr)r')rrCÚvaluerrrÚ __setitem__sszFont.__setitem__cCs8z|jr| dd|j¡WdSWdStyYdSw)Nr%Údelete)r/r2r Ú Exceptionr5rrrÚ__del__vsÿ ÿz Font.__del__cCst|jfi| ¡¤ŽS)z*Return a distinct copy of the current font)rr0r&r5rrrÚcopy}óz Font.copycCs^d}|rd|f}|r|d|f}|jdd|jg|¢RŽS| | |jdd|jg|¢RŽ¡¡S)zReturn actual font attributesrú -displayofrr%r&)r2r r#r1)rÚoptionÚ displayofrrrrr&sÿz Font.actualcCs| dd|jd|¡S)zGet font attributer%Úconfigr)r2r )rrMrrrrBrKz Font.cgetc KsB|r|jdd|jg| |¡¢RŽdS| | | dd|j¡¡¡S)zModify font attributesr%rON)r2r rr#r1)rrrrrrO‘s ÿÿz Font.configcCs4|f}|r d||f}|j |jdd|jg|¢RŽ¡S)zReturn text widthrLr%Úmeasure)r0Úgetintr2r )rÚtextrNrrrrrPœs  z Font.measurecOs®d}| dd¡}|rd|f}|r'|| |¡}|j |jdd|jg|¢RŽ¡S| |jdd|jg|¢RŽ¡}i}tdt|ƒdƒD]}|j ||d ¡|||d d…<q@|S) z}Return font metrics. For best performance, create a dummy widget using this font before calling this method.rrNNrLr%Úmetricsrrr) Úpoprr0rQr2r r1r r!)rrrrrNÚresr"rrrrS£s ÿ&z Font.metrics)NNNF©NNr4)Ú__name__r;r<Ú__doc__Ú itertoolsÚcountr.rrr#r3r6r=rArDrFrIrJr&rBrOr'rPrSrrrrrs(      rcCs@|dur t d¡}d}|rd|f}|j |jjddg|¢RŽ¡S)zGet font families (as a tuple)Nzuse font.families()rrLr%r©r(r)r$r+r,)r rNrrrrr¸s  rcCs(|dur t d¡}|j |j dd¡¡S)z'Get names of defined fonts (as a tuple)Nzuse font.names()r%r r[)r rrrr Âs r Ú__main__Útimesé)ÚfamilyÚsizeÚweightr_raZhelloZ linespace)rN)ZCourierér )r%z Hello, world)rRr%zQuit!)rRZcommandr%)rar4rV)rYr(Ú __version__Ú__all__rrrrrrrr rWZTkr ÚfÚprintr&rOrBrPrSZLabelÚwZpackZButtonZdestroyrJZfbZmainlooprrrrÚsH           Ý