unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#616: #616 - 23.0.60; Emacs.app does not support SVG file type - Emacs bug report logs
@ 2008-11-25  3:19 Adrian Robert
  0 siblings, 0 replies; only message in thread
From: Adrian Robert @ 2008-11-25  3:19 UTC (permalink / raw)
  To: 616; +Cc: Yavor Doganov


> If I set the Emacs background to black, they look transparent but
> that's of course an illusion.  I tried several approaches to make it
> work, but did not succeed.  I hope that someone else does.
>
> ...
>
> +#elif defined (HAVE_NS)
> +      background.pixel = FRAME_BACKGROUND_PIXEL (f);
> ...

The NS port doesn't use FRAME_BACKGROUND_PIXEL.  One approach would be  
to get FRAME_BACKGROUND_COLOR (an NSColor) and extract its RGB info.   
Did you try this and it didn't work either?

Note that simply leaving in the alpha information should also work, as  
the NS image code (ns_put_pixel()) supports alpha.  Did you try  
#ifdef'ing out all of the code in that function that hacks away SVG's  
alpha information?  I'd say this is the preferred solution.  But if  
that doesn't work, here is some code that would use the frame  
background color (I'd try but don't have librsvg set up on my machine.)

float r, g, b, a;
NSColor *col = FRAME_BACKGROUND_COLOR(f);
if (![[col colorSpaceName] isEqualToString: NSNamedColorSpace])
   col = [col colorUsingColorSpaceName: NSCalibratedRGBColorSpace];
[col getRed: &r green: &g blue: &b alpha: &a];
background.red = r * 256;
background.green = g * 256;
background.blue = b * 256;









^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-11-25  3:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-25  3:19 bug#616: #616 - 23.0.60; Emacs.app does not support SVG file type - Emacs bug report logs Adrian Robert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).