[xep-support] SVG questions/problems
Bob Stayton
bobs at sagehill.net
Thu Aug 2 09:05:51 PDT 2007
I can address item #4. The DocBook documentation says that an svg element should appear inside an imageobject element:
http://docbook.org/tdg/en/html/imageobject.html
Did you see someplace where it said it should be inside an imagedata element?
Regarding validity, the svg element must be in the svg namespace, so it does not violate DocBook's validity. To validate a document with multiple namespaces, you need a multiple namespace validator.
Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs at sagehill.net
----- Original Message -----
From: Mats Sigge
To: xep-support at renderx.com
Sent: Thursday, August 02, 2007 2:05 AM
Subject: [xep-support] SVG questions/problems
Hi! We are using RenderX to render DocBook with embedded SVG into PDF. We have some problems with the SVG rendering:
1.. We believe that the same font is used in the document text as in the SVG images. However, some Unicode symbols will not display in the SVG images, for example the infinity sign. (They display nicely in Firefox in the same SVG.)
2.. Links do not work in SVG. (The same links will work in Firefox if the SVG is embedded in an XHTML document.)
3.. How do we center text vertically? We have tried a number of different approaches but cannot get it to work. (As with the others, it works in Firefox.)
4.. This might be a DocBook stylesheet problem, but according to the definition, SVG should be surrounded by the <imagedata> tag (in turn surrounded by <imageobject>. When we do that, the image will not show. However, if we remove the <imagedata tag> and place the SVG directly below the imageobject tag, the SVG will render (although the XML is not valid).
5.. A minor problem, but ligatures are not used in text inside SVG, but it is used in the same text outside SVG.
Anyone have any hints about what may be wrong? Below is a DocBook document with embedded SVG which reproduces all these problems.
Regards,
/ Mats S
<?xml version="1.0" encoding="iso-8859-1"?>
<article xmlns:svg="http://www.w3.org/2000/svg" xmlns:xl=" http://www.w3.org/1999/xlink"
xmlns="http://docbook.org/ns/docbook"
version="5.0"
xml:lang="en">
<info>
<title>Test</title>
</info>
<section xml:id="section-one">
<title>Section One</title>
<mediaobject>
<imageobject>
<svg:svg width="650" height="720" version="1.1">
<svg:style type="text/css"> text {
font-family:serif; dominant-baseline:middle; text-anchor:middle; }
text.occurs { font-stretch:normal; dominant-baseline:hanging;
text-anchor:end; } rect, line, polygon { stroke:black; } </svg:style>
<svg:rect width="100%" height="100%" style="fill:rgb(235,235,235);"/>
<svg:g transform="translate(320,360)">
<svg:rect width="350" height="30" x="-175" y="-15" style="fill:none;"/>
<svg:text x="0" y="0"> This is centered horizontally but not vertically </svg:text>
<svg:a xl:href="#section-two">
<svg:text x="0" y="50"> This will not render as a link </svg:text>
</svg:a>
<svg:text x="0" y="100"> This is the infinity symbol: ∞ </svg:text>
<svg:text x="0" y="150"> These are not ligatures: fi fl </svg:text>
</svg:g>
</svg:svg>
</imageobject>
</mediaobject>
<para>
<link xl:href="#section-two">This will render as a link</link>
</para>
<para>
This is the infinity symbol: ∞
</para>
<para>
These are ligatures: fi fl
</para>
</section>
<section xml:id="section-two">
<title>Section Two</title>
<mediaobject>
<imageobject>
<imagedata>
<svg:svg width="650" height="720" version="1.1">
<svg:g transform="translate(320,360)">
<svg:text x="0" y="0"> This will not render at all </svg:text>
</svg:g>
</svg:svg>
</imagedata>
</imageobject>
</mediaobject>
</section>
</article>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20070802/b78b19b0/attachment.html>
More information about the Xep-support
mailing list