|
From: Mojca M. <moj...@gm...> - 2009-09-14 20:41:36
|
On Mon, Sep 14, 2009 at 19:59, Ethan Merritt wrote:
> On Monday 14 September 2009 10:47:05 James R. Van Zandt wrote:
>>
>> I can generate a sample file like this:
>>
>> set term svg enhanced
>> set out "sine.svg"
>> set label "e^{i{/Symbol p}}=-1" at graph .5,.5
>> plot sin(x)
>> set out
>>
>> When I display the output using inkscape 0.46, I see three problems:
>>
>> - All the lines are missing
I see them in Safari and Firefox, but I'm not sure about Inkscape and
I have no idea about proper SVG syntax.
>> - The superscripted characters are spaced out
I don't know the specification, but removing the space, that means changing
<tspan>e</tspan>
<tspan font-size="9.6pt" dy="-6.00pt">iπ</tspan>
into
<tspan>e</tspan><tspan font-size="9.6pt" dy="-6.00pt">iπ</tspan>
helped. I don't know whether this classifies as gnuplot problem or
viewer problem, but I would expect
<text>a
b
c</text>
to print out "a b c", not "abc", so without reading exact
specification, I would vote for browser's behaviour, not for
gnuplot's, and that particular problem should be rather trivial to fix
in gnuplot itself.
Just a question (I don't know SVG at all, I just saw an example): wouldn't
<tspan baseline-shift = "super">
do the job as well?
>> - The Greek letter pi appears as "p".
>>
>> By googling I came up with workarounds for the first two problems:
>>
>> perl -p -i -e 's/color:([^;]*); *stroke:[^;]*;/color:$1; stroke:$1;/' sine.svg
>> perl -p -i -e 's/xml:space=.preserve.//' sine.svg
>>
>> Does anyone have suggestions about the Greek letters?
>
> (1) Fonts
> SVG is an XML variant, which means it natively uses UTF-8 encoding.
> The "Symbol" font is an Adobe-specific encoding that nobody else uses.
> So it works for PostScript and PDF, but probably nothing else.
> Use UTF-8
I agree. The following line:
set label "e^{iπ}=-1" at graph .5,.5
works as expected (I don't know if you are able to read it though;
it's an UTF-8 letter pi). The PostScript example in as "ugly hack"
only.
Mojca
|