1

I am looking to render a piece of Latex code via Golang using the StarTex Library. One particular package is used to write the DeVice Independent (DVI) file into a PNG. Unfortunately, a raster image is inadequate for my purposes, so I wished to modify the code to produce an SVG instead. It appears that the only reference to this PNG implementation is at line 951 of the DVI implementation.

m.rdr.DrawGlyph(cur.h, cur.v, *fnt, rune(cmd), m.color.Color())

It appears that the DVI machine only needs to plot a glyph for a rune at the current horizontal and vertical position with a specified font and color. Surely, this one feature could be easily replicated with an SVG format, right? Even if there is no fully fledged SVG library, is there a way to draw a glyph at a specified x and y location? Does anyone have a minimal working example?

Talmsmen
  • 183
  • 1
  • 7
  • 1
    You can look into [dvisvgm](https://dvisvgm.de/) ([GitHub](https://github.com/mgieseki/dvisvgm)), which will convert DVI to SVG (one per page). – ShreevatsaR Jun 30 '23 at 03:00

0 Answers0