
계속https://chat.stackexchange.com/rooms/97632/discussion-between-marcel-kruger-and-mdayq6, lualatex 실행 중
\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
% \setmathfont{texgyretermes-math.otf}
\setmathfont[Kerning=On]{TeXRygeTermesMath-Regular.otf}%%% same as Tex Gyre Termes Math, with an attempt to improve kerning
\begin{document}
\(\{f\}\)
\[
\{f\}
\]
\end{document}
글꼴을 가져온 곳http://filebin.net/36gqo82z5evv2869(tex gyre termes 수학을 개선하려는 우리의 시도)
보시다시피, 첫 번째 경우에는 커닝이 적용되지만 두 번째 경우에는 적용되지 않습니다. 두 번째 경우에도 적절한 커닝을 얻으려면 어떻게 해야 합니까?
또한 f와 } 사이의 커닝을 줄이려는 시도는 아무데도 끝나지 않습니다. 커닝 오프셋에 입력한 값은 무엇이든 상관 없습니다.
, 결과 PDF는 변경되지 않습니다.
f와 } 사이의 커닝을 조정하는 방법에 대한 아이디어가 있습니까?
마지막으로, Fontforge에서 커닝을 줄이고 사용하는 $\sigma_0$
방법 에 대한 아이디어가 있습니까? \[\sigma_0\]
현재로서는 이 커닝이 엄청나게 큽니다...
편집 : 다음마르셀의 제안, 나는 좋은 솔루션에 대한 검색을 포기 {f}
하고새로운 커닝이 포함된 TeX Ryge Termes Math 글꼴\sigma
이탤릭체 및 \tau
수학 모드에서 올바른 아래 첨자를 개선합니다 . 입력을 고려해 봅시다
\documentclass{article}
\pagestyle{empty}
\usepackage{unicode-math}
%\setmathfont[Ligatures=TeX]{TeX Gyre Termes Math}
\setmathfont[Ligatures=TeX]{TeXRygeTermesMath-Regular.otf} %%% Name changed to comply with the license. The shapes are (hopefully) the same, and the math kernings are new.
\begin{document}
\newcommand{\test}[1]{#1_{abc} #1_0^a #1^b_b #1_1^c #1^d_⊤ #1_⟂^e #1_T^f #1_k^g #1_{\mathup{k}}^h #1_{h}^j}
\newcommand{\testtest}{\test{\sigma}\test{\tau}}
\(\testtest\)
\[\testtest\]
\end{document}
원본 Gyre 글꼴을 사용하면 위의 출력이 생성됩니다.
xelatex 및
루아라텍스의 경우
커닝된 Ryge 글꼴을 사용할 때 우리는 다음을 얻습니다.
xelatex로 컴파일하면
lulatex로 컴파일하면
새로운 Ryge 글꼴을 사용하면 xelatex
커닝에 대해 일반적으로 좋은 작업을 수행하고 lualatex
아래 첨자 "abc"를 제외하고는 커닝에 대해 거의 작업을 수행하지 않습니다. 왜 그렇습니까?
추가 개선이 필요하다고 판단되는 경우:
아래 첨자 ⊤의 커닝을 약간 늘립니다.
답변1
두 가지 문제에 대해서는 다른 질문에 대한 내 답변을 읽어보십시오. 일반 커닝은 수학에 적합한 도구가 아니며 일반적으로 적용되지 않습니다. LuaTeX가 때때로 적용되는 것은 아마도 TeX가 문자가 수학이었던 것을 더 이상 알지 못하기 때문에 발생했을 것입니다. f
이탤릭체 수정이 삽입된 후에 는 f
과 가 }
서로 바로 따르지 않습니다. -> 커닝이 없습니다. 또한 디스플레이 수학에서 LuaTeX는 커닝이 필요한 항목을 찾을 것으로 예상하지 않으므로 커닝을 건너뜁니다.
어쨌든, 마지막 질문은 더 흥미롭습니다.
문자와 아래 첨자 사이의 커닝은 OpenType Math에서 Math 커닝으로 알려져 있습니다. 보다https://docs.microsoft.com/en-us/typography/opentype/spec/math#mathkerninfo-table자세한 내용은. 귀하의 경우에는 시그마만 조정하면 됩니다.
FontForge에서 수학 글꼴을 엽니다. 그런 다음 Element->Other Info->MATH Info를 통해 수학 관련 매개변수를 변경할 수 있습니다. 다음과 같은 창이 열립니다.
"Math Kern"을 선택하고 를 눌러 새 글리프에 대한 수학 커닝을 추가합니다. 귀하의 경우에는 "u1D70E"(MATHEMATICAL ITALIC SMALL SIGMA)로 문자 모양의 이름을 입력하십시오. 그런 다음 변경을 눌러 값을 조정합니다.
그러면 Math Kerning 대화 상자가 나타납니다.
새 포인트를 추가하려면 "텍스트"로 이동한 다음 "오른쪽 하단"을 선택하세요. 세 번 눌러 세 개의 점을 추가하고 "그래픽"으로 돌아갑니다. 이 블록을 선택하려면 오른쪽 하단 아래의 시그마를 클릭하세요. 커닝 포인트가 나타나고 이를 적절한 위치로 끌 수 있습니다. 대략적으로 모든 점은 아래 첨자가 이 높이 이하로 첨부되면 이 정도의 커닝을 얻어야 함을 의미합니다. 예를 들어 다음과 같이 포인트를 설정할 수 있습니다.
이제 확인을 눌러 확인하고 다시 확인하고 글꼴을 생성하세요.
저처럼 포인트를 배치 $\sigma_0$
하시면
물론 글꼴을 변경하고 싶지 않다면 LuaTeX를 사용하면 Lua 코드를 사용하여 mathkerns를 변경할 수도 있습니다.
\documentclass{standalone}
\usepackage{unicode-math}
\usepackage{luacode}
\begin{luacode*}
-- First create a table specifying the mathkerns we want to set:
local mathkerns = {
["TeXGyreTermesMath-Regular"] = { -- This should be the PostScript name of the font
[0x1D70E] = { -- If the character would have a regular name, you could also use the glyphname here
bottomright = {
{height=0,kern=-175},
{height=216,kern=-76},
{kern=0},
},
},
},
}
local function initmathkern(tfmdata)
local values = mathkerns[tfmdata.properties.psname]
if not values then return end
for cp, value in next, values do
local tcp = type(cp)
if tcp == 'string' then
cp = tfmdata.resources.unicodes[cp]
end
local char = tfmdata.characters[cp]
if char then
local mathkern = char.mathkerns
if not mathkern then
mathkern = {}
char.mathkerns = mathkern
end
for corner, v in next, value do
mathkern[corner] = v
end
end
end
end
fonts.constructors.newfeatures'otf'.register{
name = 'mathkern',
description = 'Overwrite mathkern values',
initializers = {
base = initmathkern,
},
}
\end{luacode*}
\setmathfont[RawFeature=mathkern]{texgyretermes-math.otf}
\begin{document}
$\sigma_0$
\end{document}