kotatsuyaki’s site

Why SVG text positions are wrong in Emacs

Published on

It’s because librsvg, the library used by Emacs to rasterize SVG images into bitmaps, does not support the dominant-baseline attribute. They have an open issue tracking this problem at dominant-baseline is ignored.

My use case was to preview SVG diagrams created using pikchr within Emacs using the pikchr-mode library. Maybe I should hack pikchr-mode to use Inkscape to rasterize (or just convert all <text> to paths) images for previewing, but meanwhile Inkscape’s instructions on how to use it from the command line seems like a slight mess. I’ll leave it as a project for another day.