export page background color to plain SVG format

Bug #166213 reported by Kees Cook
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Wishlist
Unassigned

Bug Description

Looks like during the routine that loads
share/inkscape/screens/* files (like the about.svg) the
document background color is ignored.

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

I don't see this. Please provide more details (exactly what
file, how loaded, what's the difference).

Revision history for this message
Kees Cook (kees) wrote :

I didn't think I described this very well. :)

I downloaded brisgeek's new about.svg. When I put it in
place, the about screen shows a white background (rather
than the brownish that was set for the background). The
about.svg currently in CVS has a brown rectangle behind
everything, added by me to work around the problem.

Did that help at all?

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

I see no difference between about.cpp loaded as a normal
file or via help>about. The bg is warm gray with white dirt
in both cases.

Revision history for this message
Bug Importer (bug-importer) wrote :

use this file as the about.svg, and you'll see it. The one
in CVS was modified to work around the problem.

http://andy.fitzsimon.com.au/about41.svg

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

Actually we need to switch from using sodipodi:namedview to
the background property which was added to SVG 1.2. When we
do that it'll fix this one too, because it will be processed
universally by the renderer (now the bg color is a separate
canvas item on the main canvas, but missing in other
canvasses such as the about box, hence this bug).

vonHalenbach (lustik)
Changed in inkscape:
importance: Low → Wishlist
status: New → Confirmed
Revision history for this message
Tom Davidson (tjd-mit) wrote :

Can someone attach another test file that has the background property? andy's link is dead...

Revision history for this message
Peter Williams (k-peter) wrote :

Even though this bug is more than five years old, it's still valid, as far as I can tell.

If you create a file in Inkscape, set its background color to something random (non-transparent blue, say), and export to Plain SVG, the exported file does not have a blue background. If you look at the XML, the background information is nowhere to be found.

In Inkscape's defense, the SVG spec seems to completely fall down on this basic functionality. The SVG 1.2 Tiny specification does define a "viewport-fill" property on the <svg> element that can be used to define a background fill: http://www.w3.org/TR/SVGTiny12/painting.html#viewport-fill-property .

However, it appears that SVG 2 is going to go another route: see the discussions at http://www.w3.org/2012/07/23-svg-minutes.html . The current plan appears to be that CSS styling will be used, and you can write <svg style="background-color: #abcdef">

I'm attaching two sample files gleaned from the specifications that I think should demonstrate the two techniques. Neither gets a colored background in EOG. The viewport-fill method doesn't work in Firefox. However, the CSS background test file does get a colored background when viewed in Firefox.

Given the current situation, exporting via the CSS background-color property seems like it should be better than nothing. Will unexpected properties cause other SVG viewers to freak out?

Revision history for this message
Peter Williams (k-peter) wrote :
summary: - implement SVG 1.2 "background" property
+ export page background color to plain SVG format
Revision history for this message
Peter Williams (k-peter) wrote :

One last comment: for the source of the background-color example and some related discussion, see https://svgwg.org/svg2-draft/single-page.html#color-ColorProperty .

Revision history for this message
Roul P. (perhelion1) wrote :

I mean this is a dupe of Bug #180890

Revision history for this message
grey tomorrow (gtomorrow) wrote :

Closing because INVALID.

Please see https://gitlab.com/inkscape/inbox/-/issues/286

If you feel this issue has been unjustly closed, please feel free to open a new issue at https://inkscape.org/report . Thank you.

Closed by: https://gitlab.com/greytomorrow

tags: added: bug-migration
Changed in inkscape:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.