[Tex/LaTex] XeLaTeX: lost \perp in Cambria math

fontsmath-modeunicode-mathxetex

Occasionally I noted that Cambria Math fonts or the unicode-math package might have wrong definition of \perp math symbol. Attached picture shows that \perp is not printed properly while \bot is.

enter image description here

This test is produced by the following code.

\documentclass{article}
\usepackage{ifpdf,ifxetex}
\ifpdf
    \usepackage[utf8]{inputenc} % source file encoding
    \usepackage[T1]{fontenc} % cyrillic font encoding
\fi

\ifxetex
    \usepackage{fontspec}
        %\defaultfontfeatures{Mapping=tex-text}
        \setmainfont{Cambria}
    \usepackage[math-style=TeX]{unicode-math}
        \setmathfont{Cambria Math}
\fi
\begin{document}%
    \[
        p_{\perp}
        ,\qquad
        \vec{A} \perp \vec{B}
    \]
    \[
        p_{\bot}
        ,\qquad
        \vec{A} \bot \vec{B}
    \]
\end{document}

The missing character is reported in the log file:

Missing character: There is no вџ‚ in font Cambria Math/ICU:script=math;languag
e=DFLT;+ssty=0;!
Missing character: There is no вџ‚ in font Cambria Math/ICU:script=math;languag
e=DFLT;!
 [1]

This same file can be conditionally compiled with both xelatex and pdflatex just to check that standard fonts use same glyph to print both \bot and \perp. So, I guess that error may reside in the unicode-math package. Could somebody check is this guess correct?

I would also appreciate any advice how to redefine the \perp command to make it working for a while before the problem will be corrected by the font/package developers.

Best Answer

The character in question is U+27C2, which doesn't exist in Cambria Math. In this case you should use \mathrel\bot instead (the \mathrel is necessary to get the spacing right).

As a long-term solution we should implement fall-back characters in unicode-math. U+27C2 is intended for the perpendicular relation as indicated by Unicode; MathML, on the other hand, suggests to use U+22A5 for that purpose. Currently \perp is hard-wired to map to U+27C2, and \bot maps to U+22A5. The correct solution would be to have \perp map to U+22A5 if U+27C2 is not available. I'll add that to the issue tracker, but I have no time to look after it during the next couple of weeks.