FS#17782 - [gnuplot] looks for fonts to wrong directory (solution included)

Attached to Project: Arch Linux
Opened by Tomas Mudrunka (harvie) - Sunday, 10 January 2010, 18:54 GMT
Last edited by Ronald van Haren (pressh) - Monday, 11 October 2010, 08:38 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Ronald van Haren (pressh)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: getting this error message from gnuplot:
"Could not find/open font when opening font "arial", using internal non-scalable font"
and then it produces ugly graph using bitmap font ;-)

Additional info:
* package version(s)
latest
* config and/or log files etc.

SOLUTION #1:
can be fixed using something like:
1 ;( harvie@harvie-ntb ~ $ sudo mkdir -p /usr/X11R6/lib/X11/fonts/
0 ;) harvie@harvie-ntb ~ $ sudo ln -s /usr/share/fonts/TTF /usr/X11R6/lib/X11/fonts/truetype

SOLUTION #2 (better):
or you better should patch gnuplot sources using sed -e to look into the /usr/share/fonts/TTF instead of /usr/X11R6/lib/X11/fonts/truetype in PKGBUILD...


Steps to reproduce:
try gnuplot (not x11 version) or using wxplot2d() in wxMaxima...
This task depends upon

Closed by  Ronald van Haren (pressh)
Monday, 11 October 2010, 08:38 GMT
Reason for closing:  Works for me
Comment by Rorschach (Rorschach) - Friday, 19 February 2010, 17:10 GMT
Hi,
I can't reproduce this problem:

$ pacman -Qs gnuplot
local/gnuplot 4.2.6-2
Plotting package which outputs to X11, PostScript, PNG, GIF, and others
$ gnuplot --version
gnuplot 4.2 patchlevel 6
$ gnuplot

G N U P L O T
Version 4.2 patchlevel 6
last modified Sep 2009
System: Linux 2.6.32-ARCH

Copyright (C) 1986 - 1993, 1998, 2004, 2007 - 2009
Thomas Williams, Colin Kelley and many others

Type `help` to access the on-line reference manual.
The gnuplot FAQ is available from http://www.gnuplot.info/faq/

Send bug reports and suggestions to <http://sourceforge.net/projects/gnuplot>


Terminal type set to 'wxt'
gnuplot> plot sin(x)/x
gnuplot> exit


I don't get any error-message and the plot looks okay. Coul you better describe what has to be done to reproduce this error if it really still exists? If it really still exists there's a environmental variable called GNUPLOT_FONTPATH which could be the correct solution.
Comment by Tomas Mudrunka (harvie) - Friday, 19 February 2010, 17:30 GMT
the error message is in the image (which makes it more annoying)...
see attachment.
Comment by Tomas Mudrunka (harvie) - Friday, 19 February 2010, 17:31 GMT
oh sorry. maybe that the wxMaxima added the error message to image, but anyway... gnuplot rendered graph with wrong font.
Comment by Ronald van Haren (pressh) - Friday, 19 February 2010, 17:35 GMT
yes it must be maxima adding the error message, it does not show up in the plot when using octave (though it is in the output).

Let me see if I can fix it sometime during the weekend.
Comment by Ronald van Haren (pressh) - Wednesday, 24 February 2010, 13:19 GMT
I looked into this but I can't find any indication that gnuplot is looking into /usr/X11R6/... when called from maxima/octave. As far as I'm aware changing locations in the source (src/variable.c) does not fix this.

From my understanding when calling from either of these apps, the x11 terminal is used by default. The gnuplot x11 terminal looks for ttf fonts in the path defined by the GDFONTPATH variable, which is by default undefined.
Calling gnuplot itself from the commandline defaults to the wxt terminal on my machine which uses pango/cairo to find fonts (and does so coorectly).

To get the x11 terminal find the fonts, this works for me:

export GDFONTPATH=/usr/share/fonts/TTF (of course you can source the variable any way you want)

after that calling wxmaxima and plotting for example "wxplot2d(sin(x), [x,-5,5]);" gives me correct output.

If you have another solution that works and is more convenient let me know, otherwise I suppose I can't do much about it.



Comment by Leonid Isaev (lisaev) - Saturday, 09 October 2010, 16:21 GMT
Is this still an issue? I can't reproduce it.

Loading...