We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 285e987 commit 0cdd0e8Copy full SHA for 0cdd0e8
lib/matplotlib/texmanager.py
@@ -350,9 +350,16 @@ def make_png(self, tex, fontsize, dpi):
350
# see get_rgba for a discussion of the background
351
if not os.path.exists(pngfile):
352
dvifile = self.make_dvi(tex, fontsize)
353
- self._run_checked_subprocess(
354
- ["dvipng", "-bg", "Transparent", "-D", str(dpi),
355
- "-T", "tight", "-o", pngfile, dvifile], tex)
+ cmd = ["dvipng", "-bg", "Transparent", "-D", str(dpi),
+ "-T", "tight", "-o", pngfile, dvifile]
+ # When testing, disable FreeType rendering for reproducibility; but
356
+ # dvipng 1.16 has a bug (fixed in f3ff241) that breaks --freetype0
357
+ # mode, so for it we keep FreeType enabled; the image will be
358
+ # slightly off.
359
+ if (getattr(mpl, "_called_from_pytest", False)
360
+ and mpl._get_executable_info("dvipng").version != "1.16"):
361
+ cmd.insert(1, "--freetype0")
362
+ self._run_checked_subprocess(cmd, tex)
363
return pngfile
364
365
def get_grey(self, tex, fontsize=None, dpi=None):
0 commit comments