Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Symbol fonts and non-white background in SVG?

363 views
Skip to first unread message

Ingo Thies

unread,
Dec 2, 2012, 7:26:08 AM12/2/12
to
Dear all,

is there a robust way to display symbol fonts (i.e. greek letters) in
SVG terminal? Apparently, the usual {/Symbol a} doesn't output the
letter alpha, but simply the latin a. My terminal definition is

set term svg size 1000, 600 dynamic enhanced font "Arial,20"

In addition: The setting of a background other than white still doesn't
work properly (neither Firefox nor Safari apply the optional black
background rgb '#000000').

Best regards,

Ingo

Michael

unread,
Dec 2, 2012, 11:43:22 AM12/2/12
to
02.12.2012 19:26, Ingo Thies пишет:
I tried it and the result is same as in your example. But if you copy
the symbol from the "Symbol Table" application to source code, then it
works.

set term svg size 1000, 600 dynamic enhanced font "Arial,20"
set output "1.svg"
set xlabel"δ"
plot sin(x)
reset

sfeam

unread,
Dec 2, 2012, 12:47:22 PM12/2/12
to
Ingo Thies wrote:

> Dear all,
>
> is there a robust way to display symbol fonts (i.e. greek letters) in
> SVG terminal?

SVG is a subset of XML, for which the standard encoding is UTF-8.
If you enter your characters in UTF-8 you should be OK.
In theory you should also gnuplot "set encoding utf8"
but in practice that doesn't make any difference to the
svg terminal output since it is already the default.

> Apparently, the usual {/Symbol a} doesn't output the
> letter alpha, but simply the latin a.

The "usual" font named Symbol is specifically an Adobe font with a
non-standard encoding. It is useful only for PostScript.
If you have a non-Adobe font with that name, I don't know what
encoding it uses.

> My terminal definition is
>
> set term svg size 1000, 600 dynamic enhanced font "Arial,20"
>
> In addition: The setting of a background other than white still
> doesn't work properly (neither Firefox nor Safari apply the optional
> black background rgb '#000000').

Heh. That seems to be a bug specific to a background setting
that is identically zero. Setting the background to '#000001' works.
I will look into it.

Ethan

Ingo Thies

unread,
Dec 2, 2012, 1:54:47 PM12/2/12
to
sfeam wrote:

> SVG is a subset of XML, for which the standard encoding is UTF-8.
> If you enter your characters in UTF-8 you should be OK.

Ah, thanks, this works!

BTW dash length seems to be fixed for SVG, the "dl" statement is not
recognized. Is there another way (apart from hacking the SVG code
itself) to double the spacing?

> Heh. That seems to be a bug specific to a background setting
> that is identically zero. Setting the background to '#000001' works.
> I will look into it.

Thanks!

Best wishes,

Ingo

sfeam

unread,
Dec 2, 2012, 3:14:03 PM12/2/12
to
Ingo Thies wrote:

> BTW dash length seems to be fixed for SVG, the "dl" statement is not
> recognized. Is there another way (apart from hacking the SVG code
> itself) to double the spacing?

The 4.7 cvs version supports "set term svg dashed dashlength <const>".
It's a very recent addition. But I'm not very pleased with the result.
Perhaps the spacing should scale automatically with the linewidth?

Anyhow, it is possible to change the dash spacing by editing the output
SVG file. At the start of each plot drawn with dashed lines there
will appear a setting like this:
stroke-dasharray=' 8,4,2,4'
You could use global search-and-replace in a text editor, e.g.
%s/' 8,4,2,4'/' 16,8,4,8'/

The same thing could be done through a GUI svg editor like inkscape.

Ethan

Ingo Thies

unread,
Dec 3, 2012, 3:49:26 AM12/3/12
to
On 02.12.2012 21:14, sfeam wrote:

> The 4.7 cvs version supports "set term svg dashed dashlength <const>".
> It's a very recent addition. But I'm not very pleased with the result.
> Perhaps the spacing should scale automatically with the linewidth?

I would suggest a combination of both: Per default they could be scaled
with the linewidth to get best-fit allround separations. In addition,
the user could apply a scaling factor to fit the line spacing to special
'problem cases' (depending on the kind of data plotted and the shape of
the resulting curves, number of curves plotted etc.).

BTW I couldn't find a way to get slanted/italic fontshapes in SVG. Did I
overlook something?

Best wishes,

Ingo

sfeam

unread,
Dec 3, 2012, 12:36:16 PM12/3/12
to
Ingo Thies wrote:

> BTW I couldn't find a way to get slanted/italic fontshapes in SVG. Did I
> overlook something?

set title "Big Bold Italic Font" font "Times Bold Italic,16"

I had to look at the code to figure this out. The whitespace in front
of the words "bold" and/or "italic" is currently required, but probably
shouldn't be. It is not case sensitive.

These details are correct only for the svg terminal.
Someone was working on adding bold/italic support to all terminals
in a systematic way, but I seem to have lost track of who that was and
what progress they made.

Ethan

0 new messages