[Pkg-octave-devel] Bug#477688: Bug#477688: Bug#477688: [octave3.0] print()'ing a figure with title or (x|y)labels fails with gdImageStringFT error
John W. Eaton
jwe at bevo.che.wisc.edu
Tue Apr 29 20:15:05 UTC 2008
On 29-Apr-2008, Thomas Weber wrote:
| On 29/04/08 17:18 +0200, Didier Raboud wrote:
| > Le mardi, 29 avril 2008 17.08:04 Thomas Weber, vous avez écrit :
| > > I get the warnings as well, but my plot contains the labels (maybe in a
| > > different font, I don't know).
| > >
| > > Thomas
| >
| > The plot itself contains the labels, but the saved version does not (for me).
|
| I see.
|
| Okay, two questions:
| 1) Do you actually have the font "Helvetica"? Unless you paid for it, I
| doubt that, as it doesn't seem to be freely available.
|
| 2) Do you actually care about the font being "Helvetica"?
|
| As the answer to question 2 is probably "no", here you go:
|
| a) Set GDFONTPATH in your shell to a directory that contains the font
| you want to use, in my case
| export GDFONTPATH=/usr/share/fonts/truetype/msttcorefonts
| b) Start Octave and give the font type explicitely:
|
| figure;
| plot(1:2,1:2);
| xlabel('Label X', 'FontName', 'Arial');
| ylabel('Label Y', 'FontName', 'Arial');
| title('Title', 'FontName', 'Arial');
| legend('Blue Line');
|
| print('/tmp/testcase.png');
You may also specify a default font for all labels by setting a
default property in the root figure:
set (0, 'defaulttextfontname', 'Arial');
Then you do not need to specify individually in each text object.
jwe
More information about the Pkg-octave-devel
mailing list