mς
­fIc           @   sΝ  d  Z  d k Z d Z d Z d Z d Z d   Z d f  d     YZ d d	  Z	 d d
  Z
 e d j oae i   Z e d d d d d e  Z e i   GHe i d  GHe i d  GHe i   GHe i d  GHe i d  GHe
   GHe i d  Ge i d  GHe i   GHe d d  Z e i d  Ge i d  GHe i e d d d e Z e i   e i e d d d e i Z e i   e d e d  i   Z e i d e  e i d e  e i   n d S(   s   0.9Nt   normalt   romant   boldt   italicc         C   s   t  d |  d t  S(   sF   Given the name of a tk named font, returns a Font representation.
    t   namet   existsN(   t   FontR   t   True(   R   (    (    t*   /mit/python/lib/python2.4/lib-tk/tkFont.pyt
   nametofont   s     R   c           B   sͺ   t  Z d  Z d   Z d   Z d   Z e e e e d  Z d   Z	 d   Z
 d   Z d   Z d	   Z d
   Z e d  Z d   Z d   Z e Z d   Z d   Z RS(   sφ  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   sQ   g  } x> | i   D]0 \ } } | i d |  | i t |   q Wt |  S(   Nt   -(   t   optionst   kwt   itemst   kt   vt   appendt   strt   tuple(   t   selfR   R   R   R   (    (    R   t   _set8   s     c         C   s2   g  } x | D] } | i d |  q Wt |  S(   NR
   (   R   t   argsR   R   R   (   R   R   R   R   (    (    R   t   _get?   s
     c         C   sG   h  } x: t d t |  d  D]  } | | d | | | d <q W| S(   Ni    i   i   (   R   t   ranget   lenR   t   i(   R   R   R   R   (    (    R   t   _mkdictE   s
     c         K   sC  | p t i } n | o( | i i | i i d d |   } n |  i |  } | p d t t |    } n | |  _
 | op t |  _ |  i
 | i i d d  j o t i i d |  i
 f  n | o  | i i d d |  i
 |  qn& | i i d d |  i
 |  t |  _ | |  _ | i i |  _ | i i |  _ d  S(   Nt   fontt   actualt   namess$   named font %s does not already existt	   configuret   create(   t   roott   Tkintert   _default_rootR   t   tkt	   splitlistt   callR   R   R   R   R   t   idR   t   Falset   delete_fontt   _tkintert   TclErrorR   t   _roott   _splitt   _call(   R   R    R   R   R   R   (    (    R   t   __init__K   s&    (		$		c         C   s   |  i S(   N(   R   R   (   R   (    (    R   t   __str__h   s    c         C   s    |  i | i j o t | t  S(   N(   R   R   t   othert
   isinstanceR   (   R   R0   (    (    R   t   __eq__k   s    c         C   s   |  i |  S(   N(   R   t   cgett   key(   R   R4   (    (    R   t   __getitem__n   s    c         C   s   |  i h  | | <  d  S(   N(   R   R   R4   t   value(   R   R4   R6   (    (    R   t   __setitem__q   s    c         C   s]   y( |  i o |  i d d |  i  n Wn. t t f j
 o
   n t j
 o n Xd  S(   NR   t   delete(   R   R(   R-   R   t   KeyboardInterruptt
   SystemExitt	   Exception(   R   (    (    R   t   __del__t   s    
c         C   s   t  |  i |  i    S(   s*   Return a distinct copy of the current fontN(   R   R   R+   R   (   R   (    (    R   t   copy}   s     c         C   sT   | o! |  i d d |  i d |  Sn) |  i |  i |  i d d |  i    Sd S(   s   Return actual font attributesR   R   R
   N(   t   optionR   R-   R   R   R,   (   R   R>   (    (    R   R      s     !c         C   s   |  i d d |  i d |  S(   s   Get font attributeR   t   configR
   N(   R   R-   R   R>   (   R   R>   (    (    R   R3      s     c         K   sY   | o& |  i d d |  i |  i |   n) |  i |  i |  i d d |  i    Sd S(   s   Modify font attributesR   R?   N(   R   R   R-   R   R   R   R,   (   R   R   (    (    R   R?      s     &c         C   s   t  |  i d d |  i |   S(   s   Return text widthR   t   measureN(   t   intR   R-   R   t   text(   R   RB   (    (    R   R@      s     c         G   s₯   | o, t |  i d d |  i |  i |    Sno |  i |  i d d |  i   } h  } x@ t d t	 |  d  D]& } t | | d  | | | d <qs W| Sd S(   s}   Return font metrics.

        For best performance, create a dummy widget
        using this font before calling this method.R   t   metricsi    i   i   N(   R   RA   R   R-   R   R   R,   t   resR   R   R   (   R   R   RD   R   (    (    R   RC      s     ,! $(   t   __name__t
   __module__t   __doc__R   R   R   t   NoneR'   R.   R/   R2   R5   R7   R<   R=   R   R3   R?   R   R@   RC   (    (    (    R   R   !   s"    													
	c         C   s3   |  p t i }  n |  i i |  i i d d   S(   s   Get font families (as a tuple)R   t   familiesN(   R    R!   R"   R#   R$   R%   (   R    (    (    R   RI   ―   s     c         C   s3   |  p t i }  n |  i i |  i i d d   S(   s'   Get names of defined fonts (as a tuple)R   R   N(   R    R!   R"   R#   R$   R%   (   R    (    (    R   R   ΅   s     t   __main__t   familyt   timest   sizei   t   weightt   hellot	   linespaceR   t   Courieri   RB   s   Hello, worlds   Quit!t   command(   RQ   i   R   (   t   __version__R!   t   NORMALt   ROMANt   BOLDt   ITALICR	   R   RH   RI   R   RE   t   TkR    t   fR   R?   R3   R@   RC   t   Labelt   wt   packt   Buttont   destroyR=   t   fbt   mainloop(   R   R!   RV   RT   RY   R_   R	   R[   RU   R   RW   RI   RS   R    (    (    R   t   ?   s>   			

