[XeTeX] Problems with thickness of \frac rule and width of accents (\hat) with XeLaTeX

Ulrik Vieth ulrik.vieth at arcor.de
Tue Aug 17 21:54:00 CEST 2010

On 08/17/2010 04:32 PM, Khaled Hosny wrote:
> Likely XeTeX does not check this parameter at all and resorts to some
> hard coded default rule thickness.

No, that cannot be the reason. I know for sure that XeTeX does load some 
(but not all) of the OpenType font parameters and maps them to TeX 
fontdimen parameters. I have seen that myself in the web2c sources:


However, I have now realized that the problem is caused by of a mismatch 
between the unicode-math LaTeX package and the XeTeX engine:

When LaTeX starts out, it has LM/CM fonts preloaded in families 0-3.
When unicode-math loads another OpenType math font with \setmathfont, it 
loads the font into a new family, e.g. family 4.

Now XeTeX's math engine still behaves very much like a traditional TeX,
which expects math font parameters to come from families 2 and 3,
e.g. rule thickness from \fontdimen8\textfont3 (xi_8 in Appendix G).

Now families 2 and 3 still contains unchanged TFM-based CM fonts with 
default parameters, so we get the default rule thickness of 0.4pt.

What would be needed, is to load the selected OpenType math font not 
just into a new family 4 (for access to the glyphs in unicode-math), but 
also into families 2-3 (for access to the font metric parameters).

Unfortunately, there seems to be a major conceptual difference between 
XeTeX and LuaTeX here with respect to font loading of OT math fonts, 
which cannot be resolved quickly without major changes to the engine.

The most feasible short-term solution probably would be to apply a 
XeTeX-specific workaround in the font loading code in unicode-math.

Regards, Ulrik.

P.S: The attached test file show a quick solution, which reassigns
the fonts in families 2 and 3 to the font loaded in family 4.

The first equation show the incorrect fraction rule thickness from CM 
and the second one the correct one from XITS Math.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.tex
Type: text/x-tex
Size: 671 bytes
Desc: not available
URL: <http://tug.org/pipermail/xetex/attachments/20100817/c05915eb/attachment.bin>

More information about the XeTeX mailing list