Next Up Previous Contents
Next: C Release notes
Up: Appendices
Previous: A Maths and SGML/HTML
[ID index]

B TEX dimensions

When producing this program, I became terribly confused about the variety of dimensions which appear in DVI and PK files. Table 1 is a summary of the sizes which appear, for the benefit of anyone else attempting a project like this. The reference [Dn] refers to section `n' of the webbed DVItype document and [Pn] to section `n' of the PktoPX document (see Section 5).

If you feel I have misunderstood something here, or got one of the conversion factors wrong (I hate these!), please correct me.

ContextDescriptionSee
DVI preamblenum, den: multiply a `DVI unit' by \mbox{num}/\mbox{den} to obtain a length in units of 10^{-7}\mathrm{m}[D17]
mag: DVI units are actually multiplied by (\mbox{num}\times\mbox{mag})/(1000\times\mbox{den})[D17]
DVI font definitiond: a design size, in DVI units. The nominal size of the font.[D18]
s: a `fixed point' scale factor, range 2^{27}>s>0, scaling d (see note).[D18]
PK preambleds: the font design size in units of 2^{-20} points.[P12]
hppp, vppp: number of pixels per point, times 2^{16} (see note).[P12]
Charactertfmwidth: the width of the character (see note).[D37], [P9]
w, h: the width and height, in pixels, of the character pixel map.[P21]
hoff and voff: offset of the pixel map from the reference point.[P21]
dm, dx, dy: the pixel escapements. dm in pixels, dx and dy in pixels times 2^{16} (see note).[P21]

Table 1

Sizes in TeX

  1. s scales the design size, so that a font is actually used at (\mbox{s}\times\mbox{mag})/(1000\times\mbox{d}) times its normal size.
  2. hppp and vppp aren't used as sizes, but can be used to check you have the right fonts by comparing resolution, etc..
  3. tfmwidth is the `physical' size of a character, and is the only size that TEX uses in its calculations, and which the DVI reader uses when working out how far to move the reference point when it sets a character. This is defined in [P9] to be in units of FIXes, where one FIX is 2^{-20} times the design size in points. [D37] describes how to multiply these widths by scaling factors without overflowing.
  4. The difference between the pixel escapements and tfmwidth is that the latter is a resolution-independent shift of the DVI reference point, and the former is the PK file's recommendation of the number of pixels the DVI processor should actually move. The DVI processor keeps track of the two reference points, and readjusts the pixel-based one when rounding errors move it too far from the resolution-independent one. See [D89] and [D91]; also [D40].

A few useful conversions are:


Next Up Previous Contents
Next: C Release notes
Up: Appendices
Previous: A Maths and SGML/HTML
[ID index]
Dvi2bitmap - convert DVI files to bitmap images
Starlink System Note 71
Norman Gray
14 June 1999. Release 0.9-6. Last updated 12 January 2001