9

Trying to use LuaTeX font support in some big document, everything went fine except a little glitch with Asana Math font. Here is the issue:

\documentclass{standalone}
\usepackage{unicode-math}

\begin{document}
\setmathfont{Asana Math} %(probably unrelated, but without this nothing will show up)

Spacing issues:
\begin{tabular}{cccccccc}
\setmathfont{Asana Math}
$α_1$ & $ω_a$ & $ωa$ & $ω_1$ & $ω^a$ & $\omega_1$ & $Ω_1$ & $λ_k$ \\
\setmathfont{XITS Math}
$α_1$ & $ω_a$ & $ωa$ & $ω_1$ & $ω^a$ & $\omega_1$ & $Ω_1$ & $λ_k$ \\
\end{tabular}

\end{document}

font issue with Asana Math

ω has a little problem with subscripts (and superscripts). Updated the font and unicode-math with the last versions available on CTAN, but the problem remains.

Any idea of what can cause this? Any workaround that won't require to spot every occurence of "ω_"?

1 Answers1

16

I'm pretty sure this is a font bug. As can be seen using FontForge, the anchor for bottom-right subscripts is too far away from the glyph (the anchor is the small dot on the baseline in the third panel):

Bottom right math kern

And the result is the same in Microsoft Word, which is the reference implementation for OpenType math:

MS Word with Asana Math

This "works" in XeTeX because XeTeX's OpenType math implementation is less sophisticated than the implementations of LuaTeX and MS Word: XeTeX simply ignores the math kern, therefore you (and presumably the creator of Asana Math) don't see the bug there.

Here is an example how to fix such bugs while loading fonts in LuaTeX. This simply removes the offending kern info (no kern seems to look ok, otherwise you can use any kern array you want):

\documentclass[pagesize=auto, version=last]{scrartcl}

\usepackage{unicode-math}
\usepackage{luacode}

\begin{luacode*}
local function patch_asana(fnt)
  if fnt.psname == "Asana-Math" then
    fnt.characters[0x1D714].mathkern.bottom_right = nil
  end
end
luatexbase.add_to_callback("luaotfload.patch_font", patch_asana, "patch_asana")
\end{luacode*}

\setmathfont{Asana Math}

\begin{document}

$\omega_a$

\end{document}
Philipp
  • 17,641