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 #119 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: Sat, 24 May 2025 21:56:59 +0100
On Sat, May 24, 2025 at 07:57:26PM +0200, Manuel Giraud wrote:
> With this and the same SVG I provided, the foreground color of the text
> is black using a light theme.  Using a dark theme, the foreground color
> of the text is white...  So that seems to do the trick.

Excellent, thanks.

I've pushed a branch scratch/svg-colors with the various fixes. Can
you please check it's working as you'd expect?

Can someone using librsvg < 1.48 please try it too? I'm including a
small script that should insert an SVG with two boxes, one follows the
theme colours the other stays with black and white.

If this all works then I suppose the documentation needs updated...

(insert-image
 (create-image
  "<svg viewbox='0 0 100 200'>
     <rect x='1' y='1' width='98' height='98'
           stroke='currentcolor' stroke-width='3'
           fill-opacity='0'/>
     <rect x='1' y='101' width='98' height='98'
           stroke='black' stroke-width='3'
           fill='white'/>

     <text x='8' y='15' fill='currentcolor' font-size='9px'>
       This text should
     </text>
     <text x='8' y='25' fill='currentcolor' font-size='9px'>
       follow the theme
     </text>
     <text x='8' y='35' fill='currentcolor' font-size='9px'>
       colours.
     </text>

     <text x='8' y='115' font-size='9px'>
       This text should
     </text>
     <text x='8' y='125' font-size='9px'>
       be black text on
     </text>
     <text x='8' y='135' font-size='9px'>
       a white
     </text>
     <text x='8' y='145' font-size='9px'>
       background.
     </text>
   </svg>"
  'svg t))


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