HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //proc/self/root/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyc
�
�)�Uc@s�dZddlZddlZddljZddlZddlZddl	Z	ej
ddddddd	d
dd�Zd
efd��YZ
defd��YZde
fd��YZd�Zd�Zdefd��YZdefd��YZdefd��YZed�Zdd�ZiZiZd�Zd�Zd�Zed kr�ddlZejj d!�ej!dZ"ye#ej!d�Z$Wne%k
r�eZ$nXe
e"e$�Z&eed"��Z'x�e&D]�Z(d#GHeZ)x�e(j*D]�\Z+Z,Z-Z.Z/e-e)krGd$Ge-j0Gd%Ge-j1e2d&d'�GHe-Z)ne+Ge,Ge.Gd(e.kojd)knoxe3e.�p~d*Ge/GHq�Wx2e(j4D]'\Z+Z,Z/Z5e+Ge,Gd+Ge/Ge5GHq�Wq�WndS(,sI
An experimental module for reading dvi files output by TeX. Several
limitations make this not (currently) useful as a general-purpose dvi
preprocessor, but it is currently used by the pdf backend for
processing usetex text.

Interface::

  dvi = Dvi(filename, 72)
  # iterate over pages (but only one page is supported for now):
  for page in dvi:
      w, h, d = page.width, page.height, page.descent
      for x,y,font,glyph,width in page.text:
          fontname = font.texname
          pointsize = font.size
          ...
      for x,y,height,width in page.boxes:
          ...

