context-companion-fonts breaks xetex ability to resolve fonts by aliasing font names
Sergio Callegari
sergio.callegari at gmail.com
Thu Oct 31 19:58:52 CET 2024
Hi,
the fonts in the package context-companion-fonts end up breaking the
ability of xelatex to resolve fonts by name.
It is a bit difficult to understand what that package is for, since it
is not on ctan and it has no documentation.
For sure it contains fonts whose name aliases the name of some well
known and widely used fonts. For instance, the package contains the font
file `TeXGyreTermesMath-Companion.otf`. If you look into the latter,
with `otfinfo` you'll find the following information about it:
```
Family: TeX Gyre Termes Math Companion
Subfamily: Companion
Full name: TeXGyreTermesMath-Companion
PostScript name: TeXGyreTermesMath-Companion
Preferred family: TeX Gyre Termes Math
Preferred subfamily: Regular
Version: Version 0.1
Unique ID: FontForge : TeXGyreTermesMath-Companion : 15-11-2023
Trademark: Please refer to the Copyright section for the font
trademark attribution notices.
Copyright: Copyright 2023 CMS.
Vendor ID: PfEd
Permissions: Editable
```
In other words, the preferred family aliases that of
`texgyretermes-math.otf` that is the *standard* TeX Gyre Termes Math
font. With this, when a document tries to use the TeX Gyre Termes Math
font indicating it by name as in
```
\documentclass{article}
\usepackage{unicode-math}
\setmainfont{TeX Gyre Termes}
\setmathfont{TeX Gyre Termes Math}
\begin{document}
$x$
\end{document}
```
the engine ends up trying to load `TeXGyreTermesMath-Companion.otf`
rather than `texgyretermes-math.otf`.
Because `TeXGyreTermesMath-Companion.otf`, notwithstanding its name, is
not even a math font, the xetex engine fails and ends up using Latin
Modern Math.
Yes, the issue can be worked around by loading fonts by filename, but:
(i) loading by font name should work; and (ii) loading by font name is
way more practical and portable. In the end, that is why fonts have
their own name in an attribute list.
Most likely the fonts in the context-companion-fonts package are buggy
and the preferred family name should include the word "companion" to
avoid aliasing the standard fonts.
In addition to that, having the keyword "Math" in their name is quite
confusing to the users, since "Math" in the name is often used to
indicate the presence of the Math tables in otf fonts.
Not having any readme to indicate what those fonts are for is one more
issue.
It is my understanding that those fonts are for ConTeXt only. So they
should probably not be installed by default just because you select the
`fontsextra` collection. In fact, they break the possibility to proper
access other fonts if installed. May I suggest this font package is at
least moved in the `context` collection?
Thanks for the attention,
Sergio
More information about the tex-live
mailing list.