View Single Post
Old 02-27-2020, 09:55 AM   #2
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,827
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
First at all, your svg img included in your epub is wrong:

Code:
<div>
    <svg xmlns="http://www.w3.org/2000/svg" height="100%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 800 1222" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink"><image height="1222" width="800" xlink:href="../Images/ch-template.jpg"/>

    <text fill="black" style="font-size: 40px; font-family:'Fontin'; font-style: bold" text-anchor="middle" x="400" y="200">Chapter title</text>

    <text fill="black" style="font-size: 25px; font-family: Fontin" text-anchor="middle" x="400" y="400">"...so that at least I may come to rest</text>
    </svg>   <!-- Here end the svg image -->

    <br/>

    in death in the tranquil resting places"<a href="../Text/ftn.html#ftn1" id="ftn1"><sup>[1]</sup></a> 

    <text fill="black" style="font-size: 20px; font-family: 'Fontin'" text-anchor="right" x="550" y="430">Vergil</text>
  </div>
When you apply the </svg> closing tag, then the svg image ends. So, nothing below belongs to the image. Besides the <br> tag doesn't work in a svg and <text> only works INSIDE svg. If you want to split text, then you must use the tag <tspan>. Your right svg image could be something like:

Code:
  <div>
    <svg xmlns="http://www.w3.org/2000/svg" height="100%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 800 1222" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink">
      <image height="1222" width="800" xlink:href="../Images/ch-template.jpg"/>

      <text fill="black" style="font-size: 40px; font-family:'Fontin'; font-style: bold" text-anchor="middle" x="400" y="200">Chapter title</text>

      <text fill="black" style="font-size: 25px; font-family: Fontin" text-anchor="middle">
         <tspan  x="400" y="400">"...so that at least I may come to rest</tspan>

<tspan x="400" y="450">in death in the tranquil resting places"</tspan></text>

      <text fill="black" style="font-size: 20px; font-family: 'Fontin'" text-anchor="right" x="550" y="500">Vergil</text>
</svg>
  </div>
If you want to learn how to handle text inside a svg image, then it would be good for you to read the following pages:

http://tutorials.jenkov.com/svg/text-element.html

http://tutorials.jenkov.com/svg/tspan-element.html

http://tutorials.jenkov.com/svg/tref-element.html

http://tutorials.jenkov.com/svg/textpath-element.html

Besides, to define a link inside a svg image is not exactly the same as defining a link in xhtml. Watch here how to define a link in svg:

http://tutorials.jenkov.com/svg/a-element.html

Also, inside a svg image you can't use <sup>. If you want text that mimics the superscript style, then you must use basement-shift="super". Your final svg should be something like this one:

Code:
<div>
    <svg xmlns="http://www.w3.org/2000/svg" height="100%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 800 1222" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink">
      <image height="1222" width="800" xlink:href="../Images/ch-template.jpg"/>

          <text fill="black" style="font-size: 40px; font-family:'Fontin'; font-style: bold" text-anchor="middle" x="400" y="200">Chapter title</text>

          <text fill="black" style="font-size: 25px; font-family: Fontin" text-anchor="middle">
             <tspan  x="400" y="400">"...so that at least I may come to rest</tspan>

             <tspan x="400" y="450">in death in the tranquil resting places"</tspan>

             <a xlink:href="../Text/ftn.html#ftn1"><tspan baseline-shift = "super" font-size="20px">[1]</tspan></a>
         </text>

         <text fill="black" style="font-size: 20px; font-family: 'Fontin'" text-anchor="right" x="550" y="500">Vergil</text>
    </svg>
</div>
Of course, the reference of the link must be ajusted. Your epub must contain a page named "ftn.html" (your epub contains a file named "ftn.xhtml" and there must exist the id="ftn1". Othewise the link won't work. Watch in the epub below a working link.

Regards
Attached Files
File Type: epub background_image_text_and _footnote1.epub (156.4 KB, 254 views)

Last edited by RbnJrg; 02-27-2020 at 10:46 AM.
RbnJrg is offline   Reply With Quote