Re: [Boost-docs] Enabling SVG support in quickbook.

Subject: Re: [Boost-docs] Enabling SVG support in quickbook.
From: John Maddock (john_at_[hidden])
Date: 2007-12-06 09:43:20

Rene Rivera wrote:
> I'm somewhat disappointed that one needs to mess around with the size.
> Such peeking into the SVG makes it almost impossible to abstract out
> the backend generation.

Indeed, but before folks get too enthusiastic about other back ends, please
note that I have a considerable investment in Docbook embedded in quickbook

> And thinking about this a bit more... Won't
> the size in the SVG be meaningless based on the output media? That
> is, is it pixels or some other device dependent measure?

The outer viewport - the one created by the outer <svg> element defaults to
pixels unless you specify some other unit system, all of the units support
by SVG are also supported by Docbook, with the exception of "ex" whatever
they are, and percentages (meaningless in this context). So the code copies
the viewport values, plus any unit specifier unchanged.

> viewport measurements are unit-less. They are only referential to
> within the SVG itself. Reading the docbook docs there are only a few
> units that would be portable, and pixels are assumed if the unit is
> not given. And it seems that not specifying a content size should work
> <>.

Well I didn't write that code just for the heck of it, as noted by the
comments in the code, if you don't specify the size of the content in the
imagedata tag, then:

* In Firefox you get a tiny window displaying the graphic, with scroll bars
to scroll around. It looks appalling frankly.
* In IE with the adobe plug-in you also get a tiny window, but no scroll
and the image is cropped to fit - so all you see is the top left corner :-(

> So... I'm less than enthusiastic about this patch :-\

Well I wasn't thrilled with it myself, but I can't find any other way!

BTW, while trying to find a fix for this I investigated quite a lot of SVG
web sites, more than one would only display in only one or two select
browsers, and those that were cross-browser all used Adobe's recommended
object-embedding method complete with width and height fully specified:

Sorry, but current browsers won't correctly display SVG in an (X)HTML page
unless the width and height are correctly specified :-(

So as things stand, without the patch, SVG support is quite useless (doesn't
display at all), where as this does at least get things displaying
correctly - at least with all the SVG's I tested with. So even though I'm
quite sure there are cunning ways you can devise to brake this code, I'd
like to see the patch go in unless someone can come up with a better way
that does actually work.

Regards, John.

This archive was generated by hypermail 2.1.7 : 2017-11-11 08:50:40 UTC