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:


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

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


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 "ω_"?


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}


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

\setmathfont{Asana Math}



|improve this answer|||||
  • Thanks, I guess fontforge can be used to fix that easily? – Stéphane Gimenez Jul 27 '11 at 21:42
  • Perfect! I used .mathkern = nil to remove them all. I also tried to use fontforge, but couldn't find an automatic way to 'guess' mathkerns. Anyway, thanks again. – Stéphane Gimenez Jul 27 '11 at 22:45
  • 1
    @Stéphane: If guessing math kerns were so easy, we wouldn't need a way to do it manually ;-) Can you perhaps report the kerning bug to the author of Asana Math? – Philipp Jul 28 '11 at 8:50
  • Did you inform the package author of this bug, so it can be fixed? – Ingo Feb 15 '12 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.