dynamically created SVG

Discuss SVG code, accessible via the XML Editor.
tobis

dynamically created SVG

Postby tobis » Wed Jul 02, 2008 7:59 pm

I have dynamically created SVG file it looks like this:

Code: Select all

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100mm" height="30mm" xmlns="http://www.w3.org/2000/svg" version="1.1">
  <text x="12mm" y="15mm" font-family="Tahoma" font-size="179.94984mm" fill="#454545" >
    Testa zīmogs
  </text>
  <rect x="1" y="1" width="98mm" height="28mm" fill="none" stroke="red"/>
</svg>

My font-size is set to 10mm(milimeters) but when i`m opening this svg file in Inkscape font-size is 9,336. This is the problem.

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: dynamically created SVG

Postby microUgly » Wed Jul 02, 2008 8:16 pm

I personally don't know how well Inkscape handles different units. I can't explain why you get this number. But I think Inkscape expects everything in pixels (it then calculates other sizes based on 90 dpi). So you may have to accept that Inkscape isn't suitable for editing this file.

tobis

Re: dynamically created SVG

Postby tobis » Wed Jul 02, 2008 8:29 pm

there will be Online Seal creating Web service. So we need dynamically create all the font and other dimensions in mm because we need real life dimensions. We want that client can Online create Seal and we through Inkscape Print out already created SVG. So is this possible ? maybe any other suggestions ?

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: dynamically created SVG

Postby microUgly » Wed Jul 02, 2008 8:58 pm

You can still use Inkscape and get real world dimensions. Whilst everything is in pixels, it's still vector. Inkscape lets you work with a variety of different units wich are all translated from the fact that 90 pixels is 1 inch.

tobis

Re: dynamically created SVG

Postby tobis » Thu Jul 03, 2008 1:37 am

With the pixels the same

Code: Select all

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="300px" height="300px" xmlns="http://www.w3.org/2000/svg" version="1.1">
  <text x="50px" y="50px" font-family="Tahoma" font-size="20px" fill="#454545" >
    Testa zīmogs
  </text>
  <rect x="0px" y="0px" width="300px" height="300px" fill="none" stroke="red" stroke-width="0px" />
</svg>

I created this with some text editor and opened in Inkscape.
font-size was changed to 18,672, svg height to 303,000 and so on. Can somebody help, maybe there is some hidden options ?

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: dynamically created SVG

Postby microUgly » Thu Jul 03, 2008 9:01 am

Maybe you create create what you want in Inkscape first, then examine how it describes it and follow the format.


Return to “SVG / XML Code”