I have been sent an updated set of fonts from a professionally developed OTF typeface which I am trying to use with plain XeTeX.
When using them with XeTeX, I could not get the OpenType features to work, even most basic ones like +liga, although it seems that they are present. I have subsequently solved the problem (see at the end) by adding :script=DFLT, but I am still not sure how to debug this since I found the solution by trial-and-error.
The problem was, for example:
\font\rm"New Font" at 12pt \rm Office \bye
Produced “Office” without the ffi ligature whilst:
\font\rm"Old Font" at 12pt \rm Office \bye
Produced Oﬃce with the ligature. Other features (e.g. +smcp, +ornm, +hlig) work with other fonts but not the New Font (e.g.
\font\rm"Old Font:+smcp" at 12pt gives me small caps,
\font\rm"New Font:+smcp" at 12pt does not).
If I try
otfinfo -f newfont.otf
c2sc Small Capitals From Capitals dlig Discretionary Ligatures dnom Denominators frac Fractions hist Historical Forms hlig Historical Ligatures liga Standard Ligatures lnum Lining Figures medi Medial Forms [etc.]
So I know those features are present in the font.
I have also opened up the font with fontforge and checked the ffi substitution is there: it is.
Comparing the Old Font and the New Font, in addition to differences to the shapes of the glyphs, I notice that the new font is OS/2 Version 3 not 2. Would that make a difference? Also, I notice that there are more substitutions in the New Font (20 not 18); they appear in a different order (with +c2sm first); there are two +frac substitutions; and there is a Single Substitution related to the +frac substitution. Could any of these be causing XeTeX to choke?
Finally, if I use abiword, it carries out the ffi substitution, as well as a few less common substitutions such as Th which are present in the font as +liga.
There are no errors from XeTeX.
Could anyone advise how I might debug this problem and see what XeTeX does not like?
After some deep reading of the XeTeX Reference Guide and going through the font options one by one, I eventually found that specifying the script language solved the problem:
\font\rm"New Font:script=DFLT" at 12pt \rm Office \bye
I am, however, still unsure why XeTeX seems not to like this font. I would have thought the DFLT scripts would be read by default... I am also not sure how to properly debug this.