[Top][All Lists]

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

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

From: John W. Eaton
Subject: Re: fontpath from fontconfig: was -> [changeset] print.m (matlab compatibility)
Date: Wed, 11 Mar 2009 13:16:53 -0400

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'", 
      [status, font_list] = system ("fc-list : file");

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

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


reply via email to

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