
Alex,
This is helpful. You message seems to indicate that Inkscape can indeed handle the use of CSS for text elements, even though this isn't the default SVG output the program creates. However, I couldn't get Inkscape to open a file with embedded CSS elements. I am likely doing something wrong. Do you have an example of an Inkscape SVG document that uses CSS to style text in the same way as your e-mail example?
Your message did prompt me to do some digging on the way Inkscape handles text. On the wiki FAQ I found some useful information on flowed verus non-flowed text:
http://wiki.inkscape.org/wiki/index.php/FAQ#What_about_flowed_text.3F
It sounds like non-flowed text is the way for me to go until the SVG 1.2 spec gets sorted out.
I think I can use a text element that looks like this:
<text xml:space="preserve" style="font-size:40px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" x="480" y="398.07648" id="text3355"> <tspan sodipodi:role="line" id="tspan3357" x="480" y="398.07648">test</tspan> </text>
This is the SVG output I got when I didn't drag the text creation tool, which I had always done before reading the FAQ.
Thanks for the suggestions.
Landon
2010/3/16 Alex Leone <acleone@...400...>:
Do you have another suggestion on how I can get map labels imported
into Inkscape?
For single line map labels, I would center the text, so that changing the size doesn't change the position, eg: .ctext { text-anchor: middle; text-align: center; alignment-baseline: middle; }
<text x=50 y=50 class="ctext">The text</text>
For multi-line labels, I would split the text into tspan's, eg:
.multiline tspan { text-anchor: middle; text-align: center; alignment-baseline: middle; }
<text x=50 y=50 class="multiline"> <tspan dy="-1.2em" x=50>Hello</tspan> <tspan dy="1.2em" x=50>World!</tspan> <tspan dy="1.2em" x=50>Line 3.</tspan> </text>
Where everything will be centered on x=50, y=50, and the line_height is 1.2em. The dy's should be:
- first dy: - ( line_height * (num_lines - 1) / 2.0 )
- all other dy's: line_height
Hopefully this helps, - Alex