[tex-live] dvipdfmx: Support for SVG-in-OpenType

Simon Cozens simon at simon-cozens.org
Thu Nov 24 05:44:28 CET 2016

Hello there!

You may know that I have extracted the PDF generation parts of dvipdfmx
into libtexpdf which is used by the SILE typesetter. So far I have been
trying to avoid messing with the code too much to avoid maintaining a
divergant fork, but now I am starting to add SVG-in-OpenType support to

The way that SVG-in-OpenType works is that for each glyph string you
want to set, you go and look in the fonts' SVG table and see if there is
an entry for each glyph ID. If there is, the entry is an SVG graphic
which you render in place of the glyph. If there isn't, you use the CFF
or TTF outlines in the usual way. Of course the proper place to put this
is within the PDF generation layer; it's a function of rendering string
+ font to produce PDF output, which is what the backend of dvipdfmx
(pdf_dev_set_string and friends) does.

I've started hacking libtexpdf to do this, but it's kind of messy - you
need to add an SVG parser and also code to render SVG into PDF drawing
instructions. But I have something that more or less works.

If I come up with a patch to dvipdfmx to add support for
SVG-in-OpenType, would there be any interest in merging it?

(Ideally, it would be great if at some point dvipdfmx moved to use the
libtexpdf abstraction so we could share all this stuff more easily, but
last time I tried to do that I got caught up with kpse stuff and it
wasn't very easy to test.)


More information about the tex-live mailing list