我目前正在嘗試在 lualatex 中使用組合字體建立無襯線字體。在測驗中,我使用 TeX Gyre Pagella Math 作為基本數學字體,並嘗試從其他數學和文字字體中提取字形。
它已經適用於數字和字母,但現在我陷入了積分。我可以使用 TeX Gyre Dejavu Math 中的 textstyle 積分,但 displaystyle 積分是錯誤的。有人知道如何修正這個問題嗎?
(這是一個測試文件!所以它並沒有試圖變得漂亮。例如,腳本樣式字體使用其他粗細,以便可以更好地查看組合是否有效)。
%needs lualatex!
\documentclass[parskip=full,fleqn]{scrartcl}
\usepackage[math-style=upright]{unicode-math}
\usepackage{combofont}
\setmainfont{Fira Sans}
\setupcombofont{FiraMath}
{%
file:texgyrepagella-math.otf:mode=base;script=math;language=DFLT; at #1pt,
file:firasans-light.otf at #1pt,
file:firasans-lightitalic.otf at #1pt,
file:texgyredejavu-math.otf at #1pt
}
{%
{},
0x30-0x39,
0x61-0x7A*0x03B1-0x03C9,
0x222B
}
\setupcombofont{FiraMathScript}
{%
file:texgyrepagella-math.otf:mode=base;script=math;language=DFLT;+ssty=0 at #1pt,
file:firasans-regular.otf at #1pt,
file:firasans-regularitalic.otf at #1pt,
file:texgyredejavu-math.otf at #1pt
}
{%
{},
0x30-0x39,
0x61-0x7A*0x03B1-0x03C9,
0x222B
}
\setupcombofont{FiraMathScriptScript}
{%
file:texgyrepagella-math.otf:mode=base;script=math;language=DFLT;+ssty=1 at #1pt,
file:firasans-semibold.otf at #1pt,
file:firasans-semibolditalic.otf at #1pt,
file:texgyredejavu-math.otf at #1pt
}
{%
{},
0x30-0x39,
0x61-0x7A*0x03B1-0x03C9,
0x222B
}
% Mathversion bold need Script and ScriptScript declarations too!
\setupcombofont{FiraMathBold}
{%
file:texgyrepagella-math.otf:mode=base;script=math;language=DFLT; at #1pt,
file:firasans-regular.otf at #1pt,
file:firasans-regularitalic.otf at #1pt,
file:texgyredejavu-math.otf at #1pt
}
{%
{},
0x30-0x39,
0x61-0x7A*0x03B1-0x03C9,
0x222B
}
\DeclareFontFamily{TU}{FiraMath}{}
\DeclareFontShape {TU}{FiraMath}{m}{n}
{
<-7> combo*FiraMathScriptScript
<7-10>combo*FiraMathScript
<10-> combo*FiraMath
}{}
\DeclareFontShape {TU}{FiraMath}{bx}{n} {<->combo*FiraMathBold}{}
% better start with a real math font, so that
% unicode-math sets everything up
\setmathfont{TeX Gyre Pagella Math}%
% Perhaps some other symbol fonts will need setup too
\SetSymbolFont{operators}{normal}{TU}{FiraMath}{m}{n}
\SetSymbolFont{operators}{bold}{TU}{FiraMath}{bx}{n}
\begin{document}
\minisec{Test some symbols}
$\int f(x)^2$
\[\int f(x)^2 \]
\end{document}
答案1
如果你只是使用 unicode-math
% better start with a real math font, so that
% unicode-math sets everything up
\setmathfont{TeX Gyre Pagella Math}%
所以刪除所有組合字體的東西,然後添加\showoutput
你看到的
.....\l_fontspec_font ∫
....\glue(\thinmuskip) 1.82497
....\l_fontspec_font f
對於文字樣式\int f
但是
.......\l_fontspec_font