我想在包含东欧语言的多个变音符号的文档中使用 Alegreya 字体。使用 xelatex 一切正常,但我想使用 pdftex,而我遇到了一个问题:使用 pdftex,大多数常见的重音符号显示良好,但在某些情况下,字母和变音符号之间的垂直距离非常大。我看到这种效果出现在小写和大写字母上的短音符 (\u) 上,以及出现在大写字母上的抑扬符 (\v) 和脱字符 (\^)。下面是一个可以显示我的问题的示例。这是东欧作曲家的姓名列表:
\documentclass{scrbook}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{Alegreya}
\usepackage[english,ngerman]{babel}
\begin{document}
Rodion \^{S}edrin
\u{U}ladz\`{i}m\`{i}r Damarackij
V\^{a}\v{c}\`{e}sla\u{u} Kuzn\^{a}co\u{u}
\end{document}
您是否知道这是 Alegreya 字体与 pdftex 的弱点或者是否有办法修复它?
答案1
Alegreya 字体的字体度量文件中的参数是错误的;x 高度(存储在 中)太小,如以下测试文件所示。一些重音符号的位置正确,因为在 T1 编码中它们是预先组合的;只有当重音字母未预先组合且必须使用\fontdimen5
TeX 的方法(基于 )时,才会出现问题。\fontdimen5
\documentclass{scrbook}
\usepackage[T1]{fontenc}
\usepackage{Alegreya}
\begin{document}
The x-height: \expandafter\texttt\expandafter{\the\fontdimen5\font}
The height of `x': \expandafter\texttt\expandafter{\the\fontcharht\font`x}
\fontdimen5\font=\fontcharht\font`x
Rodion \^{S}edrin
\u{U}ladz\`{i}m\`{i}r Damarackij
V\^{a}\v{c}\`{e}sla\u{u} Kuzn\^{a}co\u{u}
\end{document}
(这些\expandafter
标记只是为了在更改参数值之前使用当前字体漂亮地打印该参数的值\texttt
)。
在测试文件中,我将 x 高度更改为更合理的值,您可以看到结果是正确的。
您应该提交错误报告。目前,您可以使用以下方法解决此问题:
\documentclass{scrbook}
\usepackage[T1]{fontenc}
%%%%% ADD THIS TO YOUR PREAMBLE BEFORE LOADING Alegreya
\DeclareFontFamily{T1}{Alegreya-LF}{}
\newcommand{\adjustalegreya}{\fontdimen5\font=\fontcharht\font`x }
\makeatletter
\let\Alegreya@@scale\@empty
%%% uncomment the next line if you want to scale the font,
%%% changing the value to what suits you
% \def\Alegreya@@scale{s*[0.9]}%
\makeatother
\DeclareFontShape{T1}{Alegreya-LF}{k}{n}{
<-> \Alegreya@@scale Alegreya-Black-lf-t1
}{\adjustalegreya}
\DeclareFontShape{T1}{Alegreya-LF}{k}{it}{
<-> \Alegreya@@scale Alegreya-BlackItalic-lf-t1
}{\adjustalegreya}
\DeclareFontShape{T1}{Alegreya-LF}{k}{sl}{
<-> ssub * Alegreya-LF/k/it
}{\adjustalegreya}
\DeclareFontShape{T1}{Alegreya-LF}{b}{n}{
<-> \Alegreya@@scale Alegreya-Bold-lf-t1
}{\adjustalegreya}
\DeclareFontShape{T1}{Alegreya-LF}{b}{it}{
<-> \Alegreya@@scale Alegreya-BoldItalic-lf-t1
}{\adjustalegreya}
\DeclareFontShape{T1}{Alegreya-LF}{b}{sl}{
<-> ssub * Alegreya-LF/b/it
}{\adjustalegreya}
\DeclareFontShape{T1}{Alegreya-LF}{m}{n}{
<-> \Alegreya@@scale Alegreya-Regular-lf-t1
}{\adjustalegreya}
\DeclareFontShape{T1}{Alegreya-LF}{m}{it}{
<-> \Alegreya@@scale Alegreya-Italic-lf-t1
}{\adjustalegreya}
\DeclareFontShape{T1}{Alegreya-LF}{m}{sl}{
<-> ssub * Alegreya-LF/m/it
}{\adjustalegreya}
\DeclareFontShape{T1}{Alegreya-LF}{bx}{sl}{
<-> ssub * Alegreya-LF/b/sl
}{\adjustalegreya}
\DeclareFontShape{T1}{Alegreya-LF}{bx}{n}{
<-> ssub * Alegreya-LF/b/n
}{\adjustalegreya}
\DeclareFontShape{T1}{Alegreya-LF}{bx}{it}{
<-> ssub * Alegreya-LF/b/it
}{\adjustalegreya}
%%%% NOW YOU CAN SAFELY LOAD Alegreya (don't pass a scale option)
\usepackage{Alegreya}
\begin{document}
The x-height: \expandafter\texttt\expandafter{\the\fontdimen5\font}
The height of `x': \expandafter\texttt\expandafter{\the\fontcharht\font`x}
Rodion \^{S}edrin
\u{U}ladz\`{i}m\`{i}r Damarackij
V\^{a}\v{c}\`{e}sla\u{u} Kuzn\^{a}co\u{u}
\footnotesize
The x-height: \expandafter\texttt\expandafter{\the\fontdimen5\font}
The height of `x': \expandafter\texttt\expandafter{\the\fontcharht\font`x}
Rodion \^{S}edrin
\u{U}ladz\`{i}m\`{i}r Damarackij
V\^{a}\v{c}\`{e}sla\u{u} Kuzn\^{a}co\u{u}
\end{document}
更新
2014-05-18 发布的版本Alegreya
似乎已经解决了这个问题。这是原始测试,除了在四种主要样式中重复相同的文本外,没有任何添加。
答案2
TeXLive 也有 OpenType 版本:
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Alegreya SC}
\setsansfont{Alegreya Sans SC}
\begin{document}
The x-height: \expandafter\texttt\expandafter{\the\fontdimen5\font}\\
The height of `x': \expandafter\texttt\expandafter{\the\fontcharht\font`x}\\
Rodion \^{S}edrin\\
\u{U}ladz\`{i}m\`{i}r Damarackij\\
V\^{a}\v{c}\`{e}sla\u{u} Kuzn\^{a}co\u{u} \\
\footnotesize
The x-height: \expandafter\texttt\expandafter{\the\fontdimen5\font}\\
The height of `x': \expandafter\texttt\expandafter{\the\fontcharht\font`x}\\
Rodion \^{S}edrin\\
\u{U}ladz\`{i}m\`{i}r Damarackij\\
V\^{a}\v{c}\`{e}sla\u{u} Kuzn\^{a}co\u{u}
\sffamily\normalsize
The x-height: \expandafter\texttt\expandafter{\the\fontdimen5\font}\\
The height of `x': \expandafter\texttt\expandafter{\the\fontcharht\font`x}\\
Rodion \^{S}edrin\\
\u{U}ladz\`{i}m\`{i}r Damarackij\\
V\^{a}\v{c}\`{e}sla\u{u} Kuzn\^{a}co\u{u} \\
\footnotesize
The x-height: \expandafter\texttt\expandafter{\the\fontdimen5\font}\\
The height of `x': \expandafter\texttt\expandafter{\the\fontcharht\font`x}\\
Rodion \^{S}edrin\\
\u{U}ladz\`{i}m\`{i}r Damarackij\\
V\^{a}\v{c}\`{e}sla\u{u} Kuzn\^{a}co\u{u}
\end{document}