GNU bug report logs - #73417
30.0.90; SVG text color on dark background

Previous Next

Package: emacs;

Reported by: Augusto Stoffel <arstoffel <at> gmail.com>

Date: Sun, 22 Sep 2024 07:26:01 UTC

Severity: normal

Found in version 30.0.90

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: 73417 <at> debbugs.gnu.org
Subject: bug#73417: 30.0.90; SVG text color on dark background
Date: Sun, 22 Sep 2024 10:58:13 +0300
> From: Augusto Stoffel <arstoffel <at> gmail.com>
> Date: Sun, 22 Sep 2024 09:25:10 +0200
> 
> 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).

You (or a Lisp program which displays such SVG) are supposed to define
a suitable face for it, to countermand these situations.  When Emacs
displays an SVG image, it takes the face colors into consideration, if
the colors are defined for the face.

> 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.

Emacs doesn't automatically "fix" colors because they are unreadable,
it leaves that to the Lisp programs.  We don't do that for text, and
I'm not sure I understand why we should make SVG an exception.  From
the Emacs POV, SVG is just a display element, similar to character
glyphs, so we use the same general strategy here.




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.