Skip to content

Commit 816cdb1

Browse files
committed
Some doc improvements. Still a bit opaque why docs for certain things aren't showing up in Sphinx.
1 parent 32f0a10 commit 816cdb1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

doc/release/next_whats_new/dvi_parsing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ DVI Parsing enhancements
33

44
Matplotlib is capable of reading ``.dvi`` files with `.dviread.Dvi`, which has historically worked well for its existing use cases, but did not provide the granularity to inspect the raw DVI operations in a file, and didn't have a way to report color information upwards to the various backends that might care about color directives.
55

6-
The new `.dviread.Ops` namespace provides the ability to inspect a DVI file one op at a time, `.dviread.VM` handles state tracking (and can be driven manually with its ``.op_foo(code, **args)`` methods, and the `.dviread.Text` and `.dviread.Box` classes have been modified to store color information in a backwards-compatible way.
6+
The new `.dviread.Ops` namespace provides the ability to inspect a DVI file one op at a time, `.dviread.VM` handles state tracking (and can be driven manually with its ``.op_foo(code, **args)`` methods, and the ``.dviread.Text`` and ``.dviread.Box`` classes have been modified to store color information in a backwards-compatible way.
77

88
While backends don't render color directives yet, this important groundwork lets them *see* color directives, so that they can be acted on in the future.
99

lib/matplotlib/dviread.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ class DispatchTable:
9898
probably be a niche requirement in practice.
9999
"""
100100
entries: list = dataclasses.field(
101+
repr=False,
101102
default_factory=lambda: [('unknown', 0, ['delta'], ['delta'], None)] * 256)
102103

103104
def op(self,
@@ -167,6 +168,7 @@ def op(self,
167168
... 'u4 @length',
168169
... 'length payload')
169170
"""
171+
170172
arg_types = (' ' + arg_types).split()
171173
arg_names = (' ' + arg_names).split()
172174
entry = (opname, bmin, arg_types, arg_names, extra)
@@ -414,6 +416,10 @@ def _extra(f, l: int) -> dict:
414416
# for backwards compatibility, but is a dataclass.
415417
@dataclasses.dataclass(slots=True, frozen=True)
416418
class Box:
419+
"""
420+
A rectangle defined within the dvi file.
421+
"""
422+
417423
x: int
418424
y: int
419425
height: int
@@ -453,6 +459,7 @@ class Text:
453459
interpretation depends on the font). ``text.width`` is the glyph width in
454460
dvi units.
455461
"""
462+
456463
x: int
457464
y: int
458465
font: 'DviFont'
@@ -1109,8 +1116,6 @@ class Vf:
11091116
-----
11101117
The virtual font format is a derivative of dvi:
11111118
http://mirrors.ctan.org/info/knuth/virtual-fonts
1112-
This class reuses some of the machinery of `Dvi`
1113-
but replaces the `!_read` loop and dispatch mechanism.
11141119
11151120
The format is:
11161121
- `pre` op (247)

0 commit comments

Comments
 (0)