dvisvgm and mupdf (Was: dvisvgm needs rebuild to support ghostscript 10)

Bruno Voisin bvoisin at icloud.com
Fri Dec 2 03:11:00 CET 2022


Martin Gieseking wrote on November 30:

> besides the already mentioned issues with GS 10.0, the upcoming GS 10.1 
> will completely break dvisvgm's PDF functionality because Artifex is 
> finally going to remove the old PostScript-based PDF interpreter from 
> GS. Unfortunately, the new C-based one doesn't allow for overriding PS 
> operators which is required for dvisvgm to interact with the interpreter 
> during the conversion process.
> 
> In order to keep the PDF functionality available, I've added an 
> alternative PDF handler that uses mutool (part of mupdf) as a helper 
> utility. As long as a GS version < 10.1 is present, the current 
> mechanism is used, though. The new additions will be part of dvisvgm 3. 
> It also comes with a newly implemented font writer module replacing the 
> outdated, bundled FontForge library.

Thanks, that's rather important information.

I don't know how things work for the Windows and Unix versions of TL, but for the Mac version, MacTeX includes GS (default, for ps2pdf, pstricks etc.) and libgs (optional, for dvisvgm). So, if I get things right, when the switch to GS 10.1 happens, MacTeX will need to replace libgs with mutool.

Nowadays GS is updated twice a year, with the "spring" release coming at about the same time as TL, too late for testing. So MacTeX provides the release from the autumn before. This means MacTeX 2023 will include GS 10.0 so we'll be fine. But if a separate GS 10.1 package is offered later it will need to have mutool. And MacTeX 2024 will need mutool from the start.

I just tried to compile MuPDF on macOS 13.1, after looking at

https://www.mupdf.com/docs/building.html

having XQuartz installed (ie X11) and OpenGL deprecated but still part of macOS.

The standard

make
sudo make install

work and install mupdf-gl, muraster and mutool. To avoid a warning

Makerules:162: "No pkg-config found, install it for proper integration of libcrypto"

I installed pkg-config just before with

./configure --with-internal-glib
make
sudo make install

mupdf-gl works OK as a PDF viewer. Adding HAVE_GLUT=no and/or HAVE_X11=no at the make stage results in muraster and mutool being installed but not mupdf-gl.

I see there is a public beta of dvisvgm 3.0 at

https://github.com/mgieseki/dvisvgm/releases/tag/3.0

Giving the dependencies I probably won't attempt to compile on the Mac right now, and wait instead for its inclusion in the TL2023 sources next spring, where all the dependencies are taken care of and patches applied, before trying.

In any case, it seems compiling and providing mutool won't be much of a problem.

Bruno Voisin


More information about the tex-live mailing list.