我正在尝试输出arial size 14字体的png图像.我使用mac OS X 10.6并没有自己构建GNUPLOT.我从Octave包中的OS X高性能计算网站获得了该程序.这是我在gnuplot中输入的内容:
G N U P L O T
Version 4.2 patchlevel 5
last modified Mar 2009
System: Darwin 10.0.0
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 'x11'
gnuplot> set term png font "arial" 14
Terminal type set to 'png'
No TTF font support, using internal non-scalable font
^
invalid color spec, must be xRRGGBB
gnuplot>
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激.谢谢!
ott*_*ath 17
以下适用于Mac OS X 10.5,通过MacPorts安装gnuplot:
set terminal png font "/Library/Fonts/Arial.ttf" 14
Run Code Online (Sandbox Code Playgroud)
该文件可通过help terminal png
(强调我的)获得:
如果gnuplot是在支持TrueType(.ttf)或Adobe Type 1( .pfa)字体的情况下构建的,则可以使用"font {}"选项选择它们.是字体文件的完整路径名,或者是假定为GDFONTPATH环境变量中列出的某个目录中文件名的第一部分的字体名称.也就是说,'set term png font"Face"'将查找名为/Face.ttf或/Face.pfa的字体文件.TrueType和Adobe Type 1字体都是完全可伸缩的,可以旋转任意角度.如果未指定字体,gnuplot将检查环境变量
GNUPLOT_DEFAULT_GDFONT
以查看是否存在首选默认字体.
更新:我刚刚注意到你的gnuplot安装抱怨"没有TTF字体支持",所以上面的内容可能不适合你.为了使真正的类型字体能够工作,你可能需要重新安装gnuplot.