³ò
ÉaWGc           @   s@  d  Z  d d k l Z d d k Z d d k Z d d k l Z d d k l Z l	 Z	 d d k
 l Z d d k Z d d k l Z d d k l Z l Z d d	 k l Z d d
 k l Z l Z l Z l Z l Z l Z l Z l Z l Z l Z l Z l  Z  l! Z! l" Z" l# Z# l$ Z$ l% Z% l& Z& l' Z' l( Z( l) Z) l* Z* l+ Z+ l, Z, l- Z- l. Z. l/ Z/ d d k0 l1 Z1 d d k2 l3 Z3 l4 Z4 l5 Z5 l6 Z6 l7 Z7 d d k8 l9 Z9 l: Z: l; Z; l< Z< l= Z= d d k> l? Z? l@ Z@ d d kA lB ZB lC ZC lD ZD lE ZE lF ZF d d k lG ZG lH ZH d „  ZI d eJ f d „  ƒ  YZK d eK f d „  ƒ  YZL d eK f d „  ƒ  YZM d „  ZN d eM f d „  ƒ  YZO d „  ZP d eK f d „  ƒ  YZQ d eK f d „  ƒ  YZR d  eK f d! „  ƒ  YZS d" eK f d# „  ƒ  YZT d$ eJ f d% „  ƒ  YZU d& eU f d' „  ƒ  YZV d( eV f d) „  ƒ  YZW d* eV f d+ „  ƒ  YZX d, eX f d- „  ƒ  YZY d. eY f d/ „  ƒ  YZZ d0 eU f d1 „  ƒ  YZ[ d2 Z\ d3 e\ Z] d4 Z^ d5 Z_ d6 Z` d2 Za d7 Zb d8 Zc d9 ed f d: „  ƒ  YZe d; eJ f d< „  ƒ  YZf d= ef f d> „  ƒ  YZg d? eg f d@ „  ƒ  YZh dA eg f dB „  ƒ  YZi dC ef f dD „  ƒ  YZj dE ej f dF „  ƒ  YZk dG eg f dH „  ƒ  YZl dI el f dJ „  ƒ  YZm dK el f dL „  ƒ  YZn dM eg f dN „  ƒ  YZo dO eo f dP „  ƒ  YZp dQ eo f dR „  ƒ  YZq dS ef f dT „  ƒ  YZr dU eJ f dV „  ƒ  YZs h  es d7 d3 dW d7 dX ƒ dY <es d7 d3 dZ d7 dX ƒ d[ <es d7 d3 d\ d7 dX ƒ d] <es d7 d7 dX d3 dW ƒ d^ <es d7 d7 dX d3 dZ ƒ d_ <es d7 d7 dX d3 d\ ƒ d` <es d7 d7 dX d7 dX ƒ da <es d7 d3 dW db dW ƒ dc <es _t dd er f de „  ƒ  YZu df er f dg „  ƒ  YZv dh er f di „  ƒ  YZw dj er f dk „  ƒ  YZx dl er f dm „  ƒ  YZy dn er f do „  ƒ  YZz dp er f dq „  ƒ  YZ{ dr em f ds „  ƒ  YZ| dt em f du „  ƒ  YZ} dv ef f dw „  ƒ  YZ~ dx em f dy „  ƒ  YZ dz em f d{ „  ƒ  YZ€ d| em f d} „  ƒ  YZ d~ eJ f d „  ƒ  YZ‚ e‚ ƒ  Zƒ d€ „  Z„ d eJ f d‚ „  ƒ  YZ… dƒ eJ f d„ „  ƒ  YZ† d S(…   sÌ  

OVERVIEW

  mathtext is a module for parsing TeX expressions and drawing them
  into a matplotlib.ft2font image buffer.  You can draw from this
  buffer into your backend.

  A large set of the TeX symbols are provided (see below).
  Subscripting and superscripting are supported, as well as the
  over/under style of subscripting with \sum, \int, etc.

  The module uses pyparsing to parse the TeX expression, an so can
  handle fairly complex TeX expressions Eg, the following renders
  correctly

  s = r'$\mathcal{R}\prod_{i=\alpha\mathcal{B}}^\infty a_i\sin(2 \pi f x_i)$'

  Different fonts may be selected:
    \mathcal      Calligraphic fonts
    \mathrm       Roman (upright) font
    \mathit       Italic font
    \mathtt       Typewriter (monospaced) font, similar to Courier

  Additionally, if using the STIX fonts:
    \mathbb       Blackboard (double-struck) font
    \mathcircled  Circled characters
    \mathfrak     Fraktur (Gothic-style) font
    \mathscr      Script (cursive) font
    \mathsf       Sans-serif font

  The following accents are provided: \hat, \breve, \grave, \bar,
  \acute, \tilde, \vec, \dot, \ddot.  All of them have the same
  syntax, eg to make an overbar you do \bar{o} or to make an o umlaut
  you do \ddot{o}.  The shortcuts are also provided, eg: \"o \'e \`e
  \~n \.x \^y

  The spacing elements \ , \/ and \hspace{num} are provided.  \/
  inserts a small space, and \hspace{num} inserts a fraction of the
  current fontsize.  Eg, if num=0.5 and the fontsize is 12.0,
  hspace{0.5} inserts 6 points of space



  If you find TeX expressions that don't parse or render properly,
  please email me, but please check KNOWN ISSUES below first.

REQUIREMENTS

  mathtext requires matplotlib.ft2font.  Set BUILD_FT2FONT=True in
  setup.py.  See BACKENDS below for a summary of availability by
  backend.

LICENSING:

  The computer modern fonts this package uses are part of the BaKoMa
  fonts, which are (now) free for commercial and noncommercial use and
  redistribution; see license/LICENSE_BAKOMA in the matplotlib src
  distribution for redistribution requirements.

USAGE:

  See http://matplotlib.sourceforge.net/tutorial.html#mathtext for a
  tutorial introduction.

  Any text element (xlabel, ylabel, title, text, etc) can use TeX
  markup, as in

    xlabel(r'$\Delta_i$')
           ^
        use raw strings

  Math and non-math can be interpresed in the same string.  E.g.,

    r'My label $x_i$'.

  A large set of the TeX symbols are provided.  Subscripting and
  superscripting are supported, as well as the over/under style of
  subscripting with \sum, \int, etc.


  Allowed TeX symbols:

  [MGDTODO: This list is no longer exhaustive and needs to be updated]

  \/ \Delta \Downarrow \Gamma \Im \LEFTangle \LEFTbrace \LEFTbracket
  \LEFTparen \Lambda \Leftarrow \Leftbrace \Leftbracket \Leftparen
  \Leftrightarrow \Omega \P \Phi \Pi \Psi \RIGHTangle \RIGHTbrace
  \RIGHTbracket \RIGHTparen \Re \Rightarrow \Rightbrace \Rightbracket
  \Rightparen \S \SQRT \Sigma \Sqrt \Theta \Uparrow \Updownarrow
  \Upsilon \Vert \Xi \aleph \alpha \approx \angstrom \ast \asymp
  \backslash \beta \bigcap \bigcirc \bigcup \bigodot \bigoplus
  \bigotimes \bigtriangledown \bigtriangleup \biguplus \bigvee
  \bigwedge \bot \bullet \cap \cdot \chi \circ \clubsuit \coprod \cup
  \dag \dashv \ddag \delta \diamond \diamondsuit \div \downarrow \ell
  \emptyset \epsilon \equiv \eta \exists \flat \forall \frown \gamma
  \geq \gg \heartsuit \hspace \imath \in \infty \int \iota \jmath
  \kappa \lambda \langle \lbrace \lceil \leftangle \leftarrow
  \leftbrace \leftbracket \leftharpoondown \leftharpoonup \leftparen
  \leftrightarrow \leq \lfloor \ll \mid \mp \mu \nabla \natural
  \nearrow \neg \ni \nu \nwarrow \odot \oint \omega \ominus \oplus
  \oslash \otimes \phi \pi \pm \prec \preceq \prime \prod \propto \psi
  \rangle \rbrace \rceil \rfloor \rho \rightangle \rightarrow
  \rightbrace \rightbracket \rightharpoondown \rightharpoonup
  \rightparen \searrow \sharp \sigma \sim \simeq \slash \smile
  \spadesuit \sqcap \sqcup \sqrt \sqsubseteq \sqsupseteq \subset
  \subseteq \succ \succeq \sum \supset \supseteq \swarrow \tau \theta
  \times \top \triangleleft \triangleright \uparrow \updownarrow
  \uplus \upsilon \varepsilon \varphi \varphi \varrho \varsigma
  \vartheta \vdash \vee \vert \wedge \wp \wr \xi \zeta


BACKENDS

  mathtext currently works with GTK, Agg, GTKAgg, TkAgg and WxAgg and
  PS, though only horizontal and vertical rotations are supported in
  *Agg

  mathtext now embeds the TrueType computer modern fonts into the PS
  file, so what you see on the screen should be what you get on paper.

  Backends which don't support mathtext will just render the TeX
  string as a literal.  Stay tuned.


KNOWN ISSUES:

  - Certainly there are some...

Author    : John Hunter <jdhunter@ace.bsd.uchicago.edu>
            Michael Droettboom <mdroe@stsci.edu>
               (rewrite based on TeX box layout algorithms)
Copyright : John Hunter (2004,2005)
License   : matplotlib license (PSF compatible)

