svgasymptotedvisvgm

Labels not rotated in Asymptote


I have Asymptote built from source under Alpine Linux with the following packages installed: ncurses-dev libtirpc-dev freeglut-dev glm-dev fftw-dev eigen-dev gsl-dev curl-dev zlib-dev texlive-dev ghostscript-dev gettext-dev texmf-dist-latexextra freetype-dev woff2-dev imagemagick. Additionally, dvisvgm is built from the source.

I used Asymptote to reproduce an example from their site: https://asymptote.sourceforge.io/gallery/2Dgraphs/diatom.asy and then to export it to SVG.

The example worked except that the taxon labels were not rotated by 45° as they were supposed to do.

I suspect that rotating text requires some dependency to be installed either for Asymptote or for dvisvgm. Might a missing package be the cause?


Solution

  • Unfortunately, dvisvgm 3.4.4 contains a bug that affects the collapsing of SVG group elements when enabling the built-in SVG optimizer which might lead to the removal of graphics transformations (like scaling and rotation). This issue will be fixed in the next release. For now, you could use a previous dvisvgm release or manually convert the DVI file created by Asymptote without enabling the SVG optimizer, e.g. like this:

    asy -f svg -keep diatom.asy
    dvisvgm -n diatom_.dvi