mrpiggi / svg

Handling SVG pictures in LaTeX documents using Inkscape, ImageMagick and/or Ghostscript
Other
65 stars 12 forks source link

Bug color/colour of text not correct #46

Closed JCLengeling closed 1 year ago

JCLengeling commented 1 year ago

I created a diagram containing text that is either white or black. The SVG seems to also be correct; viewing it in different browsers results in a correct rendering. However, when I use \includesvg all the text is black in the generated pdf.

In the svg, the tags with text have as part of their style either fill:#ffffff or fill:#000000.

Looking into the generated svg-tex.pdf_tex, each text entry has the option \color[rgb]{0,0,0}, no matter if the text should be white or black

JCLengeling commented 1 year ago

It seems to be a problem with inkscape: https://bugs.launchpad.net/inkscape/+bug/885244

mrpiggi commented 1 year ago

Problem confirmed with Inkscape 1.2.2

The reason for this is that the LaTeX export of Inkscape does not respect all elements inside <tspan>, including something like <tspan style="fill:#ff0000">...</tspan>. There is nothing the svg package can do about this, the problem should be reported in the Inkscape bug tracker.

To solve the problem, the fill color of the entire text box (single-click) should be set rather than the text itself (double-click).

Follow-up: