[XeTeX] Monospace font, not being set in monospace

Jonathan Kew jfkthame at googlemail.com
Wed Sep 29 22:26:41 CEST 2010


On 29 Sep 2010, at 04:39, mskala at ansuz.sooke.bc.ca wrote:

> I'd like to use the commercial font "Pro Typewriter Underwood," from
> http://www.vintagetype.com/, with XeLaTeX, to produce a close
> approximation of old-style typewriter output.  But I can't get it to
> correctly recognize that the font is a monospace font for the purposes of
> inter-sentence spacing.  "Word" spaces come out to the same width as
> non-space characters, as they should.  But each "sentence" space comes out
> to about 1.35 times the width of a "word" space or non-space character,
> when it should be exactly 2.  As a result, the text no longer fits the
> grid, and the purpose of using a monospace font is defeated.

You need to set the \fontdimen parameters appropriately - in particular, the "extra space" paramenter. When xetex loads a (non-TFM, i.e. TrueType or OpenType) font, it chooses defaults based on the width of the space character, as these parameters are not explicitly present in the fonts; these generally work pretty well for normal text fonts, but they're not designed for monospaced use.

I think fontspec may have options to control this, so you don't have to resort to low-level TeX commands after loading the font; look into the WordSpace and PunctuationSpace options.

JK




More information about the XeTeX mailing list