Lose all text when viewing SVG in a web browser (Inkscape 0.48.4 r9939)

Post about projects that use Inkscape for web design.
inkscapeforum
Posts: 8
Joined: Tue Nov 10, 2015 3:43 pm

Lose all text when viewing SVG in a web browser (Inkscape 0.48.4 r9939)

Postby inkscapeforum » Fri Nov 13, 2015 10:38 am

Hey!

For some reason, I'm losing all text when viewing Inkscape-generated SVGs in a web browser.

I mean: When opening the SVG's in a web browser, no text is displayed at all.

I'm generating SVG's with the Inkscape of Trisquel, ie 0.48.4 r9939. I've tested with Firefox and Chrome.

How can I get the text of an SVG to display in a web browser?

I'm pasting both plain and Inkscape SVG snippets for the simplest text-containing document that I can think of...

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="744.09448819"
   height="1052.3622047"
   id="svg7407"
   version="1.1"
   inkscape:version="0.48.4 r9939"
   sodipodi:docname="New document 25">
  <defs
     id="defs7409" />
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="1.4"
     inkscape:cx="249.09848"
     inkscape:cy="520"
     inkscape:document-units="px"
     inkscape:current-layer="layer1"
     showgrid="false"
     inkscape:window-width="1278"
     inkscape:window-height="730"
     inkscape:window-x="0"
     inkscape:window-y="0"
     inkscape:window-maximized="1" />
  <metadata
     id="metadata7412">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:label="Layer 1"
     inkscape:groupmode="layer"
     id="layer1">
    <flowRoot
       xml:space="preserve"
       id="flowRoot7415"
       style="font-size:15px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><flowRegion
         id="flowRegion7417"><rect
           id="rect7419"
           width="320"
           height="247.85715"
           x="45.714287"
           y="398.07648" /></flowRegion><flowPara
         id="flowPara7421">Hello!</flowPara></flowRoot>  </g>
</svg>


Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   version="1.2"
   width="744.09448"
   height="1052.3622"
   id="svg7407">
  <defs
     id="defs7409" />
  <metadata
     id="metadata7412">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     id="layer1">
    <flowRoot
       id="flowRoot7415"
       xml:space="preserve"
       style="font-size:15px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><flowRegion
         id="flowRegion7417"><rect
           width="320"
           height="247.85715"
           x="45.714287"
           y="398.07648"
           id="rect7419" /></flowRegion><flowPara
         id="flowPara7421">Hello!</flowPara></flowRoot>  </g>
</svg>

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Lose all text when viewing SVG in a web browser (Inkscape 0.48.4 r9939)

Postby brynn » Fri Nov 13, 2015 12:40 pm

Understanding the XML is a little beyond my ability. But I do notice the characters "flow" associated with the text. And it looks like it might be flowed into a rectangle?? If that means it's Flowed Text, that's probably why the text isn't showing in the browser.

Try regular text and see what happens.

I don't know if there's more info on flowed text somewhere else in the manual. But here's a little info: http://tavmjong.free.fr/INKSCAPE/MANUAL ... Enter-Flow

I think flowed text isn't part of the SVG standards, and I think that's why it doesn't show up. But I don't clearly understand more than that.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Lose all text when viewing SVG in a web browser (Inkscape 0.48.4 r9939)

Postby Moini » Sat Nov 14, 2015 3:11 am

Yes, Brynn is right, you need to select the text boxes you made by dragging the mouse (instead of just clicking) and then do Text -> Convert to Text.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

inkscapeforum
Posts: 8
Joined: Tue Nov 10, 2015 3:43 pm

Re: Lose all text when viewing SVG in a web browser (Inkscape 0.48.4 r9939)

Postby inkscapeforum » Sat Nov 14, 2015 4:13 am

yes, you're both right. It's working now. Thanks :-)


Return to “Inkscape & the Web”