[XeTeX] Why do I get small caps/random font?

Jonathan Kew jonathan_kew at sil.org
Mon Jun 5 13:25:25 CEST 2006


On 5 Jun 2006, at 2:42 am, Mojca Miklavec wrote:

> Hello,
>
> I'm a bit confused. I installed the whole Latin Modern font family,
> but when I try to use
>     \font\A='Latin Modern Roman' \A
> I get lmroman10-capsregular.otf.
>
> And if I use
>     \font\A='Latin Modern Roman/B' \A
> the font lmroman5-bold.otf is used.
>
> The behaviour seems completely random. Should I only be more precise
> when specifying the font names or is there a way to influence that
> randomness?

The problem is that "Latin Modern Roman" is a family name shared by  
dozens of LM fonts. If you don't specify anything more precise, xetex  
is supposed to try and use "the regular face" from that family. But  
it has a hard time identifying which of all the "Latin Modern Roman"  
fonts is the one you really want. And things are further confused by  
the fact that OpenType fonts may have multiple family and style names.

Looking at lmroman10-regular.otf, for example, I see that it has  
family names "LMRoman10 Regular" and "Latin Modern Roman", and style  
names "Regular" and "Regular 10". Comparing lmroman10- 
capsregular.otf, I see family "LMRomanCaps10" and "Latin Modern  
Roman", and style "Regular" and "Caps Regular 10".

So if you ask for "Latin Modern Roman", which exists as an OpenType  
family name, xetex could quite reasonably find either of these as a  
"Regular" face -- they both have a style name "Regular". If xetex  
were to restrict itself to the "OpenType style name", as FontLab  
calls it, then neither would match; but if it accepts the "legacy"  
style names as well (which it does), then either one can be  
considered a "Regular" style.

And that's before we even start to consider the other design sizes,  
which will also have "Latin Modern Roman" as one of their family  
names, and "Regular" as one of their style names!

If an OpenType 'size' (optical size) feature gets added to LM, that  
will help somewhat, as then xetex will be able to choose among the  
different design sizes. And in that case, perhaps the size can be  
removed from the OpenType style names. Merging the small caps into  
the normal font (and accessing the small caps as an OpenType feature)  
would also help.

For now, though, your best option is to use more specific names (I'm  
not sure precisely what xetex will find, but something like
	\font\A="Latin Modern Roman-Regular 10"
(using the full OpenType family and style) would probably work, or
	\font\A="LMRoman10 Regular"
(using the more specific short family name).

It's confusing, I know!

JK



More information about the XeTeX mailing list