As I understand it, when TeX reads a glyph TeX puts the glyph into a character box. It pays attention the left sidebar and right sidebar, so negative sidebars are handled correctly (as are positive sidebars). The character box also has a baseline, which is picked up from the font and a depth and height which is picked up from the individual glyph.
How do I explicitly set the depth and height for a specific glyph? Here is a sample program that displays two similar glyphs with their surrounding box displayed. I want to set the depth and height of the box for a specific character or equivalently, enclose them in a box with specified width, depth and height allowing the ink to overflow.
\documentclass[10pt]{article}
\usepackage{unicode-math}
\setmainfont{STIX Two Text}[NFSSFamily=mainfont]
\setmathfont{STIX Two Math}[NFSSFamily=mathfont]
\usepackage{logix}
\usepackage[svgnames]{xcolor}
\setlength{\fboxsep}{0pt}
\setlength{\fboxrule}{0.05pt}
\begin{document}
\fbox{\color{green}\KntTSLABSLA} \fbox{\color{green}\KntLSUARSUA}
\end{document}
And here is the output (blown up 16x for clarity).
The containing box for the symbol on the left should be going down the middle of the arrows in the same manner as the symbol on the right. The containing box for the symbol on the right is too low on the bottom and too high on the top, it should be like the symbol on the left for the ends of the arrows.
This problem is not specific to a particular font. I used the glyphs which were convenient for illustration. Here is an example not using that font.
\documentclass[10pt]{article}
\usepackage{unicode-math}
\setmainfont{STIX Two Text}
\setmathfont{STIX Two Math}
\usepackage[svgnames]{xcolor}
\setlength{\fboxsep}{0pt}
\setlength{\fboxrule}{0.05pt}
\begin{document}
\fbox{\color{green}A} \fbox{\color{green}J}
\end{document}
and its output is
For this example, the height should be set to the middle of the cross bar in the "A" and the depth to the top of the hook in the "J". This is exactly the same problem, just different glyphs.
logix.sty
, nor does CTAN. No idea about\KntTSLABSLA
and\KntLSUARSUA
\fontcharht
and\fontchardp
), but in order to set them, I believe you would have to modify the font files (.tfm
for non-UTF-8 engines). You can always create macros that output glyphs and pretend they have different height and depth using\raisebox
, but I doubt this is what you are looking for.