<divid="unreleased-message"> You are reading an old version of the documentation (v1.5.0). For the latest version see <ahref="https://matplotlib.org/stable/api/dviread.html">https://matplotlib.org/stable/api/dviread.html</a></div>
<emclass="property">class </em><codeclass="descclassname">matplotlib.dviread.</code><codeclass="descname">Dvi</code><spanclass="sig-paren">(</span><em>filename</em>, <em>dpi</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.dviread.Dvi" title="Permalink to this definition">¶</a></dt>
<p>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.</p>
<p>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.</p>
<dlclass="method">
<dtid="matplotlib.dviread.Dvi.close">
<codeclass="descname">close</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.dviread.Dvi.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Close the underlying file if it is open.</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dviread.DviFont">
<emclass="property">class </em><codeclass="descclassname">matplotlib.dviread.</code><codeclass="descname">DviFont</code><spanclass="sig-paren">(</span><em>scale</em>, <em>tfm</em>, <em>texname</em>, <em>vf</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.dviread.DviFont" title="Permalink to this definition">¶</a></dt>
<p>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 <em>not</em> used for comparison.</p>
<p>The size is in Adobe points (converted from TeX points).</p>
<dlclass="attribute">
<dtid="matplotlib.dviread.DviFont.texname">
<codeclass="descname">texname</code><aclass="headerlink" href="#matplotlib.dviread.DviFont.texname" title="Permalink to this definition">¶</a></dt>
<dd><p>Name of the font as used internally by TeX and friends. This
is usually very different from any external font names, and
<codeclass="xref py py-class docutils literal"><spanclass="pre">dviread.PsfontsMap</span></code> can be used to find the external
name of the font.</p>
</dd></dl>
<dlclass="attribute">
<dtid="matplotlib.dviread.DviFont.size">
<codeclass="descname">size</code><aclass="headerlink" href="#matplotlib.dviread.DviFont.size" title="Permalink to this definition">¶</a></dt>
<dd><p>Size of the font in Adobe points, converted from the slightly
smaller TeX points.</p>
</dd></dl>
<dlclass="attribute">
<dtid="matplotlib.dviread.DviFont.widths">
<codeclass="descname">widths</code><aclass="headerlink" href="#matplotlib.dviread.DviFont.widths" title="Permalink to this definition">¶</a></dt>
<dd><p>Widths of glyphs in glyph-space units, typically 1/1000ths of
the point size.</p>
</dd></dl>
<dlclass="attribute">
<dt>
<codeclass="descname">size</code></dt>
<dd></dd></dl>
<dlclass="attribute">
<dt>
<codeclass="descname">texname</code></dt>
<dd></dd></dl>
<dlclass="attribute">
<dt>
<codeclass="descname">widths</code></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dviread.Encoding">
<emclass="property">class </em><codeclass="descclassname">matplotlib.dviread.</code><codeclass="descname">Encoding</code><spanclass="sig-paren">(</span><em>filename</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.dviread.Encoding" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">encoding</code><aclass="headerlink" href="#matplotlib.dviread.Encoding.encoding" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dviread.PsfontsMap">
<emclass="property">class </em><codeclass="descclassname">matplotlib.dviread.</code><codeclass="descname">PsfontsMap</code><spanclass="sig-paren">(</span><em>filename</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.dviread.PsfontsMap" title="Permalink to this definition">¶</a></dt>
<p>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.</p>
<p>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.</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dviread.Tfm">
<emclass="property">class </em><codeclass="descclassname">matplotlib.dviread.</code><codeclass="descname">Tfm</code><spanclass="sig-paren">(</span><em>filename</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.dviread.Tfm" title="Permalink to this definition">¶</a></dt>
<p>A TeX Font Metric file. This implementation covers only the bare
minimum needed by the Dvi class.</p>
<dlclass="attribute">
<dtid="matplotlib.dviread.Tfm.checksum">
<codeclass="descname">checksum</code><aclass="headerlink" href="#matplotlib.dviread.Tfm.checksum" title="Permalink to this definition">¶</a></dt>
<dd><p>Used for verifying against the dvi file.</p>
</dd></dl>
<dlclass="attribute">
<dtid="matplotlib.dviread.Tfm.design_size">
<codeclass="descname">design_size</code><aclass="headerlink" href="#matplotlib.dviread.Tfm.design_size" title="Permalink to this definition">¶</a></dt>
<dd><p>Design size of the font (in what units?)</p>
</dd></dl>
<dlclass="attribute">
<dtid="matplotlib.dviread.Tfm.width">
<codeclass="descname">width</code><aclass="headerlink" href="#matplotlib.dviread.Tfm.width" title="Permalink to this definition">¶</a></dt>
<dd><p>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.</p>
</dd></dl>
<dlclass="attribute">
<dtid="matplotlib.dviread.Tfm.height">
<codeclass="descname">height</code><aclass="headerlink" href="#matplotlib.dviread.Tfm.height" title="Permalink to this definition">¶</a></dt>
<dd><p>Height of each character.</p>
</dd></dl>
<dlclass="attribute">
<dtid="matplotlib.dviread.Tfm.depth">
<codeclass="descname">depth</code><aclass="headerlink" href="#matplotlib.dviread.Tfm.depth" title="Permalink to this definition">¶</a></dt>
<dd><p>Depth of each character.</p>
</dd></dl>
<dlclass="attribute">
<dt>
<codeclass="descname">checksum</code></dt>
<dd></dd></dl>
<dlclass="attribute">
<dt>
<codeclass="descname">depth</code></dt>
<dd></dd></dl>
<dlclass="attribute">
<dt>
<codeclass="descname">design_size</code></dt>
<dd></dd></dl>
<dlclass="attribute">
<dt>
<codeclass="descname">height</code></dt>
<dd></dd></dl>
<dlclass="attribute">
<dt>
<codeclass="descname">width</code></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dviread.Vf">
<emclass="property">class </em><codeclass="descclassname">matplotlib.dviread.</code><codeclass="descname">Vf</code><spanclass="sig-paren">(</span><em>filename</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.dviread.Vf" title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">matplotlib.dviread.</code><codeclass="descname">find_tex_file</code><spanclass="sig-paren">(</span><em>filename</em>, <em>format=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.dviread.find_tex_file" title="Permalink to this definition">¶</a></dt>
<dd><p>Call <strongclass="program">kpsewhich</strong> to find a file in the texmf tree. If
<em>format</em> is not None, it is used as the value for the
<dd>The library that <strongclass="program">kpsewhich</strong> is part of.</dd>
</dl>
</div>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.dviread.ord">
<codeclass="descclassname">matplotlib.dviread.</code><codeclass="descname">ord</code><spanclass="sig-paren">(</span><em>x</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.dviread.ord" title="Permalink to this definition">¶</a></dt>