fontpath from fontconfig: was -> [changeset] print.m (matlab compatibility)
Ben Abbott
bpabbott at mac.com
Thu Mar 12 06:28:52 CDT 2009
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: changeset-fontpath.patch
Type: application/octet-stream
Size: 4458 bytes
Desc: not available
Url : https://www-old.cae.wisc.edu/pipermail/octave-maintainers/attachments/20090312/5bdad360/attachment.obj
-------------- next part --------------
More information about the Octave-maintainers
mailing list