octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fontpath from fontconfig: was -> [changeset] print.m (matlab compati


From: Ben Abbott
Subject: Re: fontpath from fontconfig: was -> [changeset] print.m (matlab compatibility)
Date: Thu, 12 Mar 2009 19:28:52 +0800


On Mar 12, 2009, at 1:16 AM, John W. Eaton wrote:

On 11-Mar-2009, Ben Abbott wrote:

| Octave has two font paths that need to be set.
|
|       GDFONTPATH sets the path for gdlib (bitmap canvases)
|
|       GNUPLOT_FONTPATH sets the postscript fontpath for gnuplot
|
| I written a m-function to construct each from info supplied by
| fontconfig. There may be a better way of doing this (I'm new to
| fontconfig).
|
|       [GDFONTPATH, true_type_fonts] = fontpath_form_fontconf (".ttf");
|
|       [GNUPLOT_FONTPATH, type_1_fonts] = fontpath_form_fontconf (".pfa");
|
| My thought is to set these environment variables, for each instance of
| gnuplot, each time gnuplot_drawnow opens a plot stream.
|
| For anyone willing to test this on their systems (Window's users are
| of greatest interest), I've attached both a changeset as well as the
| function itself.

If this is intended to be an internal function, then it should
probably be named __fontpath_from_fontconfig__.

 if (! strcmp (font_suffix, prior_suffix))
   if (nargin > 0)
[status, font_list] = system (sprintf ("fc-list : file | grep '. %s'", font_suffix));
   else
     [status, font_list] = system ("fc-list : file");
   endif

Don't you want to avoid depending on grep being available, for
Windows?

If you do use grep, then remember that . matches anything, so you
probably want '\\.' in the sprintf format string.

jwe

A corrected version is attached.

Testing under Linux and (esp) Windows would be appreciated.

Ben


Attachment: changeset-fontpath.patch
Description: Binary data




reply via email to

[Prev in Thread] Current Thread [Next in Thread]