Closed RuixiZhang42 closed 9 months ago
Perhaps the two “rule thickness” entries should be changed to 50
from the current 66
.
According to Microsoft's OpenType specification, these constants are defined as:
overbarVerticalGap
Distance between the overbar and the (ink) top of he base. Suggested: 3 × default rule thickness.overbarRuleThickness
Thickness of overbar. Suggested: default rule thickness.overbarExtraAscender
Extra white space reserved above the overbar. Suggested: default rule thickness.The default rule thickness of fira math regular is 66. But I'm not sure whether the other constants should be changed. Still, I need to investigate it thoroughly.
There are definitely something not quite right in the math table. I managed to find two three more:
FractionRuleThickness
and RadicalRuleThickness
are set to 76
, while OverbarRuleThickness
and UnderbarRuleThickness
are 66
, although all of them are recommended to be set as the default rule thickness.
As FontForge's documentation says,
These values are stored in tfm files (should you generate a tfm file with your font).
So I think these TeX info has nothing to do with the OpenType MATH table, and hence simply leave them as the default values.
I just found out about the excellent papers by Bogusław Jackowski and Ulrik Vieth, where the authors illustrated Appendix G with drawings and discussed how to set various math font dimensions.
The resources include papers and slides, so I will provide a link that already has them gathered. They can be found at http://www.gust.org.pl/projects/e-foundry/math/index_html starting from “In the preparation for providing math typesetting support with the TeX Gyre fonts”
@RuixiZhang42 Even after going through that, I'm still at a loss as to how to have a thinner \overline that's a bit closer to the top of a number in Fira Math + XeTeX.
@ppw0 You can try something like this (no recommended unless you know what you are doing):
% only works with XeLaTeX + unicode-math (actually fontspec)
\setmathfont{Fira Math}[
FontAdjustment = { % <- a secret option (undocumented)
\fontdimen 53 \font = 0.75 \fontdimen 53 \font % <- reduce OverbarVerticalGap to 75% of its original
\fontdimen 54 \font = 0.5 \fontdimen 54 \font % <- reduce OverbarRuleThickness to 50% of its original
\fontdimen 55 \font = ...
% you will probably want to change underbar as well:
\fontdimen 56 \font = ...
\fontdimen 57 \font = ...
\fontdimen 58 \font = ...
}
]
Related TeX.SX posts:
\overline
object.LuaTeX correctly implements
\Umathoverbarkern
,\Umathoverbarrule
and\Umathoverbarvgap
to construct an\overline
object. However, XeTeX fails to use\fontdimen55
,\fontdimen54
and\fontdimen53
.In my experiment, it seems that XeTeX uses
\fontdimen54
,\fontdimen54
and3\fontdimen54
forkern
,rule
andvgap
, respectively, according to most other OpenType math fonts. But this conjecture fails for Fira Math:XeLaTeX output:
With LuaLaTeX, everything lines up perfectly no matter which math font is used.
Font issue v.s. engine issue
I think it is rather clear that the XeTeX engine still implements the wrong math font dimensions. However, even with the “wrong” dimensions used, all TeX Gyre Math fonts as well as Latin Modern Math pass the above test (did not test STIX2 or XITS yet).
This suggests maybe there is something wrong with Fira Math, but I honestly do not know.