GNU bug report logs -
#73417
30.0.90; SVG text color on dark background
Previous Next
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
When I open the attached SVG files in Emacs with a dark background
theme, I notice that the text color "adapts" to the theme and becomes
white. This works nicely (but see below) when the SVG has a transparent
background (example on the right), but renders unreadable a SVG with
regular white background (example on the left).
[emacs.png (image/png, inline)]
[Message part 3 (text/plain, inline)]
If I embed the SVGs on a simple HTML, the text color is not influenced
by the HTML background color:
[firefox.png (image/png, attachment)]
[Message part 5 (text/plain, inline)]
I would argue that Emacs should the same behavior as web browsers, for 2
reasons:
- While it might seem nice to adapt text color to the surroundings, note
that the right-hand side example is in Emacs is still problematic, since
one can't really see the black square frame around the blue plot.
- It would be hard to argue with any SVG producer that their SVGs are
broken if browsers display them just fine.
For reference, here are the SVGs, which by the way where generated with
Python's matplotlib library as follows:
```
import matplotlib.pyplot as plt
plt.plot([1,2]); plt.savefig("x-white.svg")
plt.plot([1,2]); plt.savefig("x-transparent.svg", transparent=True)
```
[x-white.svg (image/svg+xml, attachment)]
[x-transparent.svg (image/svg+xml, attachment)]
This bug report was last modified 266 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.