如何让 XeLaTeX 识别与 Windows 链接的字体?

如何让 XeLaTeX 识别与 Windows 链接的字体?

我无法让fontconfigXeLaTeX 所依赖的将 Fonts 文件夹中的字体识别为快捷方式(指向其他文件夹中的字体)。fc-cachefc-list忽略未使用dir命令出现的快捷方式。

难道我做错了什么?

答案1

您可以修改库fonts.conf的配置文件。fontconfig

TeX 直播

C:\texlive对于 TeX Live 2011,如果你在例如打开的环境中安装它C:\texlive\2011\texmf-var\fonts\conf\fonts.conf,应该有以下几行:

<!--
    Find fonts in these directories

        You can add other directories if you have additional fonts.
        Example:
<dir>C:/Windows/fonts</dir>
<dir>c:/usr/local/share/texmf/fonts/opentype/dnscreen/hiragino</dir>
<dir>c:/usr/local/share/texmf/fonts/opentype/adobe/kozuka</dir>

-->

<dir>C:/Windows/fonts</dir>
<dir>C:/texlive/2011/texmf-dist/fonts/opentype</dir>
<dir>C:/texlive/2011/texmf-dist/fonts/truetype</dir>

您可以根据需要添加一些线条。

微特克斯

如果您使用的是 MiKTeX(C:\miktex例如安装在),您可以查看C:\miktex\fontconfig\config\fonts.conf并遵循文件注释中的指导行。事实上,您应该打开localfonts.conf以查看预定义的目录,然后创建一个localfonts2.conf以添加您自己的路径。

fonts.conf

<!--
    DO NOT EDIT THIS FILE.
    IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.
    LOCAL CHANGES BELONG IN 'local.conf'.

    The intent of this standard configuration file is to be adequate for
    most environments.  If you have a reasonably normal environment and
    have found problems with this configuration, they are probably
    things that others will also want fixed.  Please submit any
    problems to the fontconfig bugzilla system located at fontconfig.org

    Note that the normal 'make install' procedure for fontconfig is to
    replace any existing fonts.conf file with the new version.  Place
    any local customizations in local.conf which this file references.

    Keith Packard
-->

<!-- Font directory list -->

    <include>C:\miktex/fontconfig/config/localfonts.conf</include>

这是localfonts.conf

<?xml version="1.0" encoding="UTF-8"?>

<!--
  DO NOT EDIT THIS FILE! It will be replaced when MiKTeX is updated.
  Instead, edit the configuration file localfonts2.conf.
-->

<fontconfig>
<include>localfonts2.conf</include>
<dir>C:\Windows\Fonts</dir>
<dir>C:\miktex\fonts\type1</dir>
<dir>C:\miktex\fonts\opentype</dir>
</fontconfig>

相关内容