gpt4 book ai didi

fonts - 如何在 gnuplot 创建的 png 文件中添加希腊字符

转载 作者:行者123 更新时间:2023-12-04 02:46:21 26 4
gpt4 key购买 nike

我正在使用没有 root 帐户的带有 FreeBSD 系统的商业服务器。我用我的帐户安装 gnuplot。但是,我无法设置字体。所以,我将字体文件复制到我的主目录中,例如 ~/usr/fonts

然后,我在我的 gnuplot 文件中使用以下脚本:

set term png enhanced font '/home/Tom/usr/fonts/truetype/msttcorefonts/verdana.ttf'
set out 'xrd.png'
set xlabel '2 {/Symbol q}';
set ylabel 'Count';
set xrange [:];
set yrange [:];
unset key;
set border lw 1;
plot './data.txt' using 1:2 with l linetype 1 linewidth 1;
set term xterm;
set out ;

但是,当我运行脚本时出现以下错误:

gdImageStringFT: Could not find/open font while printing string q with font Symbol
gdImageStringFT: Could not find/open font while printing string q with font Symbol

这可能是因为我使用的字体“verdana.ttf”不正确。但是,我可以在我自己的装有 Debian 系统的 PC 上使用这种字体。

最佳答案

不要使用/Symbol。那将不会使用 Verdana 字体。

根据 this page , Verdana 字体包括希腊字母。

通过将 set encoding utf8 添加到您的 gnuplot 文件来使用 UTF-8 编码。然后使用您喜欢的文本编辑器将 unicode 符号(根据 this page:θ,希腊小写字母 theta,U+03B8)插入标签字符串。

关于fonts - 如何在 gnuplot 创建的 png 文件中添加希腊字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18753222/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com