|
From: <pl...@pi...> - 2009-09-14 20:46:11
|
Ethan Merritt wrote:
> On Monday 14 September 2009 10:47:05 James R. Van Zandt wrote:
>> I'm trying to use the svg terminal in a recent version of gnuplot:
>>
>> G N U P L O T
>> Version 4.3 patchlevel 0
>> last modified March 2009
>>
>> 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
>> - The superscripted characters are spaced out
>> - 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
>
help svg refers the user to read help enhanced, this topic contains
several refernces to the use of /Symbol :
set xlabel 'Time (10^6 {/Symbol m}s)'
this produces the following svg code:
<tspan style="font-family:Symbol" >m</tspan>
as James noted this does not give the expected results. My guess is the
system in question does not have a font called Symbol and is falling
back to a substitute that has little to do with the Adobe font.
This may be useful:
http://www1.tip.nl/~t876506/EntitiesXHTML1.html
> (2) Spacing
> Inkscape is broken.
> But hey, so are all the other SVG viewers I know of.
>
> (3) General problems
> We worked with the Sodipodi developers to fix a bunch of problems,
> but when Sodipodi was forked to Inkscape they seem
> to have forked it from an unfixed version.
>
> On a similar note, in KDE3 the ksvg viewer was probably the best of
> a bad lot. But KDE4 switched to something else that doesn't work at all well.
>
> I've given up on SVG.
>
> I suggest to use the canvas terminal instead.
>
I know that Ethan is very down heartened by SVG viewers and probably
with some justfication having worked on fixing things only see them
reverted. He has probably gone into some considerable detail in testing
a broad range of features but I can say for my usage of embedding plots
inside html and having javascript make it interact with machine control
software on the server there are several viewers that work well.
Firefox3 , very good major improvement on ff 2.x
opera9 (OK over http but displays source on local file open)
ksvg from kde3 . (Have not tested svg on kde4 since the whole of kde 4
is still work in progress at this time.)
Inkscape was not much use for anything last time I looked and trying to
help by reporting bugs got me a "fix it yourself if you're not happy"
attitude :( So sodipodioffi as far as I'm concerned.
HTH
|