XeLaTeX fontspec Century Gothic 不使用连字

XeLaTeX fontspec Century Gothic 不使用连字

我尝试在文档中使用 Century Gothic TrueType 字体,但无法使用 fl 和 fi 连字符。输入如下:

\documentclass{article}
\usepackage{xltxtra}
\setmainfont[Mapping=tex-text]{Century Gothic}
\begin{document}
ff fi fl
\end{document}

我使用的是 Win7;运行,我可以看到 Century Gothic 在和 处charmap有连字符,所以我希望 XeLaTeX 能够识别它们。文档编译时没有错误,但也没有连字符。0xFB010xFB02

我正在运行 MiKTeX,包更新程序告诉我所有内容都是最新版本。

更新拉芬克建议指定Ligatures=RareLigatures=Historical对生成的文档没有影响,并导致控制台输出一些重复的错误类似于以下内容:

*************************************************
* fontspec warning: "icu-feature-not-exist-in-font"
* 
* OpenType feature 'Ligatures=Rare' (+dlig) not available for font 'Century
* Gothic' with script '' and language ''.
*************************************************

更新 2:根据建议乌尔丽克·菲舍尔xelatex --output-driver="xdvipdfmv -vv",文件中运行的可能相关输出\XeTeXtracingfonts= 1产生了控制台输出,包括以下看起来有点相关的行(这对我来说毫无意义,但我希望它对你们中的一些人来说可能是有意义的):

<AGL:texglyphlist.txt>[1<CenturyGothic(Century Gothic:Regular)@9.96pt<NATIVE-FONTMAP:CenturyGothic/H/65536/0/0>
fontmap: CenturyGothic/H/65536/0/0 -> C:/Windows/Fonts/GOTHIC.TTF(Identity-H)

pdf_font>> Input encoding "Identity-H" requires at least 2 bytes.
pdf_font>> The -m <00> option will be assumed for "C:/Windows/Fonts/GOTHIC.TTF".
(CID:CenturyGothic)
pdf_font>> Type0 font "C:/Windows/Fonts/GOTHIC.TTF" cmap_id=<Identity-H,0> opened at font_id=<CenturyGothic/H/65536/0/0,0>.
>]
otf_cmap>> Creating ToUnicode CMap for "C:/Windows/Fonts/GOTHIC.TTF"...
(CID:C:/Windows/Fonts/GOTHIC.TTF[BNGDWL+CenturyGothic][CIDFontType2][5 glyphs (Max CID: 79)][12097 bytes])

日志文件中还有以下内容:

.................................................
. fontspec info: "no-scripts"
. 
. Font Century Gothic does not contain any OpenType `Script' information.
.................................................
.................................................
. fontspec info: "defining-font"
. 
. Font family 'CenturyGothic(0)' created for font 'Century Gothic' with
. options [Ligatures=TeX].
. 
. This font family consists of the following shapes:
. 
. * 'normal' with NFSS spec.:
. <->"Century Gothic/ICU:mapping=tex-text;"
. 
. * 'bold' with NFSS spec.:
. <->"Century Gothic/B/ICU:mapping=tex-text;"
. 
. * 'italic' with NFSS spec.:
. <->"Century Gothic/I/ICU:mapping=tex-text;"
. 
. * 'bold italic' with NFSS spec.:
. <->"Century Gothic/BI/ICU:mapping=tex-text;"
.................................................

更新 3:请注意,这是 TrueType 字体,而不是 OpenType 字体。不过,连字仍然存在,所以我看不出有什么理由不能使用它们……

答案1

我工作电脑上有 century gothic。我无法在那里安装字体属性扩展 (http://www.microsoft.com/typography/TrueTypeProperty21.mspx),所以我无法真正检查字体。但如果我用\setmainfont[Ligatures=Common]{Century Gothic} fontspec 调用字体,日志中会显示:

OpenType feature 'Ligatures=Common' (+liga) not available for font 'Century
* Gothic/I' with script '' and language ''

所以我想说开放式连字符功能并不存在。

如果您确实想使用该字体,则必须编写自定义映射文件并使用 teckit 进行编译,然后将其与 -option 一起使用Mapping(如Mapping=tex-text)。您可以在 texmf 树中找到映射文件的示例\fonts\misc\xetex\fontmapping。teckit 在此处http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=TECkitDownloads

顺便说一句:您提供的输出很有用。它告诉了我例如字体的确切名称(及其类型),还排除了字体问题的其他来源。

答案2

您是否检查过系统中的版本是否Century Gothic为 OpenType 格式?我之所以问这个问题是因为我认为 XeLaTeX 的大多数“高级”字体相关功能都要求字体为 OpenType 格式。

更新

我现在已经获得了“普通”(truetype)字体“Century Gothic”的副本(文件名为“gothic.ttf”)和 opentype 字体“Century Gothic Standard”,文件名为“CenturyGothicStd.otf”。我应该注意,除了下面详述的连字支持外,这两种字体似乎几乎相同;ttf 版本有 244 个字形,otf 版本有 251 个。(嗯,除了“标准”opentype 字体外,还有一个“专业”opentype 版本,但我没有那个字体。)它们都是由 Monotype 出售的,特别是,两个都字体具有“fl”和“fi”连字符对。此外,两种字体都没有“ff”连字符对或“ffl”和“ffi”连字符三元组。

使用命令加载 truetype 字体后\setmainfont{Century Gothic},运行 OP 的 MWE 时我得到以下输出:

在此处输入图片描述

与 OP 一样。相比之下,使用 opentype 字体——加载\setmainfont{Century Gothic Std}——我得到

在此处输入图片描述

(在这两种情况下,我也提供了说明\addfontfeatures{Ligatures=TeX}。)

因此,至少对于 Monotype 发布的 truetype 和 opentype 格式的“Century Gothic”字体而言,它似乎 .otf 版本比 .ttf 版本提供了更多的“服务”(至少从 xelatex 访问时)。

答案3

嗯,我有一个不同字体存在类似问题,我发现我可以通过使用 RawFeature={+liga} 来使其工作。我无法测试它,因为我的系统上没有 Century Gothic,但我怀疑它可能按如下方式工作:

\documentclass{article}
\usepackage{xltxtra}
\setmainfont[Ligatures=TeX, RawFeature={+liga,+hlig,+dlig}]{Century Gothic}
\begin{document}
ff fi fl
\end{document}

相关内容