How to set font weight to "bold" in gnuplot 5+ for SVG terminal?
As of gnuplot 5+ (release candidate when asking this question) SVG terminal has parameters fname 'Arial'
and fsize 15
(e.g. Arial with size 15). SVG terminal also supports rich text mode (sub and super scripts, font weight, etc.) for native text labels, saying something like {/Arial:Bold=20 my text}
.
But how can I set the font size globally so that labels will also use it?
When I write fname 'Arial:Bold'
to terminal options the resulting SVG has font-family="Arial:Bold"
, and notfont-family="Arial" font-weight="Bold"
source to share
Lucky for you, terminal svg
is currently the only (?) Terminal that allows this. You can use the terminal option fname
to specify both the font family and the font (with the option, font
you can only select the font family:
set terminal svg standalone fname 'Arial bold' fsize 15
set xlabel 'xlabel'
set ylabel 'ylabel'
set output 'arial-bold.svg'
plot x
Note, however, that with these settings, you cannot set a uniform label for normal font weight (might be a bug) with set label '{/:Normal Normal weight}'
.
source to share