[xep-support] SVG questions/problems

From: Mats Sigge <mats.sigge@gmail.com>
Date: Thu Aug 02 2007 - 02:05:02 PDT

 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: &#x221e; </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: &#x221e;
        </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>

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html
Received on Thu Aug 2 03:02:19 2007

This archive was generated by hypermail 2.1.8 : Thu Aug 02 2007 - 03:02:38 PDT