Ñò
…n+Oc           @   sÈ   d  d k  Z  d  d k Z d  d k Z d Z d Z d Z d Z d Z d Z d Z	 d Z
 d Z d Z d „  d „  d „  d „  g Z d „  Z d „  Z d „  Z d „  Z d „  Z d e i f d „  ƒ  YZ d S(    iÿÿÿÿNifcpi   i    i   i   i   i   i   i   i   c         C   s   |  d  d ?S(   i   i   (    (   t   bits(    (    s9   /usr/local/lib/python2.6/dist-packages/PIL/PcfFontFile.pyt   <lambda>(   s    c         C   s   |  d  d ?d @S(   i   i   i   iþÿÿÿ(    (   R    (    (    s9   /usr/local/lib/python2.6/dist-packages/PIL/PcfFontFile.pyR   )   s    c         C   s   |  d  d ?d @S(   i   i   iüÿÿÿ(    (   R    (    (    s9   /usr/local/lib/python2.6/dist-packages/PIL/PcfFontFile.pyR   *   s    c         C   s   |  d  d ?d @S(   i?   i   i   iøÿÿÿ(    (   R    (    (    s9   /usr/local/lib/python2.6/dist-packages/PIL/PcfFontFile.pyR   +   s    c         C   s    t  |  d ƒ t  |  d ƒ d >S(   Ni    i   i   (   t   ord(   t   c(    (    s9   /usr/local/lib/python2.6/dist-packages/PIL/PcfFontFile.pyt   l16/   s    c         C   sD   t  |  d ƒ t  |  d ƒ d >t  |  d ƒ d >t  |  d ƒ d >S(   Ni    i   i   i   i   i   i   (   R   (   R   (    (    s9   /usr/local/lib/python2.6/dist-packages/PIL/PcfFontFile.pyt   l321   s    c         C   s    t  |  d ƒ t  |  d ƒ d >S(   Ni   i    i   (   R   (   R   (    (    s9   /usr/local/lib/python2.6/dist-packages/PIL/PcfFontFile.pyt   b164   s    c         C   sD   t  |  d ƒ t  |  d ƒ d >t  |  d ƒ d >t  |  d ƒ d >S(   Ni   i   i   i   i   i    i   (   R   (   R   (    (    s9   /usr/local/lib/python2.6/dist-packages/PIL/PcfFontFile.pyt   b326   s    c         C   s   |  | t  i |  d | ƒ !S(   Nt    (   t   stringt   index(   t   st   o(    (    s9   /usr/local/lib/python2.6/dist-packages/PIL/PcfFontFile.pyt   sz9   s    t   PcfFontFilec           B   sD   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   t   namec         C   s¬  t  | i d ƒ ƒ } | t j o t d ‚ n t i i |  ƒ t  | i d ƒ ƒ } h  |  _ xl t | ƒ D]^ } t  | i d ƒ ƒ } t  | i d ƒ ƒ t  | i d ƒ ƒ t  | i d ƒ ƒ f |  i | <qj W| |  _ |  i	 ƒ  |  _
 |  i ƒ  } |  i | ƒ } |  i ƒ  } xš t d ƒ D]Œ }	 | |	 }
 |
 d  j	 oo | |
 \ } } } } } } } } | d f | | | | | | f d d | | f | |
 f } | |  i |	 <qqWd  S(   Ni   s   not a PCF filei   i    (   R   t   readt	   PCF_MAGICt   SyntaxErrort   FontFilet   __init__t   toct   ranget   fpt   _load_propertiest   infot   _load_metricst   _load_bitmapst   _load_encodingt   Nonet   glyph(   t   selfR   t   magict   countt   it   typet   metricst   bitmapst   encodingt   cht   ixt   xt   yt   lt   rt   wt   at   dt   fR   (    (    s9   /usr/local/lib/python2.6/dist-packages/PIL/PcfFontFile.pyR   C   s,    	 G	 
"<c         C   sz   |  i  | \ } } } |  i } | i | ƒ t | i d ƒ ƒ } | d @o t t } } n t t } } | | | | f S(   Ni   (   R   R   t   seekR   R   R   R   R   (   R   t   tagt   formatt   sizet   offsetR   t   i16t   i32(    (    s9   /usr/local/lib/python2.6/dist-packages/PIL/PcfFontFile.pyt
   _getformatc   s    	c         C   s,  h  } |  i  t ƒ \ } } } } | | i d ƒ ƒ } g  } xW t | ƒ D]I } | i | | i d ƒ ƒ t | i d ƒ ƒ | | i d ƒ ƒ f ƒ qI W| d @o | i d | d @d ƒ n | i | | i d ƒ ƒ ƒ }	 xJ | D]B \ }
 } } t |	 |
 ƒ }
 | o t |	 | ƒ } n | | |
 <qâ W| S(   Ni   i   i   (   R8   t   PCF_PROPERTIESR   R   t   appendR   R1   R   (   R   t
   propertiesR   R3   R6   R7   t   npropst   pR"   t   datat   kR   t   v(    (    s9   /usr/local/lib/python2.6/dist-packages/PIL/PcfFontFile.pyR   s   s"     G c      
   C   sö  g  } |  i  t ƒ \ } } } } | i } | d @d j oÝ x´t | | i d ƒ ƒ ƒ D]¹ } t | i d ƒ ƒ d } t | i d ƒ ƒ d }	 t | i d ƒ ƒ d }
 t | i d ƒ ƒ d } t | i d ƒ ƒ d } |	 | } | | } | | | | |	 |
 | | d f ƒ qW WnÛ x× t | | i d ƒ ƒ ƒ D]º } | | i d ƒ ƒ } | | i d ƒ ƒ }	 | | i d ƒ ƒ }
 | | i d ƒ ƒ } | | i d ƒ ƒ } | | i d ƒ ƒ } |	 | } | | } | | | | |	 |
 | | | f ƒ q4W| S(   Ni ÿ  i   i   i   i€   i    i   (   R8   t   PCF_METRICSR:   R   R   R   (   R   R$   R   R3   R6   R7   R:   R"   t   leftt   rightt   widtht   ascentt   descentt   xsizet   ysizet
   attributes(    (    s9   /usr/local/lib/python2.6/dist-packages/PIL/PcfFontFile.pyR      s<    	 

 

c         C   s»  g  } |  i  t ƒ \ } } } } | | i d ƒ ƒ } | t | ƒ j o t d ‚ n g  } x0 t | ƒ D]" }	 | i | | i d ƒ ƒ ƒ qi Wg  }
 x0 t d ƒ D]" }	 |
 i | | i d ƒ ƒ ƒ q¢ W| d @} | d @} | d @} |
 | } | i | ƒ | i | ƒ } t | } d } | o
 d } n x‡ t | ƒ D]y }	 | |	 \ } } } } } } } } | |	 | |	 d } } | i t i	 d | | f | | | !d | | | ƒ ƒ ƒ q:W| S(	   Ni   s   Wrong number of bitmapsi   i   s   1;Rt   1i   t   raw(
   R8   t   PCF_BITMAPSR   t   lent   IOErrorR   R:   t   BYTES_PER_ROWt   Imaget
   fromstring(   R   R$   R%   R   R3   R6   R7   t   nbitmapst   offsetsR"   t   bitmapSizest	   byteordert   bitordert   padindext
   bitmapsizeR>   t   padt   modeR)   R*   R+   R,   R-   R.   R/   R0   t   bt   e(    (    s9   /usr/local/lib/python2.6/dist-packages/PIL/PcfFontFile.pyR   ½   s<        





 "6c         C   s  d  g d } |  i t ƒ \ } } } } | | i d ƒ ƒ | | i d ƒ ƒ } } | | i d ƒ ƒ | | i d ƒ ƒ } }	 | | i d ƒ ƒ }
 | | d |	 | d } xc t | ƒ D]U } | | i d ƒ ƒ } | d j o- y | | | | <Wqt j
 o PqXqº qº W| S(   Ni   i   i   iÿÿ  (   R   R8   t   PCF_BDF_ENCODINGSR   R   t
   IndexError(   R   R&   R   R3   R6   R7   t   firstColt   lastColt   firstRowt   lastRowt   defaultt	   nencodingR"   t   encodingOffset(    (    s9   /usr/local/lib/python2.6/dist-packages/PIL/PcfFontFile.pyR   ê   s    ++ (	   t   __name__t
   __module__R   R   R8   R   R   R   R   (    (    (    s9   /usr/local/lib/python2.6/dist-packages/PIL/PcfFontFile.pyR   ?   s   	 			.	-i   i   i   i   i   i    i@   i€   i   (   RP   R   R	   R   R9   t   PCF_ACCELERATORSRA   RL   t   PCF_INK_METRICSR]   t   PCF_SWIDTHSt   PCF_GLYPH_NAMESt   PCF_BDF_ACCELERATORSRO   R   R   R   R   R   R   (    (    (    s9   /usr/local/lib/python2.6/dist-packages/PIL/PcfFontFile.pyt   <module>   s,   					