i����Ntpreitouteritinpageit	post_postitfinaleitDvicBs
eZdZd�Zd�Zd�Zd�Zd�Zed�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(s�
    A dvi ("device-independent") file, as produced by TeX.
    The current implementation only reads the first page and does not
    even attempt to verify the postamble.
    cCsKtjjd|d�t|d�|_||_i|_tj|_	dS(s�
        Initialize the object. This takes the filename as input and
        opens the file; actually reading the file happens when
        iterating through the pages of the file.
        sDvi: tdebugtrbN(
t
matplotlibtverbosetreporttopentfiletdpitfontst	_dvistateRtstate(tselftfilenameR
((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyt__init__&s
		ccs2x+tr-|j�}|r)|j�VqPqWdS(s
        Iterate through the pages of the file.

        Returns (text, boxes) pairs, where:
          text is a list of (x, y, fontnum, glyphnum, width) tuples
          boxes is a list of (x, y, height, width) tuples

        The coordinates are transformed into a standard Cartesian
        coordinate system at the dpi value given when initializing.
        The coordinates are floating point numbers, but otherwise
        precision is not lost and coordinate values are not clipped to
        integers.
        N(tTruet_readt_output(Rt	have_page((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyt__iter__2s
	cCs |jjs|jj�ndS(s:
        Close the underlying file if it is open.
        N(Rtclosedtclose(R((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRGscCs3tjtjtjtjf\}}}}tj}x�|j|jD]�}t|�dkrz|\}}}	}
d}n*|\}}}}
}
|j|
�\}	}t||�}t|||	�}t|||
�}t|||�}t||�}qGW|jdkrHt
jd|jd|jd||d||d||�S|jdd}g|jD]>\}}}}
}
||||||||
|
|f^qc}g|jD]<\}}}	}
|||||||	||
|f^q�}t
jd|d|d|||d|||d|||�S(
sk
        Output the text and boxes belonging to the most recent page.
        page = dvi._output()
        iittexttboxestwidththeighttdescentg�z�GR@iiNi(tnptinfRRtlent_height_depth_oftmintmaxR
tNonet	mpl_cbooktBunch(Rtminxtminytmaxxtmaxyt	maxy_puretelttxtythtwtetfonttgtdtfRR((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRNs2,
	KLcCsfx_trat|jjd��}|j|�|dkr>tS|jtjkr|j�t	SqWdS(st
        Read one page from the file. Return True if successful,
        False if there were no more pages.
        ii�N(
RtordRtreadt	_dispatchRRRRtFalse(Rtbyte((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRrs	

cCsw|jj|�}t|d�}|rA|dkrA|d}nx/td|�D]}d|t||�}qQW|S(s~
        Read and return an integer argument *nbytes* long.
        Signedness is determined by the *signed* keyword.
        ii�ii(RR9R8trange(Rtnbytestsignedtstrtvalueti((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyt_arg�s
cCs	d|kodknr,|j|�n�|dkrQ|j|jd��n�|dkrv|j|jd��n�|dkr�|j|jd��ne|d	kr�|j|jd
t��n=|dkr�|j|jd
t�|jd
t��n|dkr|j|jd��n�|d
krD|j|jd��n�|dkri|j|jd��n�|dkr�|j|jd
t��no|dkr�|j|jd
t�|jd
t��n8|dkr�|j�n|dkr"|jgtd�D]}|jd
t�^q�n�|dkr;|j	�n�|dkrT|j
�n�|dkrm|j�n�|dkr�|j|jdt��nk|dkr�|j|jdt��nC|dkr�|j|jdt��n|dkr
|j|jd
t��n�|dkr)|j
dA�n�|dkrQ|j
|jdt��n�|dkry|j
|jdt��n�|dkr�|j
|jdt��n_|dkr�|j
|jd
t��n7|d kr�|jdA�n|d!kr
|j|jdt��n�|d"kr5|j|jdt��n�|d#kr]|j|jdt��n�|d$kr�|j|jd
t��n{|d%kr�|j|jdt��nS|d&kr�|j|jdt��n+|d'kr�|j|jdt��n|d(kr%|j|jd
t��n�|d)krA|jdA�n�|d*kri|j|jdt��n�|d+kr�|j|jdt��no|d,kr�|j|jdt��nG|d-kr�|j|jd
t��n|d.kr�|jdA�n|d/kr%|j|jdt��n�|d0krM|j|jdt��n�|d1kru|j|jdt��n�|d2kr�|j|jd
t��ncd3|ko�d4knr�|j|d3�n3|d5kr�|j|jd��n|d6kr|j|jd��n�|d7kr<|j|jd��n�|d8krd|j|jd
t��n�d9|ko{d:knr�|j|d8�}|jj|�}|j|�nKd;|ko�d<knrV|j|d:|d<k�}gdBD]}|j|�^q�\}}}	}
}|jj|
|�}|j||||	|
||�n�|d=kr�gdCD]}|j|�^qi\}}
}}}|jj|�}|j||
|||�n?|d>kr�|j�n&|d?kr�|j�n
td@|�dAS(Ds�
        Based on the opcode *byte*, read the correct kinds of
        arguments from the dvi file and call the method implementing
        that opcode with those arguments.
        iii�ii�ii�ii�ii�i�i�i�i�i�i�i�ii�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�sunknown command: byte %dN(iiiii(iiiii(t	_set_charRCRt	_set_rulet	_put_chart	_put_rulet_nopt_bopR=t_eopt_pusht_popt_rightt_right_wR&t_right_xt_downt_down_yt_down_zt_fnt_numRR9t_xxxt_fnt_deft_pret_postt
_post_postt
ValueError(RR<RBR"tspecialtkR/tctsR6tatltntnumtdentmag((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyR:�s�++
5


1"1

cCs�|jtjkrtd�n|dkr:td|�n|dksV|dd
krbtd�n|dkrztd	�ntj|_dS(Ns!pre command in middle of dvi fileisUnknown dvi format %di���i;isnonstandard units in dvi filei�s%nonstandard magnification in dvi filei(RRRRYR(RRBRaRbRctcomment((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRV�scCsQ|jtjkrtd�n|j|�|j|j|jj|�7_dS(Nsmisplaced set_char in dvi file(	RRRRYRFR1RR7t	_width_of(Rtchar((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRD�s
cCsA|jtjkrtd�n|j||�|j|7_dS(Nsmisplaced set_rule in dvi file(RRRRYRGR1(RR^tb((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRE�sc
Cs�|jtjkrtd�n|j|j}|jdkrn|jj	|j
|j|||j|�f�n(|j
}x�|j|jD]�\}}}}}tdt||j
�d|jd|jd|j�}	|jj	|j
t||�|jt||�|	||	j|�f�q�W|jjg|j|jD]V\}}}
}|j
t||�|jt||�t|
|�t||�f^q9�dS(Nsmisplaced put_char in dvi filetscalettfmttexnametvf(RRRRYRR7t_vfR&RtappendR1tvRet_scaletDviFontt_mul2012t_tfmRjRtextend(RRfR4RhR/R0R7R5R2tnewfR^Rg((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRF�s	&cCs_|jtjkrtd�n|dkr[|dkr[|jj|j|j||f�ndS(Nsmisplaced put_rule in dvi filei(RRRRYRRmR1Rn(RR^Rg((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRGscCsdS(N((R((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRHscCsz|jtjkr%td|j�ntj|_d\|_|_|_|_|_	|_
g|_g|_g|_
dS(Ns$misplaced bop in dvi file (state %d)i(iiiiii(RRRRYRR1RnR2R/R0tztstackRR(Rtc0tc1tc2tc3tc4tc5tc6tc7tc8tc9tp((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRIs*		cCsX|jtjkrtd�ntj|_|`|`|`|`|`	|`
|`dS(Nsmisplaced eop in dvi file(RRRRYRR1RnR2R/R0RuRv(R((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRJ&scCsV|jtjkrtd�n|jj|j|j|j|j	|j
|jf�dS(Nsmisplaced push in dvi file(RRRRYRvRmR1RnR2R/R0Ru(R((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRK,scCsU|jtjkrtd�n|jj�\|_|_|_|_	|_
|_dS(Nsmisplaced pop in dvi file(RRRRYRvtpopR1RnR2R/R0Ru(R((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRL1scCs1|jtjkrtd�n|j|7_dS(Nsmisplaced right in dvi file(RRRRYR1(RRg((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRM6scCsL|jtjkrtd�n|dk	r6||_n|j|j7_dS(Nsmisplaced w in dvi file(RRRRYR&R2R1(Rtnew_w((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRN;s
cCsL|jtjkrtd�n|dk	r6||_n|j|j7_dS(Nsmisplaced x in dvi file(RRRRYR&R/R1(Rtnew_x((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyROBs
cCs1|jtjkrtd�n|j|7_dS(Nsmisplaced down in dvi file(RRRRYRn(RR^((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRPIscCsL|jtjkrtd�n|dk	r6||_n|j|j7_dS(Nsmisplaced y in dvi file(RRRRYR&R0Rn(Rtnew_y((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRQNs
cCsL|jtjkrtd�n|dk	r6||_n|j|j7_dS(Nsmisplaced z in dvi file(RRRRYR&RuRn(Rtnew_z((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRRUs
cCs+|jtjkrtd�n||_dS(Nsmisplaced fnt_num in dvi file(RRRRYR7(RR[((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRS\scCsitjjddjg|D]>}dt|�ko<dknrG|pTdt|�^q�d�dS(Ns!Dvi._xxx: encountered special: %sti is<%02x>R(RR	R
tjoinR8(RRZtch((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRTas
		Ic
Cs�t||�}|dkrK|jdkrK||jkrKtd|�nt||�}	td|d|d|d|	�|j|<dS(Nistfm checksum mismatch: %sRhRiRjRk(t_tfmfiletchecksumRYt_vffileRpR(
RR[R\R]R6R^R_R`RiRk((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRUis
*cCs.|jtjkrtd�ntj|_dS(Nsmisplaced post in dvi file(RRRRYR(R((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRWvscCs
t�dS(N(tNotImplementedError(R((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRX}s( t__name__t
__module__t__doc__RRRRRR;RCR:RVRDRERFRGRHRIRJRKRLRMRNRORPRQRRRSRTRURWRX(((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRs:				$	
	I								
												
	RpcBsAeZdZdZd�Zd�Zd	�Zd
�Zd�ZRS(
s:
    Object that holds a font's texname and size, supports comparison,
    and knows the widths of glyphs in the same units as the AFM file.
    There are also internal attributes (for use by dviread.py) that
    are *not* used for comparison.

    The size is in Adobe points (converted from TeX points).

    .. attribute:: texname
    
       Name of the font as used internally by TeX and friends. This
       is usually very different from any external font names, and
       :class:`dviread.PsfontsMap` can be used to find the external
       name of the font.

    .. attribute:: size
    
       Size of the font in Adobe points, converted from the slightly
       smaller TeX points.

    .. attribute:: widths
    
       Widths of glyphs in glyph-space units, typically 1/1000ths of
       the point size.
    
    RjtsizetwidthsRoRlRrcCs�||||f\|_|_|_|_|ddd	|_yt|jj��d}Wntk
rud}nXgt	|�D]#}d|jj
|d�d?^q�|_dS(
NgR@g�z�GR@iiiii�ii(RoRrRjRlR�R%RtiterkeysRYR=tgetR�(RRhRiRjRktncharsRf((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyR�s*

cCs4|j|jko3|j|jko3|j|jkS(N(t	__class__RjR�(Rtother((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyt__eq__�scCs|j|�S(N(R�(RR�((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyt__ne__�scCsX|jjj|d�}|dk	r4t||j�Stjjd||j	fd�dS(sM
        Width of char in dvi units. For internal use by dviread.py.
        sNo width for char %d in font %sRiN(
RrRR�R&RqRoRR	R
Rj(RRfR((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRe�s	cCs�g}x�|jjdf|jjdffD]v\}}|j|d�}|dkr�tjjd|||jfd�|j	d�q+|j	t
||j��q+W|S(sX
        Height and depth of char in dvi units. For internal use by dviread.py.
        RtdepthsNo %s for char %d in font %sRiN(RrRR�R�R&RR	R
RjRmRqRo(RRftresulttmetrictnameRA((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyR#�s	(stexnamessizeswidthss_scales_vfs_tfm(	R�R�R�t	__slots__RR�R�ReR#(((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRp�s				tVfcBsMeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(s�
    A virtual font (\*.vf file) containing subroutines for dvi files.

    Usage::

      vf = Vf(filename)
      glyph = vf[code]
      glyph.text, glyph.boxes, glyph.width
    cCsFtj||d�d|_i|_d|_|j�|j�dS(Ni(RRR&t_first_fontt_charst_packet_endsRR(RR((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyR�s			
cCs|j|S(N(R�(Rtcode((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyt__getitem__�scCs�|jtjkr�|jj�d}||jkrA|j�q�||jkr\td�q�|dkst|dkr�td|�ntj	||�dSn|dkr�|j
d�|j
d�}}|j|||�n|dkr)gdD]}|j
|�^q�\}}}|j|||�n�d|ko@d
knrXtj	||�n�|dkr�|j
d�|j
d�}}|jj|�}|j
d	�|j
d	�}	}
|j
|||	|
�n(|dkr�tj|_n
td
|�dS(Nis!Packet length mismatch in vf filei�i�i�s"Inappropriate opcode %d in vf filei�iii�i�i�sunknown vf opcode %d(i�i�(iii(RRRRttellR�t_finalize_packetRYRR:RCt_init_packetR9RVR(RR<tbyte_attccRiR/tplRBR[tcstds((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyR:�s4
+cCs�|jtjkrtd�ntj|_|jj�||_||_||_	d\|_
|_|_|_
|_|_ggg|_|_|_|j|_dS(NsMisplaced packet in vf filei(iiiiii(RRRRYRRR�R�t_packet_chart
_packet_widthR1RnR2R/R0RuRvRRR�R7(RR�R�Ri((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyR�s		*cCsAtjd|jd|jd|j�|j|j<tj|_	dS(NRRR(
R'R(RRR�R�R�RRR(R((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyR�s	(cCsp|jtjkrtd�n|dkr:td|�nt|�r`tjjd|d�ntj|_dS(Ns pre command in middle of vf filei�sUnknown vf format %dsvf file comment: R(	RRRRYR"RR	R
R(RRBR/R�R�((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRVscGs2tj|||�|jdkr.||_ndS(N(RRUR�R&(RR[targs((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRU!s(
R�R�R�RR�R:R�R�RVRU(((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyR��s				"			
cCs<d|kodkns"t�|d@r4|dS|SdS(	s4
    Convert from two's complement to negative.
    iii iNII�I(tAssertionError(Ra((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyt	_fix2comp&s"
cCs||d?S(s;
    Multiply two numbers in 20.12 fixed point format.
    i((tnum1tnum2((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRq0stTfmcBseZdZdZd�ZRS(sN
    A TeX Font Metric file. This implementation covers only the bare
    minimum needed by the Dvi class.

    .. attribute:: checksum

       Used for verifying against the dvi file.

    .. attribute:: design_size

       Design size of the font (in what units?)

    .. attribute::  width

       Width of each character, needs to be scaled by the factor
       specified in the dvi file. This is a dict because indexing may
       not start from 0.

    .. attribute:: height

       Height of each character.
    
    .. attribute:: depth
        
       Depth of each character.
    R�tdesign_sizeRRR�cCs3tjjd|d�t|d�}z�|jd�}tjd|dd!�\}}}}}}	tjjd||||||	fd�|jd	|�}
tjd
|
d �\|_|_|jd	||d�}|jd	|�}|jd	|�}
|jd	|	�}Wd|j	�Xiii|_
|_|_g||
|fD]&}tjd
t
|�d	|�^qQ\}}
}x�tt||d��D]�\}}t|t|d	|��|j
|<t|
t|d	|d�d	?�|j|<t|t|d	|d�d@�|j|<q�WdS(Nsopening tfm file RRis!6Hiis(lh=%d, bc=%d, ec=%d, nw=%d, nh=%d, nd=%dis!2Iiis!%dIi(RR	R
RR9tstructtunpackR�R�RRRR�R"t	enumerateR=R�R8(RRRtheader1tlhtbctectnwtnhtndtheader2t	char_infoR�theightstdepthsR/tidxRf((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRTs,+	"B&%-(schecksumsdesign_sizeswidthsheightsdepth(R�R�R�R�R(((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyR�7st
PsfontsMapcBs8eZdZdZd�Zd�Zd�Zd�ZRS(s�
    A psfonts.map formatted file, mapping TeX fonts to PS fonts.
    Usage::

     >>> map = PsfontsMap(find_tex_file('pdftex.map'))
     >>> entry = map['ptmbo8r']
     >>> entry.texname
     'ptmbo8r'
     >>> entry.psname
     'Times-Bold'
     >>> entry.encoding
     '/usr/local/texlive/2008/texmf-dist/fonts/enc/dvips/base/8r.enc'
     >>> entry.effects
     {'slant': 0.16700000000000001}
     >>> entry.filename

    For historical reasons, TeX knows many Type-1 fonts by different
    names than the outside world. (For one thing, the names have to
    fit in eight characters.) Also, TeX's native fonts are not Type-1
    but Metafont, which is nontrivial to convert to PostScript except
    as a bitmap. While high-quality conversions to Type-1 format exist
    and are shipped with modern TeX distributions, we need to know
    which Type-1 fonts are the counterparts of which native fonts. For
    these reasons a mapping is needed from internal font names to font
    file names.

    A texmf tree typically includes mapping files called e.g.
    psfonts.map, pdftex.map, dvipdfm.map. psfonts.map is used by
    dvips, pdftex.map by pdfTeX, and dvipdfm.map by dvipdfm.
    psfonts.map might avoid embedding the 35 PostScript fonts (i.e.,
    have no filename for them, as in the Times-Bold example above),
    while the pdf-related files perhaps only avoid the "Base 14" pdf
    fonts. But the user may have configured these files differently.
    t_fontcCs;i|_t|d�}z|j|�Wd|j�XdS(Ntrt(R�Rt_parseR(RRR((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyR�s
	cCs�|j|}|j|j}}|dk	rN|jd�rNt|�|_n|dk	r|jd�rt|j�|_n|S(Nt/(R�RtencodingR&t
startswitht
find_tex_file(RRjR�tfntenc((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyR��s
cCs@x9|D]1}|j�}|dks|jd�r:qngd}}x�|t|�kr*||dkr�|d7}|jd|�}|j|||!�|d}nK|jd|d�}|dkr�t|�}n|j|||!�|}x0|t|�kr&||dkr&|d7}q�WqJW|j|�qWdS(	sParse each line into words.R�t%it"it i����N(tstripR�R"tindexRmtfindt	_register(RRtlinetwordstpostend((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyR��s&



%c	Cs�|d \}}d\}}}x�|dD]�}|jd�sH|}q*|jd�}|jd�r�|dksxt�|d}q*|jd�r�|dks�t�|}q*|dks�t�|}q*W|j�}i}y%t||jd�d�|d<Wntk
rnXy%t||jd	�d�|d
<Wntk
rNnXt	j
d|d|d
|d|d|�|j|<dS(s>Register a font described by "words".

        The format is, AFAIK: texname fontname [effects and filenames]
        Effects are PostScript snippets like ".177 SlantFont",
        filenames begin with one or two less-than signs. A filename
        ending in enc is an encoding file, other filenames are font
        files. This can be overridden with a left bracket: <[foobar
        indicates an encoding file named foobar.

        There is some difference between <foo.pfb and <<bar.pfb in
        subsetting, but I have no example of << in my TeX installation.
        iR�t<t[is.enct	SlantFonttslantt
ExtendFontRsRjtpsnameteffectsR�RN(R�NN(R&R�tlstripR�tendswithtsplittfloatR�RYR'R(R�(	RR�RjR�R�R�Rtwordteff((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyR��s6
	
	
%
%
	(s_font(R�R�R�R�RR�R�R�(((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyR�ss"				tEncodingcBs/eZdZdZd�Zd�Zd�ZRS(s�
    Parses a \*.enc file referenced from a psfonts.map style file.
    The format this class understands is a very limited subset of
    PostScript.

    Usage (subject to change)::

      for name in Encoding(filename):
          whatever(name)
    R�cCsit|d�}zHtjjd|d�|j|�|_tjjd|j
d�Wd|j�XdS(NR�sParsing TeX encoding sdebug-annoyingsResult: (RRR	R
R�R�R(RRR((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyR�sccsx|jD]}|Vq
WdS(N(R�(RR�((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyRsc	Cs)g}d}x|D]}|jd�}|dkrA|| }n|j�}|dkr�d|kr�d}||jd�dj�}q�n|dkrd|kr�||jd� }d}n|j�}xP|D]E}|jd�r
|jd�}|j|d�q�td	|�q�WqqW|S(
NiR�i����R�it]iR�sBroken name in encoding file: (R�R�R�R�R�RsRY(	RRR�RR�t
comment_startR�R2tsubwords((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyR�s,

#	
(sencoding(R�R�R�R�RRR�(((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyR��s

			cCs�dg}|dk	r)|d|g7}n||g7}tjjd||fd�tj|dtj�}|j�dj�}tjjd|d�|S(	s�
    Call :program:`kpsewhich` to find a file in the texmf tree. If
    *format* is not None, it is used as the value for the
    :option:`--format` option.

    Apparently most existing TeX distributions on Unix-like systems
    use kpathsea. I hear MikTeX (a popular distribution on Windows)
    doesn't use kpathsea, so what do we do? (TODO)

    .. seealso::

      `Kpathsea documentation <http://www.tug.org/kpathsea/>`_
        The library that :program:`kpsewhich` is part of.
    t	kpsewhichs	--format=sfind_tex_file(%s): %sRtstdoutisfind_tex_file result: %sN(	R&RR	R
t
subprocesstPopentPIPEtcommunicatetrstrip(RtformattcmdtpipeR�((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyR�%s	
cCsSxLtrNy|j|�SWqtk
rJ}|jtjkrDqqK�qXqWdS(N(RR9tOSErrorterrnotEINTR(R�tbufsizeR3((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyt_read_nointrBs	cCsYy||SWntk
rnXt||�}|rE||�}nd}|||<|S(N(tKeyErrorR�R&(Rjtclass_tsuffixtcacheRR�((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyt	_fontfileTs

cCst|tdt�S(Ns.tfm(R�R�t	_tfmcache(Rj((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyR�cscCst|tdt�S(Ns.vf(R�R�t_vfcache(Rj((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyR�fst__main__sdebug-annoyings
pdftex.maps=== new page ===R4tscaledg@ii i�t.tBOX(6R�R�Rtmatplotlib.cbooktcbookR'tnumpyR R�R�R(RtobjectRRpR�R�RqR�R�R�R&R�R�R�RR�R�R�R�tsysR	t	set_leveltargvtfnameR�R
t
IndexErrortdvitfontmaptpagetfPrevRR/R0R7R\R2RjRotpowtchrRR1(((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/dviread.pyt<module>sV*�bOW	
	<y9			



$	A