iÿÿÿÿ(   t   divisionN(   t   StringIO(   t   floort   ceil(   t   Set(   t   warn(   t   inft   isinf(   t   verbose(   t   Literalt   Wordt	   OneOrMoret
   ZeroOrMoret   Combinet   Groupt   Optionalt   Forwardt   NotAnyt   alphast   numst	   alphanumst   StringStartt	   StringEndt   ParseFatalExceptiont
   FollowedByt   Regext   operatorPrecedencet   opAssoct   ParseResultst   Ort   Suppresst   oneOft   ParseExceptiont
   MatchFirstt   NoMatcht   Empty(   t   AFM(   t	   enumeratet   iterablet   Buncht   get_realpath_and_statt   is_string_like(   t   FT2Fontt   FT2Imaget   KERNING_DEFAULTt   LOAD_FORCE_AUTOHINTt   LOAD_NO_HINTING(   t   findfontt   FontProperties(   t   latex_to_bakomat   latex_to_standardt   tex2unit   latex_to_cmext   stix_virtual_fonts(   t   get_data_patht   rcParamsc      	   C   s~   |  d j o d Sn y t  |  ƒ SWn t j
 o n Xy t |  i d ƒ SWn) t j
 o d t ƒ  } t | ‚ n Xd S(   sÐ   get_unicode_index(symbol) -> integer

Return the integer index (from the Unicode table) of symbol.
symbol can be a single unicode character, a TeX command (i.e. r'\pi'),
or a Type1 symbol name (i.e. 'phi').

t   -i"  s   \sA   '%(symbol)s' is not a valid Unicode character or
TeX/Type1 symbolN(   t   ordt	   TypeErrorR3   t   stript   KeyErrort   localst
   ValueError(   t   symbolt   message(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   get_unicode_indexª   s    t   MathtextBackendc           B   s>   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   s   d  |  _ d  S(   N(   t   Nonet   fonts_object(   t   self(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   __init__Æ   s    c         C   s   | |  _  | |  _ | |  _ d S(   s+   Dimension the drawing canvas; may be a noopN(   t   widtht   heightt   depth(   RE   t   wt   ht   d(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   set_canvas_sizeÉ   s    		c         C   s   t  ƒ  ‚ d  S(   N(   t   NotImplementedError(   RE   t   oxt   oyt   info(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   render_glyphÏ   s    c         C   s   t  ƒ  ‚ d  S(   N(   RN   (   RE   t   x1t   y1t   x2t   y2(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   render_filled_rectÒ   s    c         C   s   t  ƒ  ‚ d S(   sh   Return a backend specific tuple of things to return to the
        backend after all processing is done.N(   RN   (   RE   t   box(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   get_resultsÕ   s    c         C   s   t  S(   N(   R.   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   get_hinting_typeÚ   s    (   t   __name__t
   __module__RF   RM   RR   RW   RY   RZ   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRB   Å   s   					t   MathtextBackendBboxc           B   sM   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   se   A backend whose only purpose is to get a precise bounding box.
    Only required for the Agg backend.c         C   s/   t  i |  ƒ d d d d g |  _ | |  _ d  S(   Ni    (   RB   RF   t   bboxt   real_backend(   RE   R_   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   á   s    c         C   sY   t  |  i d | ƒ t  |  i d | ƒ t |  i d | ƒ t |  i d | ƒ g |  _ d  S(   Ni    i   i   i   (   t   minR^   t   max(   RE   RS   RT   RU   RV   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   _update_bboxæ   s    c         C   sB   |  i  | | i i | | i i | | i i | | i i ƒ d  S(   N(   Rb   t   metricst   xmint   ymaxt   xmaxt   ymin(   RE   RO   RP   RQ   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRR   ì   s    c         C   s   |  i  | | | | ƒ d  S(   N(   Rb   (   RE   RS   RT   RU   RV   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   render_rect_filledò   s    c         C   sÓ   | i  } | i } t d d | ƒ |  i } | d d | d d | d d | d d g } |  i ƒ  |  i i | d | d | d | d | | d | d | ƒ t | d | d | ƒ |  i i | ƒ S(   Ni    i   i   i   (   RH   RI   t   shipR^   t   _switch_to_real_backendRD   RM   RY   (   RE   RX   t   orig_heightt
   orig_depthR^   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRY   õ   s    			2
	c         C   s   |  i  i ƒ  S(   N(   R_   RZ   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRZ     s    c         C   sH   |  i  |  i _ |  i |  i  _ |  i d |  i  _ |  i d |  i  _ d  S(   Ni    i   (   R_   RD   t   mathtext_backendR^   RO   RP   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRj     s    (
   R[   R\   t   __doc__RF   Rb   RR   Rh   RY   RZ   Rj   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR]   Ý   s   						t   MathtextBackendAggRenderc           B   s>   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   s,   d |  _  d |  _ d  |  _ t i |  ƒ d  S(   Ni    (   RO   RP   RC   t   imageRB   RF   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF     s    			c         C   s<   t  i |  | | | ƒ t t | ƒ t | | ƒ ƒ |  _ d  S(   N(   RB   RM   R+   R   Rp   (   RE   RJ   RK   RL   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRM     s    c         C   s-   | i  i |  i | | | i i | i ƒ d  S(   N(   t   fontt   draw_glyph_to_bitmapRp   Rc   Re   t   glyph(   RE   RO   RP   RQ   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRR     s    	c         C   s*   |  i  i | | | t | d | ƒ ƒ d  S(   Ni   (   Rp   t   draw_rect_filledRa   (   RE   RS   RT   RU   RV   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRh     s    c         C   s;   |  i  |  i |  i |  i |  i |  i |  i |  i i ƒ  f S(   N(   RO   RP   RG   RH   RI   Rp   RD   t   get_used_characters(   RE   RX   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRY     s    c         C   s   t  S(   N(   R-   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRZ   '  s    (   R[   R\   RF   RM   RR   Rh   RY   RZ   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRo     s   						c           C   s   t  t ƒ  ƒ S(   N(   R]   Ro   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   MathtextBackendAgg*  s    t   MathtextBackendBitmapRenderc           B   s   e  Z d  „  Z RS(   c         C   s   |  i  S(   N(   Rp   (   RE   RX   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRY   .  s    (   R[   R\   RY   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRw   -  s   c           C   s   t  t ƒ  ƒ S(   N(   R]   Rw   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   MathtextBackendBitmap1  s    t   MathtextBackendPsc           B   s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   s   t  ƒ  |  _ d  |  _ d  S(   N(   R   t   pswriterRC   t   lastfont(   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   5  s    c         C   s–   |  i  | | i } | i } | i } | i } | | f |  i j o0 d t ƒ  } | | f |  _ |  i i | ƒ n d t ƒ  } |  i i | ƒ d  S(   Ns=   /%(postscript_name)s findfont
%(fontsize)s scalefont
setfont
s1   %(ox)f %(oy)f moveto
/%(symbol_name)s glyphshow

(	   RH   t   offsett   postscript_namet   fontsizet   symbol_nameR{   R=   Rz   t   write(   RE   RO   RP   RQ   R}   R~   R   t   ps(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRR   9  s    			c         C   s9   d | |  i  | | | | | f } |  i i | ƒ d  S(   Ns   %f %f %f %f rectfill
(   RH   Rz   R€   (   RE   RS   RT   RU   RV   R   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRh   L  s    %c         C   sC   t  d |  i | ƒ |  i |  i |  i |  i |  i |  i i ƒ  f S(   Ni    (   Ri   RI   RG   RH   Rz   RD   Ru   (   RE   RX   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRY   P  s    (   R[   R\   RF   RR   Rh   RY   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRy   4  s   			t   MathtextBackendPdfc           B   s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   s   g  |  _  g  |  _ d  S(   N(   t   glyphst   rects(   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   Z  s    	c         C   sO   | i  i } |  i | | i } |  i i | | | | i | i | i f ƒ d  S(   N(	   Rq   t   fnameRH   R|   Rƒ   t   appendR~   t   numR   (   RE   RO   RP   RQ   t   filename(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRR   ^  s
    	c         C   s/   |  i  i | |  i | | | | | f ƒ d  S(   N(   R„   R†   RH   (   RE   RS   RT   RU   RV   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRh   e  s    c         C   sI   t  d |  i | ƒ |  i |  i |  i |  i |  i |  i |  i i ƒ  f S(   Ni    (   Ri   RI   RG   RH   Rƒ   R„   RD   Ru   (   RE   RX   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRY   h  s    (   R[   R\   RF   RR   Rh   RY   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR‚   Y  s   			t   MathtextBackendSvgc           B   s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   s   g  |  _  g  |  _ d  S(   N(   t
   svg_glyphst	   svg_rects(   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   r  s    	c         C   sR   |  i  | | i } t | i ƒ } |  i i | i | i | | | | i f ƒ d  S(   N(	   RH   R|   t   unichrR‡   RŠ   R†   Rq   R~   Rc   (   RE   RO   RP   RQ   t   thetext(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRR   v  s    	c         C   s3   |  i  i | |  i | d | | | | f ƒ d  S(   Ni   (   R‹   R†   RH   (   RE   RS   RT   RU   RV   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRh   |  s    	c         C   s[   t  d |  i | ƒ t d |  i d |  i ƒ } |  i |  i |  i |  i | |  i i ƒ  f S(   Ni    RŠ   R‹   (	   Ri   RI   R'   RŠ   R‹   RG   RH   RD   Ru   (   RE   RX   t   svg_elements(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRY   €  s    (   R[   R\   RF   RR   Rh   RY   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR‰   q  s   			t   MathtextBackendCairoc           B   s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   s   g  |  _  g  |  _ d  S(   N(   Rƒ   R„   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   ‹  s    	c         C   sL   | | i  |  i } t | i ƒ } |  i i | i | i | | | f ƒ d  S(   N(   R|   RH   RŒ   R‡   Rƒ   R†   Rq   R~   (   RE   RO   RP   RQ   R   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRR     s    	c         C   s/   |  i  i | | |  i | | | | f ƒ d  S(   N(   R„   R†   RH   (   RE   RS   RT   RU   RV   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRh   •  s    	c         C   s=   t  d |  i | ƒ |  i |  i |  i |  i |  i |  i f S(   Ni    (   Ri   RI   RG   RH   Rƒ   R„   (   RE   RX   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRY   ™  s    (   R[   R\   RF   RR   Rh   RY   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR   Š  s   			t   Fontsc           B   sz   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z RS(   sõ   
    An abstract base class for fonts that want to render mathtext

    The class must be able to take symbol keys and font file names and
    return the character metrics.  It also delegates to a backend class
    to do the actual drawing.
    c         C   s+   | |  _  | |  _ |  |  i _ h  |  _ d S(   sô   default_font_prop: A FontProperties object to use for the
        default non-math font, or the base font for Unicode font
        rendering.
        mathtext_backend: A subclass of MathTextBackend used to
        delegate the actual rendering.N(   t   default_font_propRm   RD   t   used_characters(   RE   R‘   Rm   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   ª  s    		c         C   s   d |  _ d S(   sO   Fix any cyclical references before the object is about
        to be destroyed.N(   RC   R’   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   destroy¶  s    c         C   s   d S(   s¡  
        Get the kerning distance for font between sym1 and sym2.

        fontX: one of the TeX font names, tt, it, rm, cal, sf, bf or
               default (non-math)
        symX:  a symbol in raw TeX form. e.g. '1', 'x' or '\sigma'
        fontsizeX: the fontsize in points
        dpi: the current dots-per-inch

        sym is a single symbol(alphanum, punct) or a special symbol
        like \sigma.

        g        (    (   RE   t   font1t   sym1t	   fontsize1t   font2t   sym2t	   fontsize2t   dpi(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   get_kern»  s    c         C   s"   |  i  | | | | | ƒ } | i S(   s  
        font: one of the TeX font names, tt, it, rm, cal, sf, bf or
               default (non-math)
        sym:  a symbol in raw TeX form. e.g. '1', 'x' or '\sigma'
        fontsize: font size in points
        dpi: current dots-per-inch

          advance
          height
          width
          xmin, xmax, ymin, ymax  - the ink rectangle of the glyph
          iceberg - the distance from the baseline to the top of the glyph.
             horiBearingY in Truetype parlance, height in TeX parlance
        (   t	   _get_infoRc   (   RE   Rq   t
   font_classt   symR~   Rš   RQ   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   get_metricsÌ  s    c         C   sR   t  | ƒ t  | ƒ t  | ƒ |  _ |  _ |  _ |  i i |  i |  i |  i ƒ d S(   s+   Dimension the drawing canvas; may be a noopN(   R   RG   RH   RI   Rm   RM   (   RE   RJ   RK   RL   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRM   Þ  s    /c         C   s…   |  i  | | | | | ƒ } t | i i ƒ \ }	 }
 |  i i |
 |	 t ƒ  f ƒ } | d i t | i	 ƒ ƒ |  i
 i | | | ƒ d  S(   Ni   (   Rœ   R(   Rq   R…   R’   t
   setdefaultR   t   updateRŒ   R‡   Rm   RR   (   RE   RO   RP   t   facenameR   Rž   R~   Rš   RQ   t   realpatht   stat_keyR’   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRR   ã  s    	c         C   s   |  i  i | | | | ƒ d  S(   N(   Rm   Rh   (   RE   RS   RT   RU   RV   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRh   ë  s    c         C   s   t  ƒ  ‚ d  S(   N(   RN   (   RE   Rq   R~   Rš   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   get_xheightî  s    c         C   s   t  ƒ  ‚ d  S(   N(   RN   (   RE   Rq   R~   Rš   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   get_underline_thicknessñ  s    c         C   s   |  i  S(   N(   R’   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRu   ô  s    c         C   s   |  i  i | ƒ S(   N(   Rm   RY   (   RE   RX   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRY   ÷  s    c         C   s   | | f g S(   s[   
        Override if your font provides multiple sizes of the same
        symbol.
        (    (   RE   t   fontnameRž   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt!   get_sized_alternatives_for_symbolú  s    (   R[   R\   Rn   RF   R“   R›   RŸ   RM   RR   Rh   R¥   R¦   Ru   RY   R¨   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR   ¡  s   											t   TruetypeFontsc           B   s‡   e  Z d  Z e i i e ƒ  d ƒ Z h  Z d d d „  ƒ  YZ	 d „  Z
 d „  Z d „  Z d „  Z d „  Z d	 „  Z d
 „  Z d „  Z RS(   s`   
    A generic base class for all font setups that use Truetype fonts
    (through ft2font)
    t   fontst
   CachedFontc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s[   | |  _  | i ƒ  |  _ t g  } |  i i ƒ  D] \ } } | | | f q/ ~ ƒ |  _ d  S(   N(   Rq   t   get_charmapt   charmapt   dictt	   iteritemst   glyphmap(   RE   Rq   t   _[1]t   ccodet   glyphind(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   
  s    	c         C   s   t  |  i ƒ S(   N(   t   reprRq   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   __repr__  s    (   R[   R\   RF   Rµ   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR«   	  s   	c         C   sh   t  i |  | | ƒ h  |  _ |  i h  j o8 t | ƒ } |  i t t | ƒ ƒ ƒ } | |  i d <n d  S(   Nt   default(   R   RF   t   glyphdt   _fontsR/   R«   R*   t   str(   RE   R‘   Rm   Rˆ   t   default_font(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF     s    	c         C   s   d  |  _ t i |  ƒ d  S(   N(   RC   R·   R   R“   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR“     s    	c         C   sœ   | |  i  j o |  i  | } n | } |  i i | ƒ } | d j oR t | ƒ } |  i | ƒ } | |  i | <| |  i | i <| |  i | i i ƒ  <n | S(   s‡   Looks up a CachedFont with its charmap and inverse charmap.
        font may be a TeX font name (cal, rm, it etc.), or postscript name.N(   t   fontmapR¸   t   getRC   R*   R«   R}   t   lower(   RE   Rq   t   basenamet   cached_font(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt	   _get_font!  s    c         C   s6   | i  i d j o | i d d d | d Sn d S(   Nt   Cmex10g      P@g       @g      p@g      R@g        g      @(   Rq   R}   RH   (   RE   R¿   Rs   R~   Rš   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   _get_offset2  s    c         C   s˜  | | | | | f } |  i  i | ƒ } | d j	 o | Sn |  i | | | | ƒ \ } }	 }
 } } | i } | i | | ƒ | i |	 d |  i i ƒ  ƒ} g  } | i	 D] } | | d q¨ ~ \ } } } } |  i
 | | | | ƒ } t d | i d d | i d d | i d d | d | d	 | | d
 | | d | i d | d | ƒ 	} t d | d | d | i d | d |
 d |	 d | d | ƒ } |  i  | <| S(   s/   load the cmfont, metrics and glyph with cachingt   flagsg      P@t   advanceg      ð@RH   RG   Rd   Rf   Rg   Re   t   icebergt   slantedRq   R~   R}   Rc   R   R‡   Rs   R|   N(   R·   R¼   RC   t
   _get_glyphRq   t   set_sizet	   load_charRm   RZ   R^   RÂ   R'   t   linearHoriAdvanceRH   RG   t   horiBearingYR}   (   RE   R§   R   Rž   R~   Rš   t   keyt   bunchR¿   R‡   R   RÆ   Rq   Rs   R±   t   valRd   Rg   Rf   Re   R|   Rc   t   result(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRœ   7  s@    '	4

		c         C   sy   |  i  | ƒ } | i i | | ƒ | i i d ƒ } | d  j o& |  i | d d | | ƒ } | i Sn | d d } | S(   Nt   pcltt   itt   xt   xHeightg      P@(   RÀ   Rq   RÈ   t   get_sfnt_tableRC   RŸ   RÅ   (   RE   Rq   R~   Rš   R¿   RÐ   Rc   RÓ   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR¥   b  s    c         C   s.   |  i  | ƒ } t d | i i d | d ƒ S(   Ng      ð?g      P@g      $@(   RÀ   Ra   Rq   t   underline_thickness(   RE   Rq   R~   Rš   R¿   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR¦   m  s    c
         C   s~   | | j om | | j o` |  i  | | | | |	 ƒ }
 |  i  | | | | |	 ƒ } |
 i } | i |
 i | i t ƒ d Sn d S(   Ng      P@g        (   Rœ   Rq   t   get_kerningR‡   R,   (   RE   R”   t
   fontclass1R•   R–   R—   t
   fontclass2R˜   R™   Rš   t   info1t   info2Rq   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR›   q  s    	!(    (   R[   R\   Rn   t   ost   patht   joinR6   t   basepathR¸   R«   RF   R“   RÀ   RÂ   Rœ   R¥   R¦   R›   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR©     s   
	
				+		t   BakomaFontsc           B   s7  e  Z d  Z h  d d <d d <d d <d d <d	 d
 <d d <d d <Z h  Z d „  Z e d i ƒ  ƒ Z d „  Z	 h  di dj dk dl dm g d <dn do dp dq dr g d <ds dt du dv dw g d <dx dy dz d{ d| g d  <d} d~ d d€ g d$ <d d‚ dƒ d„ g d( <d… d† d‡ dˆ g d0 <d‰ dŠ d‹ dŒ g d5 <d dŽ d d g d: <d‘ d’ d“ d” g d? <d• d– d— d˜ g dD <d™ dš d› dœ g dI <d dž dŸ d  g dN <d¡ d¢ d£ d¤ g dS <d¥ d¦ d§ d¨ d© g dP <dª d« d¬ d­ g d\ <d® d¯ d° d± g da <Z
 x4 d² d³ d´ dµ d¶ d· g D] \ Z Z e
 e e
 e <qWdh „  Z RS(¸   s6   
    Use the Bakoma true type fonts for rendering
    t   cmsy10t   calt   cmr10t   rmt   cmtt10t   ttt   cmmi10RÑ   t   cmb10t   bft   cmss10t   sft   cmex10t   exc         O   s„   t  i |  | | Ž t |  i ƒ p] xZ |  i i ƒ  D]E \ } } t i i |  i	 d | d ƒ } | |  i | <| |  i | <q3 Wn d  S(   Nt   ttfs   .ttf(
   R©   RF   t   lenR»   t   _fontmapR¯   RÛ   RÜ   RÝ   RÞ   (   RE   t   argst   kwargsRÌ   RÎ   t   fullpath(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   ˆ  s     s
   \int \ointc         C   s³  d  } | |  i j oˆ t i | ƒ ox t | \ } } | d j p | |  i j } y |  i | ƒ }	 Wn t j
 o q2X|	 i i | ƒ } |	 i	 | } n• t
 | ƒ d j o | d j } y |  i | ƒ }	 Wn t j
 o q2Xt | ƒ } |	 i i | ƒ }
 |
 d  j	 o |	 i i |	 i | ƒ } q2n | d  j oa t d | i d d ƒ t ƒ d } |  i | ƒ }	 d } |	 i | }
 |	 i i |
 ƒ } t } n |	 | | | | f S(   NRæ   i   RÑ   s;   Unrecognized symbol '%s'. Substituting with a dummy symbol.t   asciit   backslashreplacei?   (   RC   R»   R1   t   has_keyt   _slanted_symbolsRÀ   t   RuntimeErrorRq   t   get_glyph_nameR°   Rî   R9   R­   R¼   R   t   encodet   MathTextWarningt   False(   RE   R§   R   Rž   R~   R   R¾   R‡   RÆ   R¿   t   gid(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRÇ   ’  s>     	
t   (s   ¡s   ³s   µs   Ãt   )s   ¢s   ´s   ¶s   !t   {s   ©t   ns   ½t   }s   ªt   os   ¾t   [s   £RK   s   "t   ]s   ¤t   is   #s   ¥t   js   ¹s   $s   \lfloors   ¦t   ks   ºs   %s   \rfloors   §t   ls   »s   &s   \lceils   ¨t   ms   ¼s   's   \rceils   ­t   Ds   ¿s   *s   \langles   ®t   Es   Às   +s   \ranglet   pt   qt   rt   ss	   \__sqrt__s   ²s   /s   Âs   -s
   \backslashs   ±s   .s   Ës   ,s   ^t   bt   cRL   s   \widehats   ~t   et   ft   gs
   \widetildes
   \leftparens   ightparents
   \leftbraces
   ightbraces   \leftbrackets   ightbracketc         C   s.   |  i  i | ƒ } | o | Sn | | f g S(   N(   t   _size_alternativesR¼   (   RE   R§   Rž   t   alternatives(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR¨   é  s    (   s   rmRý   (   s   exs   ¡(   s   exs   ³(   s   exs   µ(   s   exs   Ã(   s   rmRþ   (   s   exs   ¢(   s   exs   ´(   s   exs   ¶(   s   exs   !(   s   calRÿ   (   s   exs   ©(   s   exs   n(   s   exs   ½(   s   exRý   (   s   calR  (   s   exs   ª(   s   exs   o(   s   exs   ¾(   s   exRþ   (   s   rmR  (   s   exs   £(   s   exs   h(   s   exs   "(   s   rmR  (   s   exs   ¤(   s   exs   i(   s   exs   #(   s   exs   ¥(   s   exs   j(   s   exs   ¹(   s   exs   $(   s   exs   ¦(   s   exs   k(   s   exs   º(   s   exs   %(   s   exs   §(   s   exs   l(   s   exs   »(   s   exs   &(   s   exs   ¨(   s   exs   m(   s   exs   ¼(   s   exs   '(   s   exs   ­(   s   exs   D(   s   exs   ¿(   s   exs   *(   s   exs   ®(   s   exs   E(   s   exs   À(   s   exs   +(   s   exs   p(   s   exs   q(   s   exs   r(   s   exs   s(   s   exs   ²(   s   exs   /(   s   exs   Â(   s   exs   -(   s   rms   /(   s   exs   ±(   s   exs   .(   s   exs   Ë(   s   exs   ,(   s   rms   ^(   s   exs   b(   s   exs   c(   s   exs   d(   s   rms   ~(   s   exs   e(   s   exs   f(   s   exs   g(   s
   \leftparenRý   (   s   ightparentRþ   (   s
   \leftbraceRÿ   (   s
   ightbraceR  (   s   \leftbracketR  (   s   ightbracketR  (   R[   R\   Rn   Rï   R»   RF   R   t   splitRö   RÇ   R  t   aliast   targetR¨   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRß   z  sp   							(									 t   UnicodeFontsc           B   sP   e  Z d  Z h  Z e Z d „  Z e d i ƒ  ƒ Z	 d „  Z
 d „  Z d „  Z RS(   s7   An abstract base class for handling Unicode fonts.
    c         O   s¸   t  d o t | | Ž  |  _ n
 d  |  _ t i |  | | Ž t |  i ƒ pg x; d i ƒ  D]- } t  d | } t	 | ƒ } | |  i | <qZ Wt
 d ƒ } t	 | ƒ } | |  i d <n d  S(   Ns   mathtext.fallback_to_cms   cal rm tt it bf sfs	   mathtext.Rë   Rì   (   R7   Rß   t   cm_fallbackRC   R©   RF   Rî   R»   R  R/   R0   (   RE   Rð   Rñ   t   texfontt   propRq   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   ö  s    	 s
   \int \ointc         C   s
   | | f S(   N(    (   RE   R§   R   t   uniindex(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   _map_virtual_font  s    c         C   sm  t  } |  i o0 t i | ƒ } | d  j	 o d } t } q@ n | pY y t | ƒ } t } Wq  t j
 o0 t d ƒ } t	 d | i
 d d ƒ t ƒ q  Xn |  i | | | ƒ \ } } | o| } | d j oN t | ƒ } t i | ƒ d d j p t i | ƒ i d	 ƒ o
 d
 } q#n | d j p | |  i j }	 t  } y |  i | ƒ }
 Wn t j
 o qÈXy |
 i | } t } WqÈt j
 o0 t	 d |
 i i | i
 d d ƒ f t ƒ qÈXn | py |  i o* t	 d t ƒ |  i i | d | | ƒ SqHt	 d t ƒ d
 } | } |  i | ƒ }
 d } |
 i | } t  }	 n |
 i i | ƒ } |
 | | | |	 f S(   NRì   t   ?s"   No TeX to unicode mapping for '%s'Ró   Rô   RÑ   i    t   Ls   GREEK CAPITALRã   s(   Font '%s' does not have a glyph for '%s's0   Substituting with a symbol from Computer Modern.s!   Substituting with a dummy symbol.i¤   (   Rû   t   use_cmexR4   R¼   RC   t   TrueRA   R>   R9   R   Rù   Rú   R  RŒ   t   unicodedatat   categoryt   namet
   startswithRö   RÀ   R÷   R­   R<   Rq   R}   R  RÇ   Rø   (   RE   R§   R   Rž   R~   t   found_symbolR  t   new_fontnamet	   unistringRÆ   R¿   t
   glyphindexR   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRÇ     sj    


	
	
c         C   s.   |  i  o |  i  i | | ƒ Sn | | f g S(   N(   R  R¨   (   RE   R§   Rž   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR¨   N  s    
	(   R[   R\   Rn   R»   R#  R"  RF   R   R  Rö   R  RÇ   R¨   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR  ï  s   			Ct	   StixFontsc           B   s¹   e  Z d  Z h  d d <d d <d d <d d <d	 d
 <d d <d d <d d <d d <d d <d d <d d <Z h  Z e Z e Z e Z d „  Z	 d „  Z
 h  Z d „  Z RS(   s2   
    A font handling class for the STIX fonts
    t   STIXGeneralRã   t   STIXGeneralItalicRÑ   t   STIXGeneralBolRè   t
   STIXNonUnit   nonunirmt   STIXNonUniItat   nonuniitt   STIXNonUniBolt   nonunibfi    t   STIXSiz1Symi   t   STIXSiz2Symi   t   STIXSiz3Symi   t   STIXSiz4Symi   t   STIXSiz5Symi   c         O   s„   t  i |  | | Ž t |  i ƒ p] xZ |  i i ƒ  D]E \ } } t i i |  i	 d | d ƒ } | |  i | <| |  i | <q3 Wn d  S(   NRí   s   .ttf(
   R©   RF   Rî   R»   Rï   R¯   RÛ   RÜ   RÝ   RÞ   (   RE   Rð   Rñ   RÌ   R&  Rò   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   k  s     c   
      C   s…  t  i | ƒ } |  i o! | d  j o t  d } t } n t } | d  j	 où t | t ƒ o | | } n d } t | ƒ } xe | | j  oW | | d } | | }	 | |	 d j  o
 | } q€ | |	 d j o Pq€ | d } q€ W| |	 d j o5 | |	 d j o$ | |	 d |	 d } |	 d } qF| p d } d } qFn | d j o( | d	 j o | d
 j o d | } n | | f S(   NRê   i    i   i   i   RÑ   Rã   Rè   i à  iÿø  t   nonuni(   s   its   rms   bf(	   R5   R¼   t   _sansRC   R#  Rû   t
   isinstanceR®   Rî   (
   RE   R§   R   R  t   mappingt   doing_sans_conversiont   lot   hit   midt   range(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR  s  s8    



"c         C   sÍ   |  i  i | ƒ } | o | Sn g  } y t | ƒ } Wn  t j
 o | | f g Sn Xx_ t d ƒ D]Q } |  i | ƒ } | i i | ƒ } | d  j	 o | i | t	 | ƒ f ƒ qg qg W| |  i  | <| S(   Ni   (
   R  R¼   RA   R>   RC  RÀ   R­   RC   R†   RŒ   (   RE   R§   Rž   R  R  R  R¿   R+  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR¨   ž  s      !(   R[   R\   Rn   Rï   R»   Rû   R"  R  R<  RF   R  R  R¨   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR,  T  s*   												*t   StixSansFontsc           B   s   e  Z d  Z e Z RS(   s`   
    A font handling class for the STIX fonts (using sans-serif
    characters by default).
    (   R[   R\   Rn   R#  R<  (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRD  ²  s   t   StandardPsFontsc           B   s¤   e  Z d  Z e i i e ƒ  d d ƒ Z h  d d <d d <d d <d	 d
 <d d <d d <d d <Z	 d „  Z
 d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s­   
    Use the standard postscript fonts for rendering to backend_ps

    Unlike the other font classes, BakomaFont and UnicodeFont, this
    one requires the Ps backend.
    Rª   t   afmt   pzcmi8aRá   t   pncr8aRã   t   pcrr8aRå   t   pncri8aRÑ   t   phvr8aRê   t   pncb8aRè   t   psyrc         C   su   t  i |  | t ƒ  ƒ h  |  _ h  |  _ t | d d ƒ} t t | d ƒ ƒ } | | _ | |  i d <t	 ƒ  |  _
 d  S(   Nt   fontextRF  R  R¶   (   R   RF   Ry   R·   Rª   R/   R$   t   fileR…   R   Rz   (   RE   R‘   Rˆ   Rº   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   Ë  s    			c         C   s¨   | |  i  j o |  i  | } n | } |  i i | ƒ } | d  j o^ t i i |  i | d ƒ } t t	 | d ƒ ƒ } | | _
 | |  i | <| |  i | i ƒ  <n | S(   Ns   .afmR  (   R»   Rª   R¼   RC   RÛ   RÜ   RÝ   RÞ   R$   RO  R…   t   get_fontname(   RE   Rq   R¾   R¿   R…   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRÀ   ×  s    	c         C   s«  | | | | f } |  i  i | ƒ } | d j	 o | Sn | d j o= t | ƒ d j p  t i t | ƒ ƒ i d ƒ o
 d } n t } t	 i
 | ƒ o& t	 | \ } }	 t |	 ƒ }
 t } nA t | ƒ d j o | }
 t |
 ƒ }	 t } n t d | t ƒ | d j } |  i | ƒ } | oM y | i |
 ƒ } Wqnt j
 o' t d | i | f t ƒ t } qnXn | p) d }
 } t |
 ƒ }	 | i |
 ƒ } n d } d	 | } g  } | i |
 ƒ D] } | | | qÂ~ \ } } } } t d
 | i |
 ƒ | d | i |
 ƒ | d | i |
 ƒ | d | d | d | | d | | d | | d | ƒ 	} t d | d | d | i ƒ  d | d | d |	 d |
 d | ƒ |  i  | <|  i  | S(   s/   load the cmfont, metrics and glyph with cachingRÑ   i   R!  Rã   s.   No TeX to built-in Postscript mapping for '%s's2   No glyph in standard Postscript font '%s' for '%s'R   i    gü©ñÒMbP?RÄ   RG   RH   Rd   Rf   Rg   Re   RÅ   RÆ   Rq   R~   R}   Rc   R   R‡   Rs   R|   N(   R·   R¼   RC   Rî   R$  R%  t   unicodeR'  Rû   R2   Rõ   t   chrR#  R9   R   Rú   RÀ   t   get_name_charR<   R}   t   get_bbox_charR'   t   get_width_chart   get_height_charRP  (   RE   R§   R   Rž   R~   Rš   RÌ   t   tupR(  R‡   Rs   RÆ   Rq   R   R|   t   scaleR±   RÎ   Rd   Rg   Rf   Re   Rc   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRœ   æ  sr     





3


	c
         C   s   | | j on | | j oa |  i  | | | | |	 ƒ }
 |  i  | | | | |	 ƒ } |
 i } | i |
 i | i ƒ d | Sn d S(   Ngü©ñÒMbP?g        (   Rœ   Rq   t   get_kern_distRs   (   RE   R”   R×   R•   R–   R—   RØ   R˜   R™   Rš   RÙ   RÚ   Rq   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR›   4  s    	"c         C   s!   |  i  | ƒ } | i ƒ  d | S(   Ngü©ñÒMbP?(   RÀ   R¥   (   RE   Rq   R~   Rš   R¿   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR¥   >  s    c         C   s!   |  i  | ƒ } | i ƒ  d | S(   Ngü©ñÒMbP?(   RÀ   R¦   (   RE   Rq   R~   Rš   R¿   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR¦   B  s    N(   R[   R\   Rn   RÛ   RÜ   RÝ   R6   RÞ   RC   R»   RF   RÀ   Rœ   R›   R¥   R¦   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRE  ¹  s   								N	
	gffffffæ?g      ð?i   gš™™™™™É?g333333Ó?g        g
×£p=
Ç?Rú   c           B   s   e  Z RS(    (   R[   R\   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRú   p  s   t   Nodec           B   sM   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   s,   A node in the TeX box model
    node133
    c         C   s   d |  _  d  S(   Ni    (   t   size(   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   w  s    c         C   s
   |  i  ƒ  S(   N(   t   __internal_repr__(   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRµ   z  s    c         C   s
   |  i  i S(   N(   t	   __class__R[   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR\  }  s    c         C   s   d S(   Ng        (    (   RE   t   next(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRÖ   €  s    c         C   s   |  i  d 7_  d S(   sx   Shrinks one level smaller.  There are only three levels of sizes,
        after which things will no longer get smaller.i   N(   R[  (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   shrinkƒ  s    c         C   s   |  i  d 8_  d S(   sP   Grows one level larger.  There is no limit to how big something
        can get.i   N(   R[  (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   growˆ  s    c         C   s   d  S(   N(    (   RE   RÒ   t   y(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   render  s    (
   R[   R\   Rn   RF   Rµ   R\  RÖ   R_  R`  Rb  (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRZ  s  s   						t   Boxc           B   s2   e  Z d  Z d „  Z d „  Z d „  Z d „  Z RS(   s9   Represents any node with a physical location.
    node135c         C   s,   t  i |  ƒ | |  _ | |  _ | |  _ d  S(   N(   RZ  RF   RG   RH   RI   (   RE   RG   RH   RI   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   “  s    		c         C   sR   t  i |  ƒ |  i t j  o1 |  i t 9_ |  i t 9_ |  i t 9_ n d  S(   N(   RZ  R_  R[  t   NUM_SIZE_LEVELSRG   t   SHRINK_FACTORRH   RI   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR_  ™  s
    c         C   s>   t  i |  ƒ |  i t 9_ |  i t 9_ |  i t 9_ d  S(   N(   RZ  R`  RG   t   GROW_FACTORRH   RI   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR`     s    c         C   s   d  S(   N(    (   RE   RS   RT   RU   RV   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRb  ¦  s    (   R[   R\   Rn   RF   R_  R`  Rb  (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRc    s
   			t   Vboxc           B   s   e  Z d  Z d „  Z RS(   s.   
    A box with only height (zero width).
    c         C   s   t  i |  d | | ƒ d  S(   Ng        (   Rc  RF   (   RE   RH   RI   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   ­  s    (   R[   R\   Rn   RF   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRg  ©  s   t   Hboxc           B   s   e  Z d  Z d „  Z RS(   s8   
    A box with only width (zero height and depth).
    c         C   s   t  i |  | d d ƒ d  S(   Ng        (   Rc  RF   (   RE   RG   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   ´  s    (   R[   R\   Rn   RF   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRh  °  s   t   Charc           B   sV   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 RS(	   s   Represents a single character.  Unlike TeX, the font
    information and metrics are stored with each Char to make it
    easier to lookup the font metrics when needed.  Note that TeX
    boxes have a width, height, and depth, unlike Type1 and Truetype
    which use a full bounding box and an advance in the x-direction.
    The metrics must be converted to the TeX way, and the advance (if
    different from width) must be converted into a Kern node when the
    Char is added to its parent Hlist.
    node134c         C   sƒ   t  i |  ƒ | |  _ | i |  _ t | i t t t f ƒ p t	 ‚ | i |  _ | i
 |  _
 | i |  _ | i |  _ |  i ƒ  d  S(   N(   RZ  RF   R  t   font_outputR=  Rq   R¹   RQ  t   intt   AssertionErrorR   R~   Rš   t   _update_metrics(   RE   R  t   state(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   Á  s    	#c         C   s   d |  i  S(   Ns   `%s`(   R  (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR\  Î  s    c         C   s„   |  i  i |  i |  i |  i |  i |  i ƒ } |  _ |  i d j o | i |  _	 n | i	 |  _	 | i
 |  _ | i
 | i |  _ d  S(   Nt    (   Rj  RŸ   Rq   R   R  R~   Rš   t   _metricsRÄ   RG   RÅ   RH   RI   (   RE   Rc   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRm  Ñ  s    	+c         C   s
   |  i  i S(   N(   Rp  RÆ   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt
   is_slantedÛ  s    c      
   C   sz   |  i  i |  i } d } t | t ƒ oI |  i i |  i |  i |  i	 |  i
 | i | i | i	 | i
 |  i ƒ	 } n | | S(   s    Return the amount of kerning between this and the given
        character.  Called when characters are strung together into
        Hlists to create Kern nodes.g        (   Rp  RÄ   RG   R=  Ri  Rj  R›   Rq   R   R  R~   Rš   (   RE   R^  RÄ   t   kern(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRÖ   Þ  s    	c         C   s5   |  i  i | | |  i |  i |  i |  i |  i ƒ d S(   s"   Render the character to the canvasN(   Rj  RR   Rq   R   R  R~   Rš   (   RE   RÒ   Ra  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRb  ë  s    	c         C   sa   t  i |  ƒ |  i t j  o@ |  i t 9_ |  i t 9_ |  i t 9_ |  i t 9_ n d  S(   N(	   RZ  R_  R[  Rd  R~   Re  RG   RH   RI   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR_  ñ  s    c         C   sM   t  i |  ƒ |  i t 9_ |  i t 9_ |  i t 9_ |  i t 9_ d  S(   N(   RZ  R`  R~   Rf  RG   RH   RI   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR`  ù  s
    (   R[   R\   Rn   RF   R\  Rm  Rq  RÖ   Rb  R_  R`  (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRi  ·  s   				
				t   Accentc           B   s2   e  Z d  Z d „  Z d „  Z d „  Z d „  Z RS(   s”   The font metrics need to be dealt with differently for accents,
    since they are already offset correctly from the baseline in
    TrueType fonts.c         C   sg   |  i  i |  i |  i |  i |  i |  i ƒ } |  _ | i | i	 |  _
 | i | i |  _ d |  _ d  S(   Ni    (   Rj  RŸ   Rq   R   R  R~   Rš   Rp  Rf   Rd   RG   Re   Rg   RH   RI   (   RE   Rc   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRm    s
    	+c         C   s   t  i |  ƒ |  i ƒ  d  S(   N(   Ri  R_  Rm  (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR_    s    c         C   s   t  i |  ƒ |  i ƒ  d  S(   N(   Ri  R`  Rm  (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR`    s    c         C   sI   |  i  i | |  i i | |  i i |  i |  i |  i |  i |  i	 ƒ d S(   s"   Render the character to the canvasN(
   Rj  RR   Rp  Rd   Rg   Rq   R   R  R~   Rš   (   RE   RÒ   Ra  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRb    s    	(   R[   R\   Rn   Rm  R_  R`  Rb  (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRs     s
   			t   Listc           B   sD   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s<   A list of nodes (either horizontal or vertical).
    node135c         C   sG   t  i |  d d d ƒ d |  _ | |  _ d |  _ d |  _ d |  _ d  S(   Ng        i    (   Rc  RF   t   shift_amountt   childrent   glue_sett	   glue_signt
   glue_order(   RE   t   elements(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF     s    				c         C   sY   d |  i  ƒ  |  i |  i |  i |  i d i g  } |  i D] } | t | ƒ q8 ~ ƒ f S(   Ns!   [%s <%.02f %.02f %.02f %.02f> %s]Ro  (   R\  RG   RH   RI   Ru  RÝ   Rv  R´   (   RE   R±   RÒ   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRµ   %  s
    	c         C   sM   d } x@ t  t | ƒ d d d ƒ D]" } | | d j o | } Pq# q# W| S(   s|   A helper function to determine the highest order of glue
        used by the members of this list.  Used by vpack and hpack.i    i   iÿÿÿÿg        (   RC  Rî   (   RE   t   totalsR  R  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   _determine_order,  s     	c         C   s¢   |  i  | ƒ } | |  _ | |  _ | | d j o | | | |  _ n d |  _ d |  _ | d j o8 t |  i ƒ o$ t d | |  i i	 |  f t
 ƒ qž n d  S(   Ng        i    s	   %s %s: %r(   R|  Ry  Rx  Rw  t
   glue_ratioRî   Rv  R   R]  R[   Rú   (   RE   RÒ   t   signR{  t
   error_typeR  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt	   _set_glue6  s    				c         C   sa   x |  i  D] } | i ƒ  q
 Wt i |  ƒ |  i t j  o" |  i t 9_ |  i t 9_ n d  S(   N(   Rv  R_  Rc  R[  Rd  Ru  Re  Rw  (   RE   t   child(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR_  D  s    
 c         C   sM   x |  i  D] } | i ƒ  q
 Wt i |  ƒ |  i t 9_ |  i t 9_ d  S(   N(   Rv  R`  Rc  Ru  Rf  Rw  (   RE   R  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR`  L  s    
 (	   R[   R\   Rn   RF   Rµ   R|  R€  R_  R`  (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRt    s   				
		t   Hlistc           B   s8   e  Z d  Z d d e d „ Z d „  Z d d d „ Z RS(   s'   A horizontal list of boxes.
    node135g        t
   additionalc         C   s3   t  i |  | ƒ | o |  i ƒ  n |  i ƒ  d  S(   N(   Rt  RF   Rr  t   hpack(   RE   Rz  RJ   R	  t   do_kern(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   V  s    c         C   sÃ   g  } t  |  i ƒ } | o£ x“ t | ƒ D]… } |  i | } | | d j  o |  i | d } n d } | i | ƒ | i | ƒ } | d j o t | ƒ } | i | ƒ q) q) W| |  _ n d S(   sÜ   Insert Kern nodes between Chars to set kerning.  The
        Chars themselves determine the amount of kerning they need
        (in get_kerning), and this function just creates the linked
        list in the correct way.i   g        N(   Rî   Rv  RC  RC   R†   RÖ   t   Kern(   RE   t   new_childrent   num_childrenR  t   elemR^  t   kerning_distanceRr  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRr  \  s     c         C   s2  d } d } d } d g d } d g d } xR|  i  D]G} t | t ƒ o5 | | i 7} t | | i ƒ } t | | i ƒ } q6 t | t ƒ ou | | i 7} t | i ƒ oS t | i ƒ oB t	 | d d ƒ }	 t | | i |	 ƒ } t | | i |	 ƒ } q}q6 t | t
 ƒ oF | i }
 | |
 i 7} | |
 i c |
 i 7<| |
 i c |
 i 7<q6 t | t ƒ o | | i 7} q6 q6 W| |  _ | |  _ | d j o | | 7} n | |  _ | | } | d j o# d |  _ d |  _ d |  _ d Sn | d j o |  i | d | d ƒ n |  i | d	 | d
 ƒ d S(   sß  The main duty of hpack is to compute the dimensions of the
        resulting boxes, and to adjust the glue if one of those dimensions is
        pre-specified. The computed sizes normally enclose all of the material
        inside the new box; but some items may stick out if negative glue is
        used, if the box is overfull, or if a box includes other boxes that
        have been shifted left.

        w: specifies a width
        m: is either 'exactly' or 'additional'.

        Thus, hpack(w, exactly) produces a box whose width is exactly w, while
        hpack (w, additional ) yields a box whose width is the natural width
        plus w.  The default values produce a box with the natural width.
        node644, node649g        i   Ru  Rƒ  i    Ni   t   Overfulliÿÿÿÿt	   Underfull(   Rv  R=  Ri  RG   Ra   RH   RI   Rc  R   t   getattrt   Gluet	   glue_spect   stretch_ordert   stretcht   shrink_orderR_  R†  Rx  Ry  R}  R€  (   RE   RJ   R	  RK   RL   RÒ   t   total_stretcht   total_shrinkR  R  R  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR„  r  sL    
 "				
			(   R[   R\   Rn   R#  RF   Rr  R„  (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR‚  S  s   	t   Vlistc           B   s5   e  Z d  Z d d d „ Z d d e e ƒ d „ Z RS(   s%   A vertical list of boxes.
    node137g        Rƒ  c         C   s   t  i |  | ƒ |  i ƒ  d  S(   N(   Rt  RF   t   vpack(   RE   Rz  RK   R	  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   °  s    c         C   s4  d } d } d } d g d } d g d } x,|  i  D]!}	 t |	 t ƒ oZ | | |	 i 7} |	 i } t |	 i ƒ p, t |	 d d ƒ }
 t | |	 i |
 ƒ } qWq6 t |	 t	 ƒ oV | | 7} d } |	 i
 } | | i 7} | | i c | i 7<| | i c | i 7<q6 t |	 t ƒ o | | |	 i 7} d } q6 t |	 t ƒ o t d ƒ ‚ q6 q6 W| |  _ | | j o | | | 7} | |  _ n
 | |  _ | d j o | | 7} n | |  _ | | } | d j o# d |  _ d |  _ d |  _ d Sn | d j o |  i | d | d	 ƒ n |  i | d
 | d ƒ d S(   s  The main duty of vpack is to compute the dimensions of the
        resulting boxes, and to adjust the glue if one of those dimensions is
        pre-specified.

        h: specifies a height
        m: is either 'exactly' or 'additional'.
        l: a maximum height

        Thus, vpack(h, exactly) produces a box whose width is exactly w, while
        vpack(w, additional) yields a box whose width is the natural width
        plus w.  The default values produce a box with the natural width.
        node644, node668g        i   Ru  s2   Internal mathtext error: Char node found in Vlist.Rƒ  i    Ni   R‹  iÿÿÿÿRŒ  (   Rv  R=  Rc  RH   RI   R   RG   R  Ra   RŽ  R  R  R‘  R’  R_  R†  Ri  R÷   Rx  Ry  R}  R€  (   RE   RK   R	  R  RJ   RL   RÒ   R“  R”  R  R  R  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR–  ´  sT    
 	
	
			
			(   R[   R\   Rn   RF   t   floatR   R–  (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR•  ­  s   t   Rulec           B   s    e  Z d  Z d „  Z d „  Z RS(   s£  A Rule node stands for a solid black rectangle; it has width,
    depth, and height fields just as in an Hlist. However, if any of these
    dimensions is inf, the actual value will be determined by running the
    rule up to the boundary of the innermost enclosing box. This is called
    a "running dimension." The width is never running in an Hlist; the
    height and depth are never running in a Vlist.
    node138c         C   s&   t  i |  | | | ƒ | i |  _ d  S(   N(   Rc  RF   Rj  (   RE   RG   RH   RI   Rn  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   ü  s    c         C   s%   |  i  i | | | | | | ƒ d  S(   N(   Rj  Rh   (   RE   RÒ   Ra  RJ   RK   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRb     s    (   R[   R\   Rn   RF   Rb  (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR˜  ô  s   	t   Hrulec           B   s   e  Z d  Z d „  Z RS(   s.   Convenience class to create a horizontal rule.c         C   sL   | i  i | i | i | i ƒ } | d } } t i |  t | | | ƒ d  S(   Ng      à?(   Rj  R¦   Rq   R~   Rš   R˜  RF   R   (   RE   Rn  t	   thicknessRH   RI   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF     s    	(   R[   R\   Rn   RF   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR™    s   t   Vrulec           B   s   e  Z d  Z d „  Z RS(   s,   Convenience class to create a vertical rule.c         C   s>   | i  i | i | i | i ƒ } t i |  | t t | ƒ d  S(   N(   Rj  R¦   Rq   R~   Rš   R˜  RF   R   (   RE   Rn  Rš  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF     s    	(   R[   R\   Rn   RF   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR›    s   RŽ  c           B   s,   e  Z d  Z e d „ Z d „  Z d „  Z RS(   s  Most of the information in this object is stored in the underlying
    GlueSpec class, which is shared between multiple glue objects.  (This
    is a memory optimization which probably doesn't matter anymore, but it's
    easier to stick to what TeX does.)
    node149, node152c         C   s€   t  i |  ƒ d |  _ t | ƒ o t i | ƒ } n' t | t ƒ o
 | } n t d ƒ ‚ | o | i ƒ  } n | |  _	 d  S(   Nt   normals/   glue_type must be a glue spec name or instance.(
   RZ  RF   t   glue_subtypeR)   t   GlueSpect   factoryR=  t   ArgumentErrort   copyR  (   RE   t	   glue_typeR¡  R  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF     s    	
c         C   s`   t  i |  ƒ |  i t j  o? |  i i d j o( |  i i ƒ  |  _ |  i i t 9_ q\ n d  S(   Ng        (   RZ  R_  R[  Rd  R  RG   R¡  Re  (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR_  %  s
    c         C   sL   t  i |  ƒ |  i i d j o( |  i i ƒ  |  _ |  i i t 9_ n d  S(   Ng        (   RZ  R`  R  RG   R¡  Rf  (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR`  ,  s    (   R[   R\   Rn   Rû   RF   R_  R`  (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRŽ    s   	Rž  c           B   sD   e  Z d  Z d d d d d d „ Z d „  Z d „  Z e e ƒ Z RS(   s   node150, node151g        i    c         C   s1   | |  _  | |  _ | |  _ | |  _ | |  _ d  S(   N(   RG   R‘  R  R_  R’  (   RE   RG   R‘  R  R_  R’  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   4  s
    				c         C   s%   t  |  i |  i |  i |  i |  i ƒ S(   N(   Rž  RG   R‘  R  R_  R’  (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR¡  ;  s    c         C   s   |  i  | S(   N(   t   _types(   t   clsR¢  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRŸ  C  s    (   R[   R\   Rn   RF   R¡  RŸ  t   classmethod(    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRž  2  s
   		i   i    t   fili   t   filli   t   filllt   neg_filt   neg_fillt	   neg_filllt   emptyg      ð¿t   sst   Filc           B   s   e  Z d  „  Z RS(   c         C   s   t  i |  d ƒ d  S(   NR¦  (   RŽ  RF   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   U  s    (   R[   R\   RF   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR®  T  s   t   Fillc           B   s   e  Z d  „  Z RS(   c         C   s   t  i |  d ƒ d  S(   NR§  (   RŽ  RF   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   Y  s    (   R[   R\   RF   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR¯  X  s   t   Filllc           B   s   e  Z d  „  Z RS(   c         C   s   t  i |  d ƒ d  S(   NR¨  (   RŽ  RF   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   ]  s    (   R[   R\   RF   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR°  \  s   t   NegFilc           B   s   e  Z d  „  Z RS(   c         C   s   t  i |  d ƒ d  S(   NR©  (   RŽ  RF   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   a  s    (   R[   R\   RF   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR±  `  s   t   NegFillc           B   s   e  Z d  „  Z RS(   c         C   s   t  i |  d ƒ d  S(   NRª  (   RŽ  RF   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   e  s    (   R[   R\   RF   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR²  d  s   t   NegFilllc           B   s   e  Z d  „  Z RS(   c         C   s   t  i |  d ƒ d  S(   NR«  (   RŽ  RF   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   i  s    (   R[   R\   RF   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR³  h  s   t   SsGluec           B   s   e  Z d  „  Z RS(   c         C   s   t  i |  d ƒ d  S(   NR­  (   RŽ  RF   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   m  s    (   R[   R\   RF   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR´  l  s   t	   HCenteredc           B   s   e  Z d  Z d „  Z RS(   s`   A convenience class to create an Hlist whose contents are centered
    within its enclosing box.c         C   s.   t  i |  t ƒ  g | t ƒ  g d t ƒd  S(   NR…  (   R‚  RF   R´  Rû   (   RE   Rz  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   s  s    #(   R[   R\   Rn   RF   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRµ  p  s   t	   VCenteredc           B   s   e  Z d  Z d „  Z RS(   s`   A convenience class to create an Vlist whose contents are centered
    within its enclosing box.c         C   s(   t  i |  t ƒ  g | t ƒ  g ƒ d  S(   N(   R•  RF   R´  (   RE   Rz  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   z  s    (   R[   R\   Rn   RF   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR¶  w  s   R†  c           B   s2   e  Z d  Z d „  Z d „  Z d „  Z d „  Z RS(   s™  A Kern node has a width field to specify a (normally negative)
    amount of spacing. This spacing correction appears in horizontal lists
    between letters like A and V when the font designer said that it looks
    better to move them closer together or further apart. A kern node can
    also appear in a vertical list, when its 'width' denotes additional
    spacing in the vertical direction.
    node155c         C   s   t  i |  ƒ | |  _ d  S(   N(   RZ  RF   RG   (   RE   RG   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   …  s    c         C   s   d |  i  S(   Ns   k%.02f(   RG   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRµ   ‰  s    c         C   s4   t  i |  ƒ |  i t j  o |  i t 9_ n d  S(   N(   RZ  R_  R[  Rd  RG   Re  (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR_  Œ  s    c         C   s    t  i |  ƒ |  i t 9_ d  S(   N(   RZ  R`  RG   Rf  (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR`  ‘  s    (   R[   R\   Rn   RF   Rµ   R_  R`  (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR†  }  s
   			t   SubSuperClusterc           B   s   e  Z d  Z d „  Z RS(   sf  This class is a sort of hack to get around that fact that this
    code doesn't parse to an mlist and then an hlist, but goes directly
    to hlists.  This lets us store enough information in the hlist itself,
    namely the nucleas, sub- and super-script, such that if another script
    follows that needs to be attached, it can be reconfigured on the fly.c         C   s/   d  |  _ d  |  _ d  |  _ t i |  g  ƒ d  S(   N(   RC   t   nucleust   subt   superR‚  RF   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   ›  s    			(   R[   R\   Rn   RF   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR·  •  s   t   AutoHeightCharc           B   s   e  Z d  Z e d „ Z RS(   s2  A class that will create a character as close to the given height
    and depth as possible.  When using a font with multiple height versions
    of some characters (such as the BaKoMa fonts), the correct glyph will
    be selected, otherwise this will always just return a scaled version
    of the glyph.c         C   sØ   | i  i | i | ƒ } | i ƒ  } | | } xH | D]@ \ } }	 | | _ t |	 | ƒ }
 |
 i |
 i | j o Pq5 q5 W| |
 i |
 i } | i | 9_ t |	 | ƒ }
 | |
 i } t i	 |  |
 g ƒ | |  _
 d  S(   N(   Rj  R¨   Rq   R¡  Ri  RH   RI   R~   R‚  RF   Ru  (   RE   R  RH   RI   Rn  t   alwaysR  t   target_totalR§   Rž   t   chart   factort   shift(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   §  s     	
 		(   R[   R\   Rn   Rû   RF   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR»  ¡  s   t   AutoWidthCharc           B   s   e  Z d  Z e e d „ Z RS(   s&  A class that will create a character as close to the given width
    as possible.  When using a font with multiple width versions
    of some characters (such as the BaKoMa fonts), the correct glyph will
    be selected, otherwise this will always just return a scaled version
    of the glyph.c         C   s¶   | i  i | i | ƒ } | i ƒ  } xA | D]9 \ } } | | _ | | | ƒ }	 |	 i | j o Pq+ q+ W| |	 i }
 | i |
 9_ | | | ƒ }	 t i |  |	 g ƒ |	 i |  _ d  S(   N(   Rj  R¨   Rq   R¡  RG   R~   R‚  RF   (   RE   R  RG   Rn  R¼  t
   char_classR  R§   Rž   R¾  R¿  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   Á  s    	 		(   R[   R\   Rn   Rû   Ri  RF   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRÁ  »  s   t   Shipc           B   s>   e  Z d  Z d „  Z d „  Z e e ƒ Z d „  Z d „  Z RS(   sž  Once the boxes have been set up, this sends them to output.
    Since boxes can be inside of boxes inside of boxes, the main
    work of Ship is done by two mutually recursive routines, hlist_out
    and vlist_out , which traverse the Hlists and Vlists inside of
    horizontal and vertical boxes.  The global variables used in TeX to
    store state as it processes have become member variables here.
    node592.c         C   sN   d |  _  d |  _ d |  _ d |  _ | |  _ | | i |  _ |  i | ƒ d  S(   Ni    g        (   t   max_pusht   cur_st   cur_vt   cur_ht   off_hRH   t   off_vt	   hlist_out(   RE   RO   RP   RX   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   __call__Û  s    					c         C   s.   |  d j  o d Sn |  d j o d Sn |  S(   Ng    eÍÍÁg    eÍÍA(    (   t   value(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   clampä  s
    c         C   sL  d } d } | i  } | i } |  i } |  i } |  i d 7_ t |  i |  i ƒ |  _ |  i } xÖ| i D]Ë}	 t	 |	 t
 ƒ o: |	 i |  i |  i |  i |  i ƒ |  i |	 i 7_ qj t	 |	 t ƒ o |  i |	 i 7_ qj t	 |	 t ƒ o t |	 i ƒ d j o |  i |	 i 7_ q5|  i }
 | |	 i |  _ t	 |	 t ƒ o |  i |	 ƒ n |  i |	 ƒ |
 |	 i |  _ | |  _ qj t	 |	 t ƒ oÀ |	 i } |	 i } |	 i } t | ƒ o | i } n t | ƒ o | i } n | d j oQ | d j oD t | |  _ |	 i |  i |  i |  i |  i | | ƒ t |  _ n |  i | 7_ qj t	 |	 t ƒ oÕ |	 i } | i | } | d j o• | d j oD | i | j o0 | | i 7} t | t  | i! ƒ | ƒ ƒ } qq| i" | j o0 | | i# 7} t | t  | i! ƒ | ƒ ƒ } qn | | 7} |  i | 7_ qj qj W|  i d 8_ d  S(   Ni    g        i   ($   Ry  Rx  RÆ  RÇ  RÅ  Ra   RÄ  RÍ  Rv  R=  Ri  Rb  RÈ  RÉ  RG   R†  Rt  Rî   Ru  R‚  RÊ  t	   vlist_outRc  RH   RI   R   t   baselineRŽ  R  R  R‘  t   roundR—  Rw  R’  R_  (   RE   RX   t   cur_gt   cur_glueRy  Rx  t	   base_linet	   left_edgeRÍ  R  t   edget   rule_heightt
   rule_deptht
   rule_widthR  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRÊ  ì  sn    					
 $				
	''
c         C   s3  d } d } | i  } | i } |  i d 7_ t |  i |  i ƒ |  _ |  i } |  i | i 8_ |  i } |  i } x«| i	 D] }	 t
 |	 t ƒ o |  i |	 i 7_ q| t
 |	 t ƒ oµ t |	 i	 ƒ d j o |  i |	 i |	 i 7_ q|  i |	 i 7_ | |	 i |  _ |  i }
 | i |	 _ t
 |	 t ƒ o |  i |	 ƒ n |  i |	 ƒ |
 |	 i |  _ | |  _ q| t
 |	 t ƒ oš |	 i } |	 i } |	 i } t | ƒ o | i } n | | 7} | d j oJ | d j o= |  i | 7_ |	 i |  i |  i |  i |  i | | ƒ qq| t
 |	 t ƒ oÕ |	 i } | i | } | d j o• | d j oD | i | j o0 | | i 7} t | t | i ƒ | ƒ ƒ } qÛqß| i  | j o0 | | i! 7} t | t | i ƒ | ƒ ƒ } qßn | | 7} |  i | 7_ q| t
 |	 t" ƒ o t# d ƒ ‚ q| q| W|  i d 8_ d  S(   Ni    g        i   s1   Internal mathtext error: Char node found in vlist($   Ry  Rx  RÅ  Ra   RÄ  RÇ  RÆ  RH   RÍ  Rv  R=  R†  RG   Rt  Rî   RI   Ru  R‚  RÊ  RÎ  Rc  R   Rb  RÈ  RÉ  RŽ  R  R  R‘  RÐ  R—  Rw  R’  R_  Ri  R÷   (   RE   RX   RÑ  RÒ  Ry  Rx  RÔ  t   top_edgeRÍ  R  t   save_vRÖ  R×  RØ  R  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRÎ  +  sl    					
 				
	''
(   R[   R\   Rn   RË  RÍ  t   staticmethodRÊ  RÎ  (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRÃ  Ó  s   				?c            s)   ‡  f d †  } t  ƒ  } | i | ƒ | S(   Nc            s   t  ˆ  d |  ƒ ‚ d  S(   Ns   
(   R   (   R  t   loct   toks(   t   msg(    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   raise_errork  s    (   R#   t   setParseAction(   RÞ  Rß  R¬  (    (   RÞ  s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   Errorj  s    	t   Parserc           B   só  e  Z e d  i ƒ  ƒ Z e d i ƒ  ƒ Z e d i ƒ  ƒ Z e e Be BZ e d i ƒ  ƒ Z e d i ƒ  ƒ Z	 e d i ƒ  ƒ Z
 e d i ƒ  ƒ Z e d i ƒ  ƒ Z e d i ƒ  ƒ Z e d	 i ƒ  ƒ Z e d
 i ƒ  ƒ Z e d i ƒ  ƒ Z d „  Z d „  Z d „  Z d e f d „  ƒ  YZ d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z h  d d <d d <d d <d d <d  d! <d" d# <d d$ <Z d% „  Z d& „  Z d' „  Z  h  dV dX d- f d. <Z" d/ „  Z# h  d0 d1 <d2 d3 <d4 d5 <d6 d7 <d8 d9 <d: d; <d< d= <d> d? <d@ dA <d: dB <d6 dC <d8 dD <d< dE <d> dF <d0 dG <Z$ e dH i ƒ  ƒ Z% dI „  Z& dJ „  Z' dK „  Z( dL „  Z) dM „  Z* dN „  Z+ dO „  Z, dP „  Z- dQ „  Z. dR „  Z/ dS „  Z0 dT „  Z1 dU „  Z2 RS(Y   s—  
      + *
      \pm             \sqcap                   \rhd
      \mp             \sqcup                   \unlhd
      \times          \vee                     \unrhd
      \div            \wedge                   \oplus
      \ast            \setminus                \ominus
      \star           \wr                      \otimes
      \circ           \diamond                 \oslash
      \bullet         \bigtriangleup           \odot
      \cdot           \bigtriangledown         \bigcirc
      \cap            \triangleleft            \dagger
      \cup            \triangleright           \ddagger
      \uplus          \lhd                     \amalgsS  
      = < > :
      \leq            \geq             \equiv           \models
      \prec           \succ            \sim             \perp
      \preceq         \succeq          \simeq           \mid
      \ll             \gg              \asymp           \parallel
      \subset         \supset          \approx          \bowtie
      \subseteq       \supseteq        \cong            \Join
      \sqsubset       \sqsupset        \neq             \smile
      \sqsubseteq     \sqsupseteq      \doteq           \frown
      \in             \ni              \propto
      \vdash          \dashvs³  
      \leftarrow              \longleftarrow           \uparrow
      \Leftarrow              \Longleftarrow           \Uparrow
      \rightarrow             \longrightarrow          \downarrow
      \Rightarrow             \Longrightarrow          \Downarrow
      \leftrightarrow         \longleftrightarrow      \updownarrow
      \Leftrightarrow         \Longleftrightarrow      \Updownarrow
      \mapsto                 \longmapsto              \nearrow
      \hookleftarrow          \hookrightarrow          \searrow
      \leftharpoonup          \rightharpoonup          \swarrow
      \leftharpoondown        \rightharpoondown        \nwarrow
      \rightleftharpoons      \leadstos   , ; . ! \ldotp \cdotps}   
       \sum \prod \coprod \bigcap \bigcup \bigsqcup \bigvee
       \bigwedge \bigodot \bigotimes \bigoplus \biguplus
       s   lim liminf limsup sup max mins
   \int \oints.   rm cal it tt sf bf default bb frak circled scrs¢   
      arccos csc ker min arcsin deg lg Pr arctan det lim sec arg dim
      liminf sin cos exp limsup sinh cosh gcd ln sup cot hom log tan
      coth inf max tanhsb   
      | \| / \backslash \uparrow \downarrow \updownarrow \Uparrow
      \Downarrow \Updownarrow .s   ( [ { \lfloor \langle \lceils   ) ] } \rfloor \rangle \rceilc   "   
   C   sØ  t  ƒ  i |  i ƒ i d ƒ } t  ƒ  } t  ƒ  i |  i ƒ i d ƒ } t  ƒ  i d ƒ } t  ƒ  i d ƒ } t  ƒ  i |  i ƒ } t  ƒ  i |  i ƒ i d ƒ |  _ t d ƒ } t	 d ƒ i
 ƒ  } t	 d ƒ i
 ƒ  }	 t | ƒ | }
 |
 i |  i ƒ |	 i ƒ  } | i |  i ƒ t	 d	 ƒ } t |  i i ƒ  t |  i ƒ ƒ } t t |  i ƒ ƒ } t t |  i ƒ ƒ } t g  } |  i D] } | d
 | qt~ ƒ } t | ƒ t	 d ƒ t	 d ƒ Bt	 d ƒ Bt	 d ƒ Bt	 d ƒ Bt	 d ƒ Bt	 d ƒ Bi |  i ƒ i d ƒ } t	 d ƒ | | |	 t d ƒ Bi |  i ƒ i d ƒ } d } t d | ƒ t | t t i ƒ  ƒ ƒ Bi |  i ƒ i ƒ  } t | ƒ t |  i i ƒ  ƒ i |  i  ƒ } t! t | ƒ | | ƒ i |  i" ƒ i d ƒ } t | ƒ | i |  i# ƒ i d ƒ } t! |
 t$ | | Bƒ | ƒ i |  i% ƒ i d ƒ } | t | ƒ | >| t | ƒ | >t! t | t	 d ƒ ƒ | | t d ƒ Bƒ i |  i& ƒ i d ƒ } t! t | t	 d ƒ ƒ t t t	 d ƒ ƒ t! t' | | B| Aƒ ƒ t t	 d ƒ ƒ d  d  ƒ| t d! ƒ Bƒ i |  i) ƒ i d ƒ } | | | A| | BA| A| A| A>t d" ƒ B| | | B| B| B>t	 d# ƒ t	 d$ ƒ B} | t! t | ƒ t' | | ƒ | Bƒ >t t |  i* ƒ ƒ } t t |  i+ ƒ ƒ } t t |  i, ƒ ƒ } | t t	 d% ƒ ƒ | | Bt d& ƒ Bt! | t' | ƒ Aƒ t t	 d' ƒ ƒ | | Bt d& ƒ B>t' | | Aƒ i |  i- ƒ i d
 ƒ } | t	 d( ƒ }  t d) ƒ i |  i. ƒ i d* ƒ i ƒ  }! |  i |! t$ t |  ƒ | t |  ƒ t d+ ƒ B|! ƒ t/ ƒ  >|  i i0 ƒ  |  i1 ƒ  d  S(,   NRq   t   subsupert	   placeablet   simplet   finishs   -?[0-9]+\.?[0-9]*Rÿ   R  s   \t   maths   \ s   \/s   \,s   \;s   \quads   \qquads   \!t   spaces   \hspaces   Expected \hspace{n}t   customspaceu   Â€-ðŸ¿¿u4   ([a-zA-Z0-9 +\-*/<>=:,.;!'@()|%s])|(\\[%%${}\[\]_|])t   accentt   functiont   groupt   fracs   Expected \frac{num}{den}t   sqrtR  R  R¶   s   Expected \sqrt{value}s   Expected symbol or groupt   _t   ^s   \lefts   Expected a delimiters   \rightt   $s   (?:(?:\\[$])|[^$])*t   non_maths   Expected end of math '$'(2   R   Rà  Rq   t   setNamet   subsuperscriptt   auto_sized_delimiterRæ  t   _expressionR   R	   t   suppressR   t   start_groupR¡  t	   end_groupR   t   _accent_mapt   keyst   listt   _wide_accentst   _function_namest
   _fontnamesR   Rè  Rá  Ré  R   R3   R?   t   leaveWhitespaceR   t   _char_over_charst   char_over_charsR   Rê  Rë  R   Rì  Rí  R   RC   Rî  t
   _ambiDelimt
   _leftDelimt   _rightDelimRç  Rò  R   t   enablePackratt   clear("   RE   Rq   t	   latexfontRã  Rä  Rå  t	   autoDelimR—  t   lbracet   rbraceRø  Rù  t   bslashRê  Rë  R§   R±   RÒ   t   latex2efontRè  Ré  t   unicode_rangeR?   t   c_over_cRì  Rí  Rî  t
   subsuperopt	   ambiDelimt	   leftDelimt
   rightDelimRç  t
   math_delimRò  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   ¹  s¶    	!".	I			k			Y
)	c         C   s   d  |  _ d  |  _ h  |  _ d  S(   N(   RC   t   _exprt   _state_stackt   _em_width_cache(   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR  i  s    		c         C   s   |  i  | d d | | ƒ g |  _ y |  i i | ƒ WnN t j
 oB } t d i d | i d | i d d t	 | ƒ g ƒ ƒ ‚ n X|  i
 S(   NR¶   Rã   s   
t    Ro  i   Rð  (   t   StateR  Rö  t   parseStringR    R>   RÝ   t   linet   columnR¹   R  (   RE   R  RD   R~   Rš   t   err(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   parsen  s    !	R  c           B   s;   e  Z d  „  Z d „  Z d „  Z d „  Z e e e ƒ Z RS(   c         C   s1   | |  _  | |  _ | |  _ | |  _ | |  _ d  S(   N(   Rj  t   _fontR   R~   Rš   (   RE   Rj  Rq   R   R~   Rš   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF     s
    				c         C   s(   t  i |  i |  i |  i |  i |  i ƒ S(   N(   Râ  R  Rj  Rq   R   R~   Rš   (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR¡  †  s    c         C   s   |  i  S(   N(   R  (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRÀ   Ž  s    c         C   s'   | d j o | |  _  n | |  _ d  S(   NRÑ   Rã   Rè   (   s   its   rms   bf(   R   R  (   RE   R&  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt	   _set_font  s    (   R[   R\   RF   R¡  RÀ   R   t   propertyRq   (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR  ~  s
   				c         C   s   |  i  d S(   Niÿÿÿÿ(   R  (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt	   get_state–  s    c         C   s   |  i  i ƒ  d  S(   N(   R  t   pop(   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt	   pop_state™  s    c         C   s    |  i  i |  i ƒ  i ƒ  ƒ d  S(   N(   R  R†   R"  R¡  (   RE   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt
   push_stateœ  s    c         C   s   t  | ƒ |  _ |  i g S(   N(   R‚  R  (   RE   R  RÜ  RÝ  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRæ  Ÿ  s    c         C   s   t  | ƒ } |  i ƒ  | g S(   N(   R‚  R$  (   RE   R  RÜ  RÝ  t   hlist(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRç  ¤  s    
c         C   sr   | d i  d d ƒ } g  } | D] } | t | |  i ƒ  ƒ q! ~ } t | ƒ } |  i ƒ  d |  i ƒ  _ | g S(   Ni    s   \$Rñ  RÑ   (   t   replaceRi  R"  R‚  R%  Rq   (   RE   R  RÜ  RÝ  R±   R  t   symbolsR&  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRò  ª  s    0
c         C   s’   |  i  ƒ  } | i | i | i f } |  i i | ƒ } | d  j oA | i i | i d d | i | i ƒ } | i	 } | |  i | <n t
 | | ƒ S(   NRÑ   R	  (   R"  Rq   R~   Rš   R  R¼   RC   Rj  RŸ   RÄ   R†  (   RE   t
   percentageRn  RÌ   RG   Rc   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   _make_space´  s    		g333333Ó?s   \ gš™™™™™Ù?s   \,gš™™™™™é?s   \;gš™™™™™ù?s   \quadgš™™™™™	@s   \qquadgš™™™™™Ù¿s   \!s   \/c         C   sA   t  | ƒ d j p t ‚ |  i | d } |  i | ƒ } | g S(   Ni   i    (   Rî   Rl  t   _space_widthsR*  (   RE   R  RÜ  RÝ  R‡   RX   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRè  Ç  s    c         C   s   |  i  t | d ƒ ƒ g S(   Ni   (   R*  R—  (   RE   R  RÜ  RÝ  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRé  Í  s    c         C   sÈ   | d } y t  | |  i ƒ  ƒ } Wn# t j
 o t d | ƒ ‚ n X| |  i j o2 t |  i d ƒ | |  i d ƒ g d t ƒg Sn7 | |  i j o& t | |  i d ƒ g d t ƒg Sn | g S(   Ni    s   Unknown symbol: %sgš™™™™™É?R…  (	   Ri  R"  R>   R   t   _spaced_symbolsR‚  R*  Rû   t   _punctuation_symbols(   RE   R  RÜ  RÝ  R  R¾  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR?   Ð  s    
Rã   t   Ag      ð?s   \circg      à?g        t   AAc         C   s  | d } |  i  ƒ  } | i i | i | i | i ƒ } |  i i | d ƒ \ } } }	 | d  j o t	 d ƒ ‚ n | i
 ƒ  }
 | d d  j	 o | d |
 _ n |
 i | d 9_ t | d |
 ƒ } | i
 ƒ  } | d d  j	 o | d | _ n | i | d 9_ t | d | ƒ } t | i | i ƒ } t | g ƒ } | i | d ƒ t | g ƒ } | i | d ƒ t | t d | |	 ƒ | g ƒ S(   Ni    g        s   Error parsing symboli   i   t   exactly(   NNg        (   R"  Rj  R¦   Rq   R~   Rš   R  R¼   RC   R   R¡  Rs  Ri  Ra   RG   Rµ  R„  R•  Rg  (   RE   R  RÜ  RÝ  Rž   Rn  Rš  t
   under_desct	   over_descRè  t
   over_statet   overt   under_statet   underRG   t   over_centeredt   under_centered(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR  ê  s4    
	s   \circumflexaccentt   hats   \combiningbrevet   breves   \combiningoverlinet   bars   \combininggraveaccentt   graves   \combiningacuteaccentt   acutes   \combiningdiaeresist   ddots   \combiningtildet   tildes   \combiningdotabovet   dots   \combiningrightarrowabovet   vect   "t   `t   't   ~t   .Rð  s   widehat widetildec   	      C   s  t  | ƒ d j p t ‚ |  i ƒ  } | i i | i | i | i ƒ } t  | d ƒ d j o t d ƒ ‚ n | d \ } } | |  i	 j o# t
 d | | i | d t ƒ} n t |  i | | ƒ } t | g ƒ } | i | i d ƒ t | t d | d	 ƒ t | g ƒ g ƒ S(
   Ni   i    i   s   Error parsing accents   \RÂ  R0  g        g       @(   Rî   Rl  R"  Rj  R¦   Rq   R~   Rš   R   Rý  RÁ  RG   Rs  Rú  Rµ  R„  R•  Rg  R‚  (	   RE   R  RÜ  RÝ  Rn  Rš  Rê  Rž   t   centered(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRê  #	  s"    	 c         C   sn   |  i  ƒ  |  i ƒ  } d | _ t g  } | d D] } | t | | ƒ q1 ~ ƒ } |  i ƒ  | d | _ | S(   NRã   i    (   R%  R"  Rq   R‚  Ri  R$  t   function_name(   RE   R  RÜ  RÝ  Rn  R±   R  R&  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRë  8	  s    
	4
c         C   s6   |  i  ƒ  t | ƒ o | d d |  i ƒ  _ n g  S(   Ni    i   (   R%  Rî   R"  Rq   (   RE   R  RÜ  RÝ  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRø  B	  s    
c         C   s   t  | d ƒ } | g S(   Ni    (   R‚  (   RE   R  RÜ  RÝ  t   grp(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRì  I	  s    c         C   s   |  i  ƒ  g  S(   N(   R$  (   RE   R  RÜ  RÝ  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRù  M	  s    
c         C   s7   t  | ƒ d j p t ‚ | d } | |  i ƒ  _ g  S(   Ni   i    (   Rî   Rl  R"  Rq   (   RE   R  RÜ  RÝ  R&  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRq   Q	  s    
c         C   s\   t  | t ƒ o | i |  i j Sn5 t  | t ƒ o$ t | d ƒ o | i |  i j Sn t S(   NRH  (	   R=  Ri  R  t   _overunder_symbolsR‚  t   hasattrRH  t   _overunder_functionsRû   (   RE   R¸  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt   is_overunderW	  s
     c         C   s(   t  | t ƒ o | i |  i j Sn t S(   N(   R=  Ri  R  t   _dropsub_symbolsRû   (   RE   R¸  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyt
   is_dropsub^	  s    c         C   s"   t  | t ƒ o | i ƒ  Sn t S(   N(   R=  Ri  Rq  Rû   (   RE   R¸  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRq  c	  s    c         C   s  t  | ƒ d j p t ‚ d  } d  } d  } t  | d ƒ d j o | d i ƒ  SnCt  | d ƒ d j o= | d \ } } t d ƒ } | d j o
 | } q—| } nï t  | d ƒ d j o4 | d \ } } } | d j o
 | } q—| } n¤ t  | d ƒ d j o€ | d \ } }	 }
 } } |	 | j o- |	 d j o t d ƒ ‚ q^t d	 ƒ ‚ n |	 d j o |
 } | } q—|
 } | } n t d
 ƒ ‚ |  i ƒ  } | i i | i	 | i
 | i ƒ } | i i | i	 | i
 | i ƒ } |  i | ƒ o‡g  } d } | i } | d  j	 o  | i ƒ  t | | i ƒ } n | d  j	 o  | i ƒ  t | | i ƒ } n | d  j	 o@ t | g ƒ } | i | d ƒ | i | t | d ƒ g ƒ n t | g ƒ } | i | d ƒ | i | ƒ | d  j	 oX t | g ƒ } | i | d ƒ | i t | d ƒ | g ƒ | i | i | d } n t | ƒ } | | i d | _ t | g ƒ } | g Sn | i t | } |  i | ƒ o | i t | } n t | } | d  j o_ | i ƒ  t | g ƒ } t | t ƒ } | i t | d ƒ d } t | | ƒ } | | _ nM| i ƒ  t | t t | ƒ g ƒ } t  | } t | | ƒ } | i t | ƒ d } t | | ƒ } | d  j o | | _ nÍ | i ƒ  t | g ƒ } t | t | ƒ } d | | | i | i | } | d j o | | 7} | | 7} n |  i! | ƒ o t" | | | _ n t | t | | i | i | ƒ | g ƒ } | | _ t | | g ƒ } | g S(   Ni   i    i   g        Rï  i   i   s   Double subscripts   Double superscriptsO   Subscript/superscript sequence is too long. Use braces { } to remove ambiguity.R0  g       @g      à?g      @g      @(#   Rî   Rl  RC   t   asListRh  R   R"  Rj  R¦   Rq   R~   Rš   R¥   RM  RG   R_  Ra   Rµ  R„  t   extendR†  R†   RH   RI   R•  Ru  R‚  t   SUBDROPRO  t   SUB1t   abst   SCRIPT_SPACEt   SUP1Rq  t   DELTA(   RE   R  RÜ  RÝ  R¸  R¹  Rº  t   opR^  t   op1t   next1t   op2t   next2Rn  t   rule_thicknessRÓ   t   vlistRÀ  RG   R&  RÏ   t   shift_upt
   shift_downRÒ   t   clrRa  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRô  h	  sÀ    





				

!





	c         C   s•  t  | ƒ d j p t ‚ t  | d ƒ d j p t ‚ |  i ƒ  } | i i | i | i | i ƒ } | d \ } } | i ƒ  | i ƒ  t	 | g ƒ } t	 | g ƒ }	 t
 | i | i ƒ | d }
 | i |
 d ƒ |	 i |
 d ƒ t | t d | d ƒ t | ƒ t d | d ƒ |	 g ƒ } | i i | i d d	 | i | i ƒ } |	 i | i | i d | d
 } | | _ t | t | d ƒ g ƒ } | g S(   Ni   i    i   g      $@R0  g       @g      @RÑ   t   =g      @(   Rî   Rl  R"  Rj  R¦   Rq   R~   Rš   R_  Rµ  Ra   RG   R„  R•  Rg  R™  RŸ   RH   Re   Rg   Ru  R‚  Rh  (   RE   R  RÜ  RÝ  Rn  Rš  R‡   t   dent   cnumt   cdenRG   R^  Rc   RÀ  R&  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRí  á	  s4    	

			c         C   sº  | d \ } } |  i  ƒ  } | i i | i | i | i ƒ } | d  j o t d d d ƒ } nG t | t	 ƒ p t
 d ƒ ‚ n t | i ƒ  ƒ } | i ƒ  | i ƒ  | i | i | d } | i | i }	 t d | |	 | d t ƒ}
 |
 i |
 i } |
 i |
 i }	 t t | d ƒ | t | d ƒ g ƒ } t t | ƒ t ƒ  | g ƒ } | i | d |	 d	 ƒ t t | g ƒ g ƒ } | d
 | _ t | t |
 i d ƒ |
 | g ƒ } | g S(   Ni    g        sK   Can not parse root of radical. Only simple symbols are allowed in the root.g      @s	   \__sqrt__R¼  g       @g      ð?R0  g333333ã?g      à?(   R"  Rj  R¦   Rq   R~   Rš   RC   Rc  R=  R   R   R‚  RP  R_  RH   Ru  RI   R»  R#  Rh  R•  R™  R¯  R–  R†  RG   (   RE   R  RÜ  RÝ  t   roott   bodyRn  Rš  RH   RI   t   checkt   padded_bodyt	   rightsidet
   root_vlistR&  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRî  
  s>    	

c      
   C   sò   | \ } } } |  i  ƒ  } t g  } | D] }	 | |	 i q) ~ ƒ }
 t g  } | D] }	 | |	 i qS ~ ƒ } g  } | d j o  | i t | |
 | | ƒ ƒ n | i | i ƒ  ƒ | d j o  | i t | |
 | | ƒ ƒ n t | ƒ } | S(   NRF  (	   R"  Ra   RH   RI   R†   R»  RQ  RP  R‚  (   RE   R  RÜ  RÝ  t   frontt   middlet   backRn  R±   RÒ   RH   t   _[2]RI   t   partsR&  (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRõ  3
  s    **  (   s   rmR.  g      ð?N(   Ns   \circg      à?(3   R[   R\   R   R  t   _binary_operatorst   _relation_symbolst   _arrow_symbolsR,  R-  RJ  RL  RN  Rÿ  Rþ  R  R  R  RF   R  R  t   objectR  R"  R$  R%  Ræ  Rç  Rò  R*  R+  Rè  Ré  R?   RC   R  R  Rú  Rý  Rê  Rë  Rø  Rì  Rù  Rq   RM  RO  Rq  Rô  Rí  Rî  Rõ  (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRâ  r  s”   	°								
										%																
								y	"	0t   MathTextParserc           B   s’   e  Z d  Z d Z h  e d <e d <e d <e d <e	 d <e
 d <Z h  e d <e d <e d	 <e d
 <Z d „  Z d d d „ Z RS(   s¢   
    Parse the math expression s, return the (bbox, fonts) tuple needed
    to render it.

    fontsize must be in points

    return is width, height, fonts
    t   Bitmapt   Aggt   PSt   Pdft   SVGt   Cairot   cmt   stixt   stixsanst   customc         C   s   | |  _  h  |  _ d  S(   N(   t   _outputt   _cache(   RE   t   output(    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRF   c
  s    	iH   c         C   sŽ  | d  j o t ƒ  } n | | t | ƒ f } |  i i | ƒ } | d  j	 o | Sn |  i d j o t d o t | ƒ } n\ |  i |  i ƒ  } t d } |  i	 i | ƒ }	 |	 d  j	 o |	 | | ƒ } n t
 d ƒ ‚ | i ƒ  }
 |  i d  j o t ƒ  |  i _ n |  i i | | |
 | ƒ } | i | i | i | i ƒ | i | ƒ } | |  i | <|  i i ƒ  | i ƒ  d  | i _ d  | _ | S(   NRx  s	   ps.useafms   mathtext.fontsetsE   mathtext.fontset must be either 'cm', 'stix', 'stixsans', or 'custom'(   RC   R0   t   hashR  R¼   R€  R7   RE  t   _backend_mappingt   _font_type_mappingR>   t   get_size_in_pointst   _parserRâ  R]  R  RM   RG   RH   RI   RY   R  R“   Rm   RD   (   RE   R  Rš   R  t   cacheKeyRÏ   Rj  t   backendt   fontsett   fontset_classR~   RX   (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyR  g
  s6    
	
	N(   R[   R\   Rn   RC   R‡  Rx   Rv   Ry   R‚   R‰   R   R„  Rß   R,  RD  R  R…  RF   R  (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pyRu  H
  s    									(‡   Rn   t
   __future__R    RÛ   t   syst	   cStringIOR   Rç  R   R   t   setsR   R$  t   warningsR   t   numpyR   R   t
   matplotlibR   t   matplotlib.pyparsingR	   R
   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R    R!   R"   R#   t   matplotlib.afmR$   t   matplotlib.cbookR%   R&   R'   R(   R)   t   matplotlib.ft2fontR*   R+   R,   R-   R.   t   matplotlib.font_managerR/   R0   t   matplotlib._mathtext_dataR1   R2   R3   R4   R5   R6   R7   RA   Rt  RB   R]   Ro   Rv   Rw   Rx   Ry   R‚   R‰   R   R   R©   Rß   R  R,  RD  RE  Re  Rf  Rd  RU  RR  RV  RS  RW  t   WarningRú   RZ  Rc  Rg  Rh  Ri  Rs  Rt  R‚  R•  R˜  R™  R›  RŽ  Rž  R£  R®  R¯  R°  R±  R²  R³  R´  Rµ  R¶  R†  R·  R»  RÁ  RÃ  Ri   Rá  Râ  Ru  (    (    (    s<   /Users/cmoad/workspace/matplotlib/lib/matplotlib/mathtext.pys   <module>ˆ   s¬   ¬(((		/		%`yue^§
I:ZG  ’		ÿ ÿ Ø