在 Ezra SIL、XeLaTeX 中元音定位有问题

在 Ezra SIL、XeLaTeX 中元音定位有问题

我无法匹配答案中给出的示例 使用 TeX 排版少量希伯来语内容的简单方法是什么?

我完全按照该答案中给出的示例复制/粘贴,但结果却是这样的:

示例对我来说是什么样的

我用红色箭头标记了我遇到的问题,即 yodh(יִ)下元音 hireq 的位置不正确:元音太高了。

我在 Mac OS X Mavericks 上使用最新安装的 TeX Live 2013。Ezra SIL 字体是版本 2.51。

如果我将希伯来语文本复制/粘贴到 Mac TextEdit 中并选择 Ezra SIL 作为字体,则 hireq 的位置正确。

或者,如果我将字体切换为 SBL Hebrew:

\newfontfamily\hebrewfont[Script=Hebrew]{SBL Hebrew}% or whatever

hireq 的定位也正确。

看来 Ezra SIL曾是以前为别人工作过,但现在对我来说不是了。有什么想法吗?

这是否与此问题有关(即切换到 HarfBuzz 的结果): 希伯来语中短字母和长字母的底部元音符号 (nikkud) 的垂直位置错误

作为参考,XeTeX 的输出如下所示:

Running `LaTeX' on `testhebvowels' with ``xelatex  -interaction=nonstopmode "\input" testhebvowels.tex''
This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013)
 restricted \write18 enabled.
entering extended mode
LaTeX2e <2011/06/27>
Babel <3.9f> and hyphenation patterns for 78 languages loaded.
(./testhebvowels.tex
(/usr/local/texlive/2013/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/texlive/2013/texmf-dist/tex/latex/base/size12.clo))
(/usr/local/texlive/2013/texmf-dist/tex/latex/polyglossia/polyglossia.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/etoolbox/etoolbox.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/etex-pkg/etex.sty))
(/usr/local/texlive/2013/texmf-dist/tex/latex/makecmds/makecmds.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/local/texlive/2013/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/local/texlive/2013/texmf-dist/tex/generic/xkeyval/keyval.tex)))
(/usr/local/texlive/2013/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3names.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3bootstrap.sty))
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3basics.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3expan.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3tl.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3seq.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3int.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3quark.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3prg.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3clist.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3token.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3prop.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3msg.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3file.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3skip.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3keys.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3fp.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3box.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3coffins.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3color.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3luatex.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3candidates.sty)
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/ifpdf.sty))
(/usr/local/texlive/2013/texmf-dist/tex/latex/l3packages/xparse/xparse.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/fontspec/fontspec-patches.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/base/fixltx2e.sty)
*************************************************
* LaTeX warning: "xparse/redefine-command"
* 
* Redefining document command \oldstylenums with arg. spec. 'm' on line 128.
*************************************************
) (/usr/local/texlive/2013/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/euenc/eu1enc.def)
(/usr/local/texlive/2013/texmf-dist/tex/latex/euenc/eu1lmr.fd))
(/usr/local/texlive/2013/texmf-dist/tex/xelatex/xunicode/xunicode.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/tipa/t3enc.def
(/usr/local/texlive/2013/texmf-dist/tex/latex/euenc/eu1lmss.fd))
(/usr/local/texlive/2013/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/latexconfig/graphics.cfg)
(/usr/local/texlive/2013/texmf-dist/tex/xelatex/xetex-def/xetex.def))))
(/usr/local/texlive/2013/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/ifluatex.sty))
(/usr/local/texlive/2013/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf
(/usr/local/texlive/2013/texmf-dist/tex/xelatex/bidi/bidi.sty
****************************************************
* 
* bidi package (Bidirectional typesetting in
* plain TeX and LaTeX, using XeTeX engine)
* 
* Description: A convenient interface for
* typesetting bidirectional texts in plain TeX
* and LaTeX. The package includes adaptations
* for use with many other commonly-used packages.
* 
* Copyright © 2009–2013 Vafa Khalighi
* 
* 2013/11/16, v14.4
* 
* License: LaTeX Project Public License, version
* 1.3c or higher (your choice)
* 
* Location on CTAN: /macros/xetex/latex/bidi
* 
* Issue tracker: https://github.com/vafa/bidi/issues
* 
* Support: [email protected]
****************************************************
(/usr/local/texlive/2013/texmf-dist/tex/generic/iftex/iftex.sty)
(/usr/local/texlive/2013/texmf-dist/tex/xelatex/bidi/biditools.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/oberdiek/zref-abspage.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/oberdiek/zref-base.sty
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/etexcmds.sty))
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty)
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/oberdiek/auxhook.sty))
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/atbegshi.sty))
(/usr/local/texlive/2013/texmf-dist/tex/xelatex/bidi/latex-xetex-bidi.def
(/usr/local/texlive/2013/texmf-dist/tex/xelatex/bidi/footnote-xetex-bidi.def)
(/usr/local/texlive/2013/texmf-dist/tex/xelatex/bidi/article-xetex-bidi.def)
(/usr/local/texlive/2013/texmf-dist/tex/xelatex/bidi/graphicx-xetex-bidi.def))
(/usr/local/texlive/2013/texmf-dist/tex/xelatex/bidi/loadingorder-xetex-bidi.def)) (/usr/local/texlive/2013/texmf-dist/tex/latex/polyglossia/hebrewcal.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/polyglossia/cal-util.def))
(/usr/local/texlive/2013/texmf-dist/tex/latex/polyglossia/babel-hebrewalph.def)) (/usr/local/texlive/2013/texmf-dist/tex/latex/polyglossia/gloss-english.ldf)
(./testhebvowels.aux)
(/usr/local/texlive/2013/texmf-dist/tex/latex/tipa/t3cmr.fd)
Setting \if@calendar@hebrew

LaTeX Font Warning: Font shape `EU1/EzraSIL(0)/bx/n' undefined
(Font)              using `EU1/EzraSIL(0)/m/n' instead on input line 15.

[1] (./testhebvowels.aux)

LaTeX Font Warning: Some font shapes were not available, defaults substituted.

 )
Output written on testhebvowels.pdf (1 page).
Transcript written on testhebvowels.log.

LaTeX finished at Fri Jan 31 10:37:33

答案1

更新:我不再确定下面所写的内容是否正确,即这种特定的组合似乎不是 Unicode 规范化的一部分,而这似乎是 HarfBuzz 的一个“特性”(或者对于 Ezra SIL 而言是一个错误特性)。

这是字体错误。字体中有一个U+FB1D希伯来字母 YOD 和 HIRIQ 字符,其字形的 hirq 位置较高。这在 HarfBuzz 之前的 XeTeX 中有效,因为文本实际上使用了U+05D9希伯来字母 YOD +U+05B4希伯来点 HIRIQ,并且使用 OpenType 锚点正确定位了它们,但在 HarfBuzz 中失败,因为U+FB1D在规范上等同于U+05D9+ U+05B4,因此 HarfBuzz 在此处应用 Unicode 规范组合并使用 的字形U+FB1D

以下是 XeTeX 0.9998(HarfBuzz 之前)和 XeTeX 0.9999(HarfBuzz)的比较,您可以看到,对于规范等效的输入,HarfBuzz 之前的 XeTeX 产生了不同的输出。

XeTeX 0.9998 (HarfBuzz 之前版本) XeTeX 0.9999 (HarfBuzz)

U+FB1DHarfBuzz 的行为是合理的,因为 Unicode 要求规范等效序列应被相同处理,因此无论输入是还是U+05D9+ ,用户都应该获得相同的输出U+05B4,但 Ezra SIL 会产生不同的输出(如果没有执行规范化),所以这里的问题出在它身上。

我建议您向 Ezra SILL 开发人员报告此问题,因为该问题不仅限于 XeTeX 或 HarfBuzz(基本上任何应用 NFC 规范化或U+FB1D直接使用输入的应用程序都会受到影响)。

解决此问题的一种方法是编辑字体并删除该U+FB1D字符(通过删除其字形或将其从cmap表中隐藏),在这种情况下,HarfBuzz 将不会在此处应用组合(如果输入U+FB1D它将分解因为字体中没有它,所以与 HarfBuzz XeTeX 之前相比,你也会得到更好的结果)。

这与您发现的 HarfBuzz 错误报告完全不同,因为它涉及传统的非 OpenType 字体,其中 HarfBuzz 将尝试使用启发式方法来定位标记本身,但这并不总能产生最优定位。

答案2

我不确定 Mac 上有哪些可用性,但我在 Linux 上使用 Culmus David 字体来用 XeTeX 排版希伯来语,效果很好:

带有 Hirik 的希伯来语文本的 PDF

字体可以从以下网站免费下载:http://culmus.sourceforge.net/。我希望它们能在 Mac 上正常运行。

相关内容