Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
35e61b1
DVI op iteration interface good enough for completely parsing a simpl…
MaddieM4 Mar 11, 2026
ea3fd90
Make a new Dvi-class-alike based on the Op iterator
MaddieM4 Mar 11, 2026
7347f46
DPI isn't actually needed at the VM level
MaddieM4 Mar 11, 2026
bb93c5d
Only reconsider the baseline_v when we have to
MaddieM4 Mar 11, 2026
a1eff1a
Graduate new implementation to be the primary one
MaddieM4 Mar 12, 2026
e2ec9b2
Restructure to allow multiple dispatch tables
MaddieM4 Mar 12, 2026
92a6f15
Use the new tech for Vf as well
MaddieM4 Mar 12, 2026
5d39b88
Remove old impl
MaddieM4 Mar 12, 2026
7295490
Expose t.color on Text objects
MaddieM4 Mar 12, 2026
767a308
Turns out, boxes need color too, so just do it the same way.
MaddieM4 Mar 12, 2026
44204af
Privatize some parts of the interface
MaddieM4 Mar 12, 2026
e0963da
Print colors of boxes in the dviread module script
MaddieM4 Mar 12, 2026
da42385
Add a release note for new DVI parsing features
MaddieM4 Mar 12, 2026
508ed15
More documentation
MaddieM4 Mar 12, 2026
7debb76
Attempt to address CI errors for rst docs
MaddieM4 Mar 12, 2026
ad8e90a
Fix some stubs and privatize op handlers
MaddieM4 Mar 12, 2026
d37d5ef
Fix the last stub error, assuming that wasn't making mypy error out e…
MaddieM4 Mar 12, 2026
5d380a4
Hopefully allow color tests to run across platforms
MaddieM4 Mar 12, 2026
57f4156
Some doc improvements. Still a bit opaque why docs for certain things…
MaddieM4 Mar 12, 2026
8103dbc
More CI fixes
MaddieM4 Mar 13, 2026
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
16 changes: 16 additions & 0 deletions doc/release/next_whats_new/dvi_parsing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
DVI Parsing enhancements
------------------------

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.

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.

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.

>>> import matplotlib.dviread as dr
>>> for op in dr.Ops.read_file("./some/document.dvi"):
... print(op)
...
>>> for page in dr.Dvi("./some/document.dvi", 72):
... for t in page.text:
... print(t.glyph, t.color)
Loading
Loading