bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#616: #616 - 23.0.60; Emacs.app does not support SVG file type - Emac


From: Adrian Robert
Subject: bug#616: #616 - 23.0.60; Emacs.app does not support SVG file type - Emacs bug report logs
Date: Mon, 24 Nov 2008 22:19:30 -0500


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;









reply via email to

[Prev in Thread] Current Thread [Next in Thread]