Skip to content
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Hopefully allow color tests to run across platforms
  • Loading branch information
MaddieM4 committed Mar 13, 2026
commit 5d380a48a07c7e85dcf875cee821da3ad2eb4f3c
20 changes: 17 additions & 3 deletions lib/matplotlib/tests/test_dviread.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pathlib import Path
import shutil

from matplotlib import cbook, dviread as dr
from matplotlib import cbook, texmanager, pyplot as plt, dviread as dr
from matplotlib.testing import subprocess_run_for_testing, _has_tex_package
import pytest

Expand Down Expand Up @@ -116,7 +116,18 @@ def test_vm_completeness():

@pytest.mark.parametrize('dpi', [None, 72])
def test_dvi_color(dpi):
filename = str(Path(__file__).parent / 'baseline_images/dviread/color.dvi')
# Apparently, per TexManager tests, we can just play around with rcParams
# willy-nilly in order to get color support in our preamble.
plt.rcParams.update({
'text.usetex': True,
'text.latex.preamble': r'\usepackage{color}\usepackage{dashrule}',
})
filename = texmanager.TexManager().make_dvi(r"""
Default,
$\;$ \textcolor[rgb]{1.0, 0.0, 0.0}{red\hdashrule[0.5ex]{3cm}{1pt}{1pt 0pt}},
and back again.
""", 12)

with dr.Dvi(filename, dpi) as dvi:
parsed = [*dvi]
assert len(parsed) == 1
Expand Down Expand Up @@ -150,8 +161,11 @@ def test_dvi_color(dpi):
('n', None),
('.', None),
]

# Red line is many little boxes
assert [b.color for b in page.boxes] == ["rgb 1.0 0.0 0.0"] * 85
assert len(page.boxes) > 10
for b in page.boxes:
assert b.color == "rgb 1.0 0.0 0.0"


def test_PsfontsMap(monkeypatch):
Expand Down