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


Message #110 received at 77841 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: Ihor Radchenko <yantar92 <at> posteo.net>, 77841 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz <at> gnu.org>, Billy Lei <LeiYiXia29 <at> outlook.com>
Subject: Re: bug#77841: Some svg image's black color is replaced by emacs's
 theme foreground color
Date: Fri, 23 May 2025 21:23:45 +0100
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...
-- 
Alan Third




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.