rL i^ 4dZddlmZddlZddlmZmZmZddlZddl Z ddl m Z ddl Z ddl Z ddlZddlZddlZddlmZmZej*eZej0ddZed d Zed d ZGd deddZeddddddddZdJdZGddZ GddZ!Gdde Z"d Z#Gd!d"Z$ed#d$Z%Gd%d&Z&d'Z'Gd(d)Z(ed*Z)ed+Z*ee*e$d,Z+ee*e"d-Z,ed.k(rdd/l-m.Z.ddl/Z/e.Z0e0jcd0e0jcd1d2e2d3e0jgZ4e e4jje4jl5Z7e&e)d4Z8e7D]nZ9e:d5e9jvd6e9jxd7e9jzd8e/j|e9j~d9D]\Z@ZAe:d:e@jjd;dd?d@dAdBdCdDEeAD]jZ?e:e?je?je?jeHe?jjreHe?jndFe?jvdDEle9jse:d>d?dGdBdHdIdDEe9jD]7ZKe:eKjeKjeKjxeKjvdDE9q dddyy#1swYyxYw)KaC A 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:: with Dvi(filename, 72) as dvi: # iterate over pages: 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: ... ) namedtupleN) lru_cachepartialwraps)Path)_apicbookDviStatez!pre outer inpage post_post finalePageztext boxes height width descentBoxzx y height widthcVeZdZdZdZedZedZedZedZ y)Texta A glyph in the dvi file. The *x* and *y* attributes directly position the glyph. The *font*, *glyph*, and *width* attributes are kept public for back-compatibility, but users wanting to draw the glyph themselves are encouraged to instead load the font specified by `font_path` at `font_size`, warp it with the effects specified by `font_effects`, and load the glyph specified by `glyph_name_or_index`. cXttd|jjS)N pdftex.map) PsfontsMap find_tex_filefonttexnameselfs X/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/matplotlib/dviread.py_get_pdftexmap_entryzText._get_pdftexmap_entryMs!- 56tyy7H7HIIc|j}|jMtdj|jj d|j j dt|jS)z/The `~pathlib.Path` to the font for this glyph.zINo usable font file found for {} ({}); the font may lack a Type-1 versionascii)rfilename ValueErrorformatpsnamedecoderr)rpsfonts r font_pathzText.font_pathPsp**, ?? "B$fV]]%9%9'%B%+^^%:%:7%CEF FFOO$$rc.|jjS)zThe font size.)rsizers r font_sizezText.font_size[syy~~rc6|jjS)z The "font effects" dict for this glyph. This dict contains the values for this glyph of SlantFont and ExtendFont (if any), read off :file:`pdftex.map`. )reffectsrs r font_effectszText.font_effects`s((*222rc|j}|j"t|j|jS|jS)a Either the glyph name or the native charmap glyph index. If :file:`pdftex.map` specifies an encoding for this glyph's font, that is a mapping of glyph indices to Adobe glyph names; use it to convert dvi indices to glyph names. Callers can then convert glyph names to glyph indices (with FT_Get_Name_Index/get_name_index), and load the glyph using FT_Load_Glyph/load_glyph. If :file:`pdftex.map` specifies no encoding, the indices directly map to the font's "native" charmap; glyphs should directly load using FT_Load_Char/load_char after selecting the native charmap. )rencoding _parse_encglyph)rentrys rglyph_name_or_indexzText.glyph_name_or_indexjsD))+>>-5>>*4::6 ?37:: ?rN) __name__ __module__ __qualname____doc__rpropertyr"r%r(r.rrrrAs] J%%33??rrzx y font glyph widthc|SNr4dvideltas rr:s5rc(|jddSNFsigned _read_argr7s rr:r:#--%-8rc(|jddS)NFr>r@r7s rr:r:rBrc(|jddS)NrDTr>r@r7s rr:r:s#--$-7rc0|r|j|dSdS)NTr>r@r7s rr:r:sCMM%M=Drc.|j|dzdS)Nr=Tr>r@r7s rr:r:sS]]519T]Brc.|j|dzdSr<r@r7s rr:r:sS]]519U]Crc4|j|dz|dk(S)Nr=r>r@r7s rr:r:sS]]519eqj]Jr)rawu1u4s4slenslen1ulen1olen1c"fd}|S)a Decorator for dispatch by opcode. Sets the values in *table* from *min* to *max* to this method, adds a check that the Dvi state matches *state* if not None, reads arguments from the file according to *args*. Parameters ---------- table : dict[int, callable] The dispatch table to be filled in. min, max : int Range of opcodes that calls the registered function; *max* defaults to *min*. state : _dvistate, optional State of the Dvi object in which these opcodes are allowed. args : list[str], default: ['raw'] Sequence of argument specifications: - 'raw': opcode minus minimum - 'u1': read one unsigned byte - 'u4': read four bytes, treat as an unsigned number - 's4': read four bytes, treat as a signed number - 'slen': read (opcode - minimum) bytes, treat as signed - 'slen1': read (opcode - minimum + 1) bytes, treat as signed - 'ulen1': read (opcode - minimum + 1) bytes, treat as unsigned - 'olen1': read (opcode - minimum + 1) bytes, treat as unsigned if under four bytes, signed if four bytes cDcgc] }t| c}tfd}| <|StdzD]} |J| |<|Scc}w)Nc |jk7r td|gDcgc]}|||z c}Scc}w)Nzstate precondition failed)stater)rbytefget_argsmethodminrVs rwrapperz,_dispatch..decorate..wrappersI TZZ5%8 !<==$GX!F!D$s("3!FG G!Fs? r=) _arg_mappingrrange) rZxr\irYargsmaxr[rVtables ` @rdecoratez_dispatch..decorates-12LO2 v H  H ; E#J 3A& #Qx'''"a #3sAr4)rcr[rbrVrards````` r _dispatchres@ OrceZdZdZdgdzZeeeZdZdZdZ dZ dZ d Z d Z d[d Zed d ej dZeddej ddZedej ddZeddej ddZdZedej ddZdZed d!Zed"ej2d#d$Zed%ej &d'Zed(ej &d)Zed*ej &d+Zed,d-ej d.d/Zed0d1ej d2d3Zed4d5ej d2d6Z ed7d8ej d.d9Z!ed:d;ej d2d<Z"ed=d>ej d2d?Z#ed@dAej dBZ$edCdDej ddEZ%edFdGdHIdJZ&edKdLdMIdNZ'dOZ(edPejRdQdRZ*edSej2&dTZ+edUdVZ,edWdXYdZZ-y)\DviaI A reader for a dvi ("device-independent") file, as produced by TeX. The current implementation can only iterate through pages in order, and does not even attempt to verify the postamble. This class can be used as a context manager to close the underlying file upon exit. Pages can be read via iteration. Here is an overly simple way to extract text without trying to detect whitespace:: >>> with matplotlib.dviread.Dvi('input.dvi', 72) as dvi: ... for page in dvi: ... print(''.join(chr(t.glyph) for t in page.text)) Nctjd|t|d|_||_i|_t j|_d|_ y)z Read the data from the file named *filename* and convert TeX's internal units to units of *dpi* per inch. *dpi* only sets the units and does not limit the resolution. Use None to return TeX's internal units. zDvi: %srbN) _logdebugopenfiledpifonts _dvistateprerV _missing_font)rrros r__init__z Dvi.__init__sA 9h'4(  ]] !rc|S)z+Context manager enter method, does nothing.r4rs r __enter__z Dvi.__enter__s rc$|jy)zX Context manager exit method, closes the underlying file if it is open. N)close)retypeevalueetraces r__exit__z Dvi.__exit__s  rc#tK|jr$|j|jr#yyw)a\ Iterate through the pages of the file. Yields ------ Page Details of all the text and box objects on the page. The Page tuple contains lists of Text and Box tuples and the page dimensions, and the Text and Box tuples contain coordinates 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)_read_outputrs r__iter__z Dvi.__iter__s( jjl,,. jjls388cf|jjs|jjyy)z(Close the underlying file if it is open.N)rnclosedrxrs rrxz Dvi.closes"yy IIOO  rc>tjx}}tj x}}tj }|j|jzD]}}t |t r |\}}} } d} n|\}}} } } | j | \} } t||}t||| z }t||| z}t||| z}t||}|j|j}d|_ |js|jstggdddS|j-t|j|j||z ||z ||z S|jdz }||z |z}|jD cgc])\}}}} } t||z |z||z |z|z || | |z+}} }}}} |jD cgc]*\}}} } t ||z |z||z |z|z | |z| |z,}} }}} t||||z |z||z |z|Scc} } }}}wcc} } }}w)zk Output the text and boxes belonging to the most recent page. page = dvi._output() rNtextboxeswidthheightdescentgzGRA) npinfrr isinstancer _height_depth_ofr[rb _baseline_vr ror)rminxminymaxxmaxy maxy_pureeltr_yhwergdrrXrrs rrz Dvi._output sN fftvvgtVVG 99tzz) *C#s# 1a#& 1dAq,,Q/1tQ/H chdg}d|_ |jjdd}|j||||jr|jj |j|j }|dk(r|j|dn(|dk(r|jn|dk(r |dxxdz cc<|j2tt|d gd k(r|dd k\r|j|_|d k(ry|jtjur|jy ()t Read one page from the file. Return True if successful, False if there were no more pages. rNTr=_push_pop_downstackrJrDF)rrnread_dtablers to_exceptionr/appendpoplengetattrvrVrq post_postrx)r down_stackrWnames rr~z Dvi._read:s.S 99>>!$Q'D DLL tT *!!((5577<<%..Dw!!*R.1 2!#  (GD'2671<"2!+#'66 s{zzY000 )rcdtj|jj|d|S)z Read and return a big-endian integer *nbytes* long. Signedness is determined by the *signed* keyword. bigr>)int from_bytesrnr)rnbytesr?s rrAz Dvi._read_argis& ~~diinnV4eF~KKrr)r[rbrVc|j|t|j|jtj ry|xj |j|jj|z c_yr6_put_char_realrrprXr _ExceptionInfor _width_ofrchars r_set_char_immediatezDvi._set_char_immediatepV D! djj(%*>*> ?  $**TVV$..t44r)rR)r[rbrVrac|j|t|j|jtj ry|xj |j|jj|z c_yr6rrs r _set_charz Dvi._set_charwrr)rNrN)rVracR|j|||xj|z c_yr6)_put_rule_realrrabs r _set_rulez Dvi._set_rule~s Aq! ! rc&|j|yr6)rrs r _put_charz Dvi._put_chars D!rc|j|j}t|tjr||_y|j L|jjt|j|j|||j|y|j}|j |jD]\}}}}}tt||j|j |j"|j } |jjt|jt||z|jt||z| || j||j$j'|j |j$D cgc]W\}}} } t)|jt||z|jt||zt| |t| |Yc} } }}ycc} } }}w)Nscaletfmrvf)rprXrr rrs_vfrrrrrr_scaleDviFont_mul2012_tfmrrextendr ) rrrrr_rrXrrnewfrrs rrzDvi._put_char_realszz$&&! dE00 1!%D  XX  II  T$&&$&&$"&.."68 9KKE!%$!4!4 C 1aAXeQXX%>#$66199H   dffx5/A&A&*ffx5/A&A&*At~~a/@"BC C JJ  26$1E1EGG$.1aA #466HQ,>#>#'66HQ,>#>#+Au#5x57I KG HGsAHc(|j||yr6)rrs r _put_rulez Dvi._put_rules Aq!rc|dkDrB|dkDr<|jjt|j|j||yyyNr)rrr rrrs rrzDvi._put_rule_reals; q5QU JJ  c$&&$&&!Q7 85rcyr6r4r_s r_nopzDvi._nops r) rNrNrNrNrNrNrNrNrNrNrNc tj|_dx|_x|_x|_x|_x|_|_g|_ g|_ g|_ yr) rqinpagerVrrrr_rzrrr) rc0c1c2c3c4c5c6c7c8c9ps r_bopzDvi._bopsN%% >????$&?46?DFTV   rr)rVcJtj|_|`|`|`|`|`|`|` yr6) rqouterrVrrrr_rrrrs r_eopzDvi._eops*__ FDFDFDFDFDFDJrc|jj|j|j|j|j |j |jfyr6)rrrrrr_rrrs rrz Dvi._pushs9 466466466466466466JKrc|jj\|_|_|_|_|_|_yr6)rrrrrr_rrrs rrzDvi._pops+9=9I6r)rPc.|xj|z c_yr6)r)rrs r_rightz Dvi._right ! r)rOcT|||_|xj|jz c_yr6)rr)rnew_ws r_right_wz Dvi._right_w!  DF $&&rcT|||_|xj|jz c_yr6)r_r)rnew_xs r_right_xz Dvi._right_xrrc.|xj|z c_yr6)r)rrs rrz Dvi._downrrcT|||_|xj|jz c_yr6)rr)rnew_ys r_down_yz Dvi._down_yrrcT|||_|xj|jz c_yr6)rr)rnew_zs r_down_zz Dvi._down_zrrc||_yr6rX)rks r_fnt_num_immediatezDvi._fnt_num_immediates rc||_yr6r)rnew_fs r_fnt_numz Dvi._fnt_nums r)rQ)r[rbrac |jj|}tjddj |Dcgc] }d|cxkrdkrnn t |nd|z"c}ycc}w)Nz!Dvi._xxx: encountered special: %s rz<%02x>)rnrrkrljoinchr)rdatalenspecialchs r_xxxzDvi._xxxsa))..) / GG&(!#b3SWHrMA( ) *(s%A,)rRrMrMrMrLrLc0|j||||||yr6) _fnt_def_real)rrcsrrls r_fnt_defz Dvi._fnt_defs 1aAq!,rc|jj||z}|| djd} t|} |dk7r,| jdk7r|| jk7rtd| t|} t|| || |j|<y#t$r6} t j j| |j|<Yd} ~ yd} ~ wwxYw#t$rd} YlwxYw)Nrrztfm checksum mismatch: r) rnrr _tfmfileFileNotFoundErrorr rfrom_exceptionrpchecksumr_vffiler) rrr0r1rrr2nfontnamerexcrs rr/zDvi._fnt_def_reals IINN1q5 !aRS6==) 8$C 6clla'A,=6qc:; ; "B aS!C 1 !  "00??DDJJqM  ! B s) B2 C C#,CC C*)C*)rLrMrMrMrLc|jj||dk7rtd||dk7s|dk7r td|dk7r tdtj|_y)NzUnknown dvi format ii;zNonstandard units in dvi filez%Nonstandard magnification in dvi file)rnrrrqrrV)rr`numdenmagrs r_prezDvi._presh q 621#67 7 (?c\1<= = $;DE E__ rc.tj|_yr6)rqrrVrs r_postz Dvi._posts(( rctr6)NotImplementedErrorrs r _post_postzDvi._post_posts!!r)r[rbc$tdd|z)Nzunknown command: byte rL)r)roffsets r _malformedzDvi._malformed!s1#,@AAr)F).r/r0r1r2rrrertrvr|rrxrr~rArqrrrrrrrrrrrrrrrrrrrrrr r+r3r/rrrDrGrKrPr4rrrgrgs fslG 7+I " !& +@Z-^L1#Y%5%56575 3Cy'7'7jI5J5 s)**>?3Cy'7'7jI"J"H(s)**>"?"9s^  s)// ;<s)**+G,Gs)**+L,Ls)**+J,J3Cy'7'7jIJ3Cy'7'7iHI 3Cy'7'7iHI 3Cy'7'7jIJ3Cy'7'7iHI 3Cy'7'7iHI 3Cy'7'7893Cy'7'7jIJ3Cj1*2*3C&MN-O-D*s)--.LM%N%"s)//*)+) s^""3C B!Brrgc8eZdZdZdZdZdZdZdZdZ dZ y ) rau Encapsulation of a font that a DVI file can refer to. This class 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). Parameters ---------- scale : float Factor by which the font is scaled from its natural size. tfm : Tfm TeX font metrics for this font texname : bytes Name of the font as used internally by TeX and friends, as an ASCII bytestring. This is usually very different from any external font names; `PsfontsMap` can be used to find the external name of the font. vf : Vf A TeX "virtual font" file, or None if this font is not virtual. Attributes ---------- texname : bytes size : float Size of the font in Adobe points, converted from the slightly smaller TeX points. widths : list Widths of glyphs in glyph-space units, typically 1/1000ths of the point size. )rr$widthsrrrc`tjt|||_||_||_||_|dz|_ t|jdz}t|Dcgc]$}d|jj|dzdz &c}|_ y#t$rd}YLwxYwcc}w)N)rg]e>r=rr@)rcheck_isinstancebytesrrrrr$rbrrr^getrR)rrrrrncharsrs rrtzDviFont.__init__Ks eW5   34  ^a'F$)=2SYY]]433:2  F 2sB()B+ B('B(ct|t|uxr4|j|jk(xr|j|jk(Sr6)typerr$rothers r__eq__zDviFont.__eq__YsDT d5k)NLLEMM1N6:ii5::6M Orc&|j| Sr6)r]r[s r__ne__zDviFont.__ne__]s;;u%%%rcNdt|jd|jdS)N)rZr/rrs r__repr__zDviFont.__repr__`s&4:&&'r$,,q99rc|jjj|d}|t||jSt j d||jy)zWidth of char in dvi units.Nz No width for char %d in font %s.r)rrrWrrrkrlr)rrrs rrzDviFont._width_ofcsK ##D$/  E4;;/ / 5tT\\Jrcg}|jjdf|jjdffD]r\}}|j|d}|4tj d|||j |jdN|jt||jttjd|j r |dk(rd|d<|S)z&Height and depth of char in dvi units.rdepthNzNo %s for char %d in font %srs ^cmsy\d+$r) rrrfrWrkrlrrrrrematch)rrresultmetricrvalues rrzDviFont._height_depth_ofks"ii..9"iioow79 >!$Q'DzzY---))..*1,k)))+|D>BBJB|{*$%HIIz)TS[(+@k)RSSKK%dD1cz! "nnQ/ #~~a0 "//5 &-- !^^A. "nnQ/ #~~a0 !!*-##NN4#:ts{;NN1%NN1%NN1%NN1%NN1%""1aAq!4##+'(D$NN1%NN1%IINN1%^^A&^^A& !QB' #5dV!<==crc:|jtjk7r tddx|_x|_x|_x|_x|_|_ g|_ g|_ g|_ |j|_d|_|j j#|zS)NzMisplaced packet in vf filer)rVrqrrrrrr_rrrrrrqrXrsrnrx)rpls rrzzVf._init_packets :: (:; ;>????$&?46?DFTV   !!!yy~~"$$rc|js1t|j|j|dd|j|<t j |_y)Nr)rsr rrrrrqrrV)rr{r~s rryzVf._finalize_packets?!!'+YYdjj T(+DKK $__ rc|jtjur td|dk7rtd|t |rt j d|tj|_y)Nz pre command in middle of vf filezUnknown vf format zvf file comment: %s)rVrqrrrrrkrlr)rr`r_rrs rrDzVf._presY ::Y]] *?@ @ 81!56 6 q6 JJ,a 0__ r) r/r0r1r2rtrvr~rzryrD __classcell__)rss@rrnrns'.!8>t %%%rrnc||zdz S)z1Multiply two numbers in 20.12 fixed point format.rTr4)num1num2s rrrs I" rceZdZdZdZdZy)Tfma A TeX Font Metric file. This implementation covers only the bare minimum needed by the Dvi class. Parameters ---------- filename : str or path-like Attributes ---------- checksum : int Used for verifying against the dvi file. design_size : int Design size of the font (unknown units) width, height, depth : dict Dimensions of each character, need to be scaled by the factor specified in the dvi file. These are dicts because indexing may not start from 0. )r8 design_sizerrrfc tjd|t|d5}|jd}t j d|dd\}}}}}} tjd|||||| |jd|z} t j d | dd \|_|_|jd||z d zz} t j d |d |jd|z} t j d |d |jd|z} t j d | d |jd| z}dddi|_i|_ i|_ ttd zD]T\}} d|z}| d|zd z} ||j|< |dz |j|<|dz|j|<Vy#1swYxYw)Nzopening tfm file %srjz!6Hr?z(lh=%d, bc=%d, ec=%d, nw=%d, nh=%d, nd=%drDz!2Ir=!r`) rkrlrmrstructunpackr8rrrrf enumerater^)rrrnheader1lhbcecnwnhndheader2 char_inforRheightsdepthsidxrbyte0byte1s rrtz Tfm.__init__s ((3 (D ! ?TiimG%+]]5'!B-%H "BBB JJA2r2r2 /ii"oG.4mmE72A;.O +DM4+ !RU1W+.I]]Qrd!9dii"o>Fmmat1Ityy2?G]]Qrd!9dii"o>F ?   "5RT?3 3ICae$EaeAg&E%e}DJJt  ' 3DKK %eck2DJJt   3 ? ?s D%GGN)r/r0r1r2rlrtr4rrrrs(HI3rrPsFontz(texname psname effects encoding filenamec0eZdZdZdZedZdZdZy)ra} A psfonts.map formatted file, mapping TeX fonts to PS fonts. Parameters ---------- filename : str or path-like Notes ----- 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. :file:`psfonts.map`, :file:`pdftex.map`, or :file:`dvipdfm.map`. The file :file:`psfonts.map` is used by :program:`dvips`, :file:`pdftex.map` by :program:`pdfTeX`, and :file:`dvipdfm.map` by :program:`dvipdfm`. :file:`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. Examples -------- >>> map = PsfontsMap(find_tex_file('pdftex.map')) >>> entry = map[b'ptmbo8r'] >>> entry.texname b'ptmbo8r' >>> entry.psname b'Times-Bold' >>> entry.encoding '/usr/local/texlive/2008/texmf-dist/fonts/enc/dvips/base/8r.enc' >>> entry.effects {'slant': 0.16700000000000001} >>> entry.filename ) _filename _unparsed_parsedcRtj|}tj||_t |d5}i|_|D]B}|jddd}|j j|gj|D dddi|_ |S#1swYxYw)Nrj r=r) object__new__osfsdecoderrmrsplit setdefaultrr)clsrrrnlinetfmnames rrzPsfontsMap.__new__fs~~c"X. (D ! DTDN D**T1-a0))'26==dC D D    D Ds ABB&c:t|tsJ||jvr3|jj|D]}|j |sn |j |S#t $r-td|jdd|jddwxYw)NzWAn associated PostScript font (required by Matplotlib) could not be found for TeX font rz in zo; this problem can often be solved by installing a suitable PostScript font package in your TeX package manager) rrVrr_parse_and_cache_linerKeyError LookupErrorr r)rrrs rrvzPsfontsMap.__getitem__vs'5))) dnn $**73 --d3  .<<( ( .33:>>'3J2MNnn'("#$ *.  . .s A$$6Bc |r|jdrydx}x}x}x}}dx}x}} tjd|} | D]} | j\} } | r| jdr| dd}/| jdr| dd}F| jdrL| d dxs,t t dt | j}|j d r|}|}d }|| }|| }| s| }i}|rZt|j}|D]<}|d k(rtt ||d < |dk(s&tt ||d<>|(|j drd } n|j dsd }n|d }| r|r|y|s d |vsd|vryt|jd dd kDryt|jdddkDry||}| t|}| t|}t||||||j|<y )a% Parse a line in the font mapping file. The format is (partially) documented at http://mirrors.ctan.org/systems/doc/pdftex/manual/pdftex-a.pdf https://tug.org/texinfohtml/dvips.html#psfonts_002emap Each line can have the following fields: - tfmname (first, only required field), - psname (defaults to tfmname, must come immediately after tfmname if present), - fontflags (integer, must come immediately after psname if present, ignored by us), - special (SlantFont and ExtendFont, only field that is double-quoted), - fontfile, encodingfile (optional, prefixed by <, <<, or <[; << always precedes a font, <[ always precedes an encoding, < can precede either but then an encoding file must have extension .enc; < and << also request different font subsetting behaviors but we ignore that; < can be separated from the filename by whitespace). special, fontfile, and encodingfile can appear in any order. )r%*;#NFs"([^"]*)(?:"|$)|(\S+)s< !E$||~ FH&&u-'|H((/#+ABK|]}|jdyw)/N)r).0rs r z_parse_enc..s 2D4??3  2sNzFailed to parse z as Postscript encoding) rgsubr read_textsearchgrouprallr)path no_commentsarrayrliness rr+r+s &&DJ$8$8'$8$JKK IIo{ 3 9 9! r,sY&# //   "w", DIIj"E F &;<*+:?:f4 5:?D 887 P B C K# */dYBYBx XXvw%w%v -3-3` HH InnbK2;;, 7G 7Gt 0 0 9c6 * )R ' z'  F  # SudC    D T]]DHH %I]<89 ID  E$++eDLL>L M0y00II5 7 0 et||229=@A $ g 5689c3ZTJ!0D$&&$&&$**-0_-H-H-J#djj/"**$00 0zzc3S"iTB::IC#%% CII4HI IIIIIsD)L+ALL