Using unicode-math with LuaTeX. The font Fira Math is missing some glyphs that I use, notably the symbol for \bot
. I know that I can grab it from a different font:
\setmathfont[range={"022A5}]{DejaVu Math TeX Gyre}
but that bloats my PDF with yet another font. Alternatively, I can redefine the command \bot
:
\AtBeginDocument{\renewcommand{\bot}{\mathord{\perp}}}
but that's exactly the wrong level — a glyph substitution shouldn't require modifying TeX's input syntax. The obvious solution would be to perform the subsitution at the luaotfload level,
\directlua{
fonts.handlers.otf.addfeature {
name = "bottoperp",
type = "substitute",
data = {
[0x22A5] = {0x27C2},
},
}
}
\setmathfont{Fira Math}[RawFeature=+bottoperp]
but that appears to do nothing.
What is the right way to substitute a glyph with LuaTeX and unicode-math?
$x = \bot$
with$x = \perp$
. Redefining\bot
to{\perp}
works fine, due to the extra set of brackets, not sure if it will cause any other trouble. – jch Oct 24 '20 at 23:02