ó
6Þ	Pc           @   sÎ  d  Z  d d l Z d Z d Z d Z d Z d „  Z d d d	 „  ƒ  YZ d d
 „ Z	 d d „ Z
 e d k rÊe j ƒ  Z e d d d d d e ƒ Z e j ƒ  GHe j d ƒ GHe j d ƒ GHe j ƒ  GHe j d ƒ GHe j d ƒ GHe
 ƒ  GHe j d ƒ Ge j d ƒ GHe j ƒ  GHe d d ƒ Z e j d ƒ Ge j d ƒ GHe j e d d d e ƒZ e j ƒ  e j e d d d e j ƒZ e j ƒ  e d e d ƒ j ƒ  Z e j d e ƒ e j d e ƒ e j ƒ  n  d S(   s   0.9iÿÿÿÿNt   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   exists(   t   Fontt   True(   R   (    (    s#   /usr/lib/python2.7/lib-tk/tkFont.pyt
   nametofont   s    R   c           B   sª   e  Z d  Z d „  Z d „  Z d „  Z d d d e d „ Z d „  Z	 d „  Z
 d „  Z d „  Z d	 „  Z d
 „  Z d 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> | j  ƒ  D]0 \ } } | j d | ƒ | j t | ƒ ƒ q Wt | ƒ S(   Nt   -(   t   itemst   appendt   strt   tuple(   t   selft   kwt   optionst   kt   v(    (    s#   /usr/lib/python2.7/lib-tk/tkFont.pyt   _set/   s
    c         C   s2   g  } x | D] } | j  d | ƒ q Wt | ƒ S(   NR	   (   R   R   (   R   t   argsR   R   (    (    s#   /usr/lib/python2.7/lib-tk/tkFont.pyt   _get6   s    c         C   sG   i  } x: t  d t | ƒ d ƒ D]  } | | d | | | d <q W| S(   Ni    i   i   (   t   ranget   len(   R   R   R   t   i(    (    s#   /usr/lib/python2.7/lib-tk/tkFont.pyt   _mkdict<   s    c         K   s7  | s t  j } n  | r? | j j | j j d d | ƒ ƒ } n |  j | ƒ } | sm d t t |  ƒ ƒ } n  | |  _ | rç t	 |  _
 |  j | j j d d ƒ k r¿ t  j j d |  j f ‚ n  | r| j j d d |  j | Œ qn% | j j d d |  j | Œ t |  _
 | |  _ | j j |  _ | j j |  _ d  S(   Nt   fontt   actualt   namess$   named font %s does not already existt	   configuret   create(   t   Tkintert   _default_roott   tkt	   splitlistt   callR   R   t   idR   t   Falset   delete_fontt   _tkintert   TclErrorR   t   _roott   _splitt   _call(   R   t   rootR   R   R   R   (    (    s#   /usr/lib/python2.7/lib-tk/tkFont.pyt   __init__B   s&    '		"		c         C   s   |  j  S(   N(   R   (   R   (    (    s#   /usr/lib/python2.7/lib-tk/tkFont.pyt   __str___   s    c         C   s   |  j  | j  k o t | t ƒ S(   N(   R   t
   isinstanceR   (   R   t   other(    (    s#   /usr/lib/python2.7/lib-tk/tkFont.pyt   __eq__b   s    c         C   s   |  j  | ƒ S(   N(   t   cget(   R   t   key(    (    s#   /usr/lib/python2.7/lib-tk/tkFont.pyt   __getitem__e   s    c         C   s   |  j  i | | 6  d  S(   N(   R   (   R   R3   t   value(    (    s#   /usr/lib/python2.7/lib-tk/tkFont.pyt   __setitem__h   s    c         C   sW   y& |  j  r% |  j d d |  j ƒ n  Wn* t t f k
 rB ‚  n t k
 rR n Xd  S(   NR   t   delete(   R&   R+   R   t   KeyboardInterruptt
   SystemExitt	   Exception(   R   (    (    s#   /usr/lib/python2.7/lib-tk/tkFont.pyt   __del__k   s    	c         C   s   t  |  j |  j ƒ   S(   s*   Return a distinct copy of the current font(   R   R)   R   (   R   (    (    s#   /usr/lib/python2.7/lib-tk/tkFont.pyt   copyt   s    c         C   sO   | r# |  j  d d |  j d | ƒ S|  j |  j |  j  d d |  j ƒ ƒ ƒ Sd S(   s   Return actual font attributesR   R   R	   N(   R+   R   R   R*   (   R   t   option(    (    s#   /usr/lib/python2.7/lib-tk/tkFont.pyR   x   s    c         C   s   |  j  d d |  j d | ƒ S(   s   Get font attributeR   t   configR	   (   R+   R   (   R   R=   (    (    s#   /usr/lib/python2.7/lib-tk/tkFont.pyR2      s    c         K   sW   | r+ |  j  d d |  j |  j | ƒ Œ n( |  j |  j |  j  d d |  j ƒ ƒ ƒ Sd S(   s   Modify font attributesR   R>   N(   R+   R   R   R   R*   (   R   R   (    (    s#   /usr/lib/python2.7/lib-tk/tkFont.pyR>   …   s
    c         C   s   t  |  j d d |  j | ƒ ƒ S(   s   Return text widthR   t   measure(   t   intR+   R   (   R   t   text(    (    s#   /usr/lib/python2.7/lib-tk/tkFont.pyR?   ‘   s    c         G   s    | r. t  |  j d d |  j |  j | ƒ ƒ ƒ S|  j |  j d d |  j ƒ ƒ } i  } x@ t d t | ƒ d ƒ D]& } t  | | d ƒ | | | d <qn 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@   R+   R   R   R*   R   R   (   R   R   t   resR   (    (    s#   /usr/lib/python2.7/lib-tk/tkFont.pyRB   •   s    %!$N(   t   __name__t
   __module__t   __doc__R   R   R   t   NoneR%   R-   R.   R1   R4   R6   R;   R<   R   R2   R>   R   R?   RB   (    (    (    s#   /usr/lib/python2.7/lib-tk/tkFont.pyR      s"   													
	c         C   s1   |  s t  j }  n  |  j j |  j j d d ƒ ƒ S(   s   Get font families (as a tuple)R   t   families(   R   R    R!   R"   R#   (   R,   (    (    s#   /usr/lib/python2.7/lib-tk/tkFont.pyRH   ¦   s    c         C   s1   |  s t  j }  n  |  j j |  j j d d ƒ ƒ S(   s'   Get names of defined fonts (as a tuple)R   R   (   R   R    R!   R"   R#   (   R,   (    (    s#   /usr/lib/python2.7/lib-tk/tkFont.pyR   ¬   s    t   __main__t   familyt   timest   sizei   t   weightt   hellot	   linespaceR   t   Courieri   RA   s   Hello, worlds   Quit!t   command(    (   RP   i   R   (   t   __version__R   t   NORMALt   ROMANt   BOLDt   ITALICR   R   RG   RH   R   RD   t   TkR,   t   fR   R>   R2   R?   RB   t   Labelt   wt   packt   Buttont   destroyR<   t   fbt   mainloop(    (    (    s#   /usr/lib/python2.7/lib-tk/tkFont.pyt   <module>	   s>   	Ž	

