Skip to content

Cleanup dviread docs. #15792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 21 additions & 20 deletions lib/matplotlib/dviread.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,12 +573,6 @@ class Vf(Dvi):
r"""
A virtual font (\*.vf file) containing subroutines for dvi files.

Usage::

vf = Vf(filename)
glyph = vf[code]
glyph.text, glyph.boxes, glyph.width

Parameters
----------
filename : str or path-like
Expand All @@ -589,6 +583,13 @@ class Vf(Dvi):
http://mirrors.ctan.org/info/knuth/virtual-fonts
This class reuses some of the machinery of `Dvi`
but replaces the `_read` loop and dispatch mechanism.

Examples
--------
::
vf = Vf(filename)
glyph = vf[code]
glyph.text, glyph.boxes, glyph.width
"""

def __init__(self, filename):
Expand Down Expand Up @@ -753,20 +754,6 @@ class PsfontsMap:
"""
A psfonts.map formatted file, mapping TeX fonts to PS fonts.

Usage::

>>> 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

Parameters
----------
filename : str or path-like
Expand All @@ -792,6 +779,20 @@ class PsfontsMap:
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
"""
__slots__ = ('_font', '_filename')

Expand Down