Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a635671

Browse filesBrowse files
committed
Parse {lua,xe}tex-generated dvi in dviread.
1 parent 40a47e5 commit a635671
Copy full SHA for a635671

14 files changed

+313-212Lines changed: 313 additions & 212 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/matplotlib/backends/backend_pdf.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_pdf.py
+3-4Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,11 +1035,10 @@ def _embedTeXFont(self, dvifont):
10351035
fontdict['Encoding'] = self._generate_encoding(encoding)
10361036
fc = fontdict['FirstChar'] = min(encoding.keys(), default=0)
10371037
lc = fontdict['LastChar'] = max(encoding.keys(), default=255)
1038-
10391038
# Convert glyph widths from TeX 12.20 fixed point to 1/1000 text space units
1040-
tfm = dvifont._tfm
1041-
widths = [(1000 * metrics.tex_width) >> 20
1042-
if (metrics := tfm.get_metrics(char)) else 0
1039+
font_metrics = dvifont._metrics
1040+
widths = [(1000 * glyph_metrics.tex_width) >> 20
1041+
if (glyph_metrics := font_metrics.get_metrics(char)) else 0
10431042
for char in range(fc, lc + 1)]
10441043
fontdict['Widths'] = widthsObject = self.reserveObject('glyph widths')
10451044
self.writeObject(widthsObject, widths)
Collapse file

‎lib/matplotlib/cbook.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/cbook.py
+7-3Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,20 @@ class _ExceptionInfo:
4343
users and result in incorrect tracebacks.
4444
"""
4545

46-
def __init__(self, cls, *args):
46+
def __init__(self, cls, *args, notes=None):
4747
self._cls = cls
4848
self._args = args
49+
self._notes = notes if notes is not None else []
4950

5051
@classmethod
5152
def from_exception(cls, exc):
52-
return cls(type(exc), *exc.args)
53+
return cls(type(exc), *exc.args, notes=getattr(exc, "__notes__", []))
5354

5455
def to_exception(self):
55-
return self._cls(*self._args)
56+
exc = self._cls(*self._args)
57+
for note in self._notes:
58+
exc.add_note(note)
59+
return exc
5660

5761

5862
def _get_running_interactive_framework():

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.