Commit 829dcaa
committed
Improve output of dvi debug parsing.
To test, run e.g.
```python
from pylab import *
set_loglevel("debug")
figtext(.5, .5, r"gff\textwon$\frac12$", usetex=True)
show()
```
Grab the path of the dvi file that appears last in the log, then run
```bash
python -mmatplotlib.dviread /path/to/dvi
```
Prior to this patch, the output was
```
=== new page === (w: 1668654, h: 553676, d: 225994)
font: 'cmss10' scale: 0.625
x y glyph chr w (glyphs)
983040 1441792 103 g 327681
1310721 1441792 11 . 382295
font: 'tcss1000' scale: 0.625
x y glyph chr w (glyphs)
1693016 1441792 142 . 618800
font: 'cmr7' scale: 0.4375
x y glyph chr w (glyphs)
2390459 1183756 49 1 261235
2390459 1667786 50 2 261235
x y h w (boxes)
2390459 1291058 26213 261235
```
With this patch, the output is
```
=== NEW PAGE === (w: 1668654, h: 553676, d: 225994)
--- GLYPHS ---
font: cmss10 (scale: 0.625) at /usr/local/texlive/2025/texmf-dist/fonts/type1/public/amsfonts/cm/cmss10.pfb
x y glyph chr w
983040 1441792 103 g 327681
1310721 1441792 11 ff 382295
font: tcss1000 (scale: 0.625) at /usr/local/texlive/2025/texmf-dist/fonts/type1/public/cm-super/sfss1000.pfb
x y glyph chr w
1693016 1441792 142 ₩ 618800
font: cmr7 (scale: 0.4375) at /usr/local/texlive/2025/texmf-dist/fonts/type1/public/amsfonts/cm/cmr7.pfb
x y glyph chr w
2390459 1183756 49 1 261235
2390459 1667786 50 2 261235
--- BOXES ---
x y h w
2390459 1291058 26213 261235
```
Most importantly, glyphs are now resolved to their unicode
representation (essentially by resolving the glyph name, similarly to
the process described in Text.glyph_name_or_index), whereas many complex
glyphs were just output as "." before. Furthermore, full font paths are
printed, and the output is slightly better aligned.
These improvements will be more significant with the future support for
{xe,lua}tex, which can load a much wider variety of glyphs.1 parent 05663f7 commit 829dcaa
1 file changed
+28
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1108 | 1108 | | |
1109 | 1109 | | |
1110 | 1110 | | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
1111 | 1116 | | |
1112 | 1117 | | |
1113 | 1118 | | |
1114 | 1119 | | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
1115 | 1124 | | |
1116 | 1125 | | |
1117 | 1126 | | |
1118 | | - | |
| 1127 | + | |
1119 | 1128 | | |
| 1129 | + | |
1120 | 1130 | | |
1121 | 1131 | | |
1122 | | - | |
1123 | | - | |
1124 | | - | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
1125 | 1139 | | |
1126 | | - | |
1127 | | - | |
1128 | | - | |
1129 | | - | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
1130 | 1147 | | |
1131 | | - | |
| 1148 | + | |
| 1149 | + | |
1132 | 1150 | | |
1133 | | - | |
| 1151 | + | |
0 commit comments