GNU bug report logs - #77841
Some svg image's black color is replaced by emacs's theme foreground color

Previous Next

Package: emacs;

Reported by: Billy Lei <LeiYiXia29 <at> outlook.com>

Date: Wed, 16 Apr 2025 12:16:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Third <alan <at> idiocy.org>
Cc: yantar92 <at> posteo.net, 77841 <at> debbugs.gnu.org, manuel <at> ledu-giraud.fr, LeiYiXia29 <at> outlook.com
Subject: bug#77841: Some svg image's black color is replaced by emacs's theme foreground color
Date: Sat, 24 May 2025 10:48:30 +0300
> Date: Fri, 23 May 2025 21:23:45 +0100
> From: Alan Third <alan <at> idiocy.org>
> Cc: Ihor Radchenko <yantar92 <at> posteo.net>,
> 	Billy Lei <LeiYiXia29 <at> outlook.com>, Eli Zaretskii <eliz <at> gnu.org>,
> 	77841 <at> debbugs.gnu.org
> 
> On Fri, May 23, 2025 at 03:42:53PM +0200, Manuel Giraud wrote:
> > Alan Third <alan <at> idiocy.org> writes:
> > 
> > > On 23 May 2025 12:19:15 BST, Manuel Giraud <manuel <at> ledu-giraud.fr> wrote:
> > >>Alan Third <alan <at> idiocy.org> writes:
> > >>
> > >>> On Fri, May 23, 2025 at 12:18:26PM +0200, Manuel Giraud wrote:
> > >>>> Hi Alan,
> > >>>> 
> > >>>> Here is what I get:
> > >>>
> > >>> Thank you. That's what I see too. Are you able to send me an example
> > >>> SVG as generated by docview?
> > >>
> > >>Sure.  Here is some book with light theme and a dark theme (pretty
> > >>unreadable ;-)
> > >
> > > Sorry, is it possible to get a copy of the actual SVG file, please? 
> > 
> > Here is an example from my docview cache.
> 
> Clearly an excellent document.
> 
> OK, I'm pretty sure that the first patch that affects image.c is
> working right, which means my mediocre lisp skills are biting me here.
> 
> Can you try running
> 
>     (concat "svg{fill:" (face-foreground 'doc-view-svg-face) "}")
> 
> and see what it returns?
> 
> Although it's only just now occurred to me that I have no idea what
> face-foreground might return, presumably things that aren't CSS
> compatible?
> 
> Hmm...
> 
> Can you try replacing line 1680 in lisp/doc-view.el with
> 
>     :foreground (face-foreground 'doc-view-svg-face)
>     :css "svg{fill:currentcolor;}")))
> 
> I think that's the right number of brackets...

Btw, please test these with librsvg v2.40.x, because 2.50 and newer
versions require Rust to build them.  So I'd like us to support those
older versions as much as reasonably possible.

Thanks.




This bug report was last modified 7 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.