[英]R strwidth - "Times New Roman" font alias on Linux
I am using strwidth() function (see link below) and looking for a solution to define font-alias for Times New Roman on Linux我正在使用 strwidth() 函数(参见下面的链接)并寻找一种解决方案来为 Linux 上的 Times New Roman 定义字体别名
R Graph - graphical string measurement R Graph - 图形字符串测量
Could we define font-alias as described for svglite in below link我们可以在下面的链接中为 svglite 定义字体别名吗
https://cran.r-project.org/web/packages/svglite/vignettes/fonts.html https://cran.r-project.org/web/packages/svglite/vignettes/fonts.html
Most Linux distros use Fontconfig to define font aliases.大多数 Linux 发行版使用 Fontconfig 来定义字体别名。 These should be respected by most of the graphical devices that R uses.
R 使用的大多数图形设备都应该尊重这些。
For example, to define Tinos as an alias for Times New Roman, you can add the following lines to the file ~/.config/fontconfig/fonts.conf
, between the <fontconfig>
and </fontconfig>
tags.例如,要将 Tinos 定义为 Times New Roman 的别名,您可以将以下几行添加到文件
~/.config/fontconfig/fonts.conf
,位于<fontconfig>
和</fontconfig>
标记之间。
<match>
<test name="family"><string>Times New Roman</string></test>
<edit name="family" mode="assign" binding="strong">
<string>Tinos</string>
</edit>
</match>
Note that, if ~/.config/fontconfig/fonts.conf
does not exist already, you will need to create it and put the following lines into it first请注意,如果
~/.config/fontconfig/fonts.conf
不存在,您需要创建它并首先将以下几行放入其中
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
</fontconfig>
If you want to apply these changes system wide rather than just for one user, then instead edit etc/fonts/local.conf
instead.如果您想在系统范围内应用这些更改,而不仅仅是针对一个用户,那么请改为编辑
etc/fonts/local.conf
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.