Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Support {lua,xe}tex as alternative usetex engine.#29807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
anntzer wants to merge2 commits intomatplotlib:main
base:main
Choose a base branch
Loading
fromanntzer:luadvi
Draft
Show file tree
Hide file tree
Changes fromall commits
Commits
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: 5 additions & 11 deletionslib/matplotlib/backends/backend_pdf.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -940,18 +940,12 @@ def dviFontName(self, dvifont):

tex_font_map = dviread.PsfontsMap(dviread.find_tex_file('pdftex.map'))
psfont = tex_font_map[dvifont.texname]
if psfont.filename is None:
raise ValueError(
"No usable font file found for {} (TeX: {}); "
"the font may lack a Type-1 version"
.format(psfont.psname, dvifont.texname))

pdfname = next(self._internal_font_seq)
_log.debug('Assigning font %s = %s (dvi)', pdfname, dvifont.texname)
self._dviFontInfo[dvifont.texname] = types.SimpleNamespace(
dvifont=dvifont,
pdfname=pdfname,
fontfile=psfont.filename,
fontfile=str(dvifont.path), # raises ValueError ifpsfont.filename is None.
basefont=psfont.psname,
encodingfile=psfont.encoding,
effects=psfont.effects)
Expand DownExpand Up@@ -996,11 +990,11 @@ def _embedTeXFont(self, fontinfo):

# Widths
widthsObject = self.reserveObject('font widths')
tfm = fontinfo.dvifont._tfm
font_metrics = fontinfo.dvifont._metrics
# convert from TeX's 12.20 representation to 1/1000 text space units.
widths = [(1000 *metrics.tex_width) >> 20
if (metrics :=tfm.get_metrics(char)) else 0
for char in range(max(tfm._glyph_metrics, default=-1) + 1)]
widths = [(1000 *glyph_metrics.tex_width) >> 20
if (glyph_metrics :=font_metrics.get_metrics(char)) else 0
for char in range(max(font_metrics._glyph_metrics, default=-1) + 1)]
self.writeObject(widthsObject, widths)

# Font dictionary
Expand Down
10 changes: 7 additions & 3 deletionslib/matplotlib/cbook.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -43,16 +43,20 @@ class _ExceptionInfo:
users and result in incorrect tracebacks.
"""

def __init__(self, cls, *args):
def __init__(self, cls, *args, notes=None):
self._cls = cls
self._args = args
self._notes = notes if notes is not None else []

@classmethod
def from_exception(cls, exc):
return cls(type(exc), *exc.args)
return cls(type(exc), *exc.args, notes=getattr(exc, "__notes__", []))

def to_exception(self):
return self._cls(*self._args)
exc = self._cls(*self._args)
for note in self._notes:
exc.add_note(note)
return exc


def _get_running_interactive_framework():
Expand Down
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp