Next: , Previous: , Up: GNU troff Reference   [Contents][Index]


5.3 Measurements

A roff document sometimes requires the input of numeric parameters to specify measurements. Express them as integers or decimal fractions with an optional scaling unit suffixed. A scaling unit is a letter that immediately follows the magnitude of a measurement. Digits after the decimal point are optional. Examples of measurements include ‘10.5p’, ‘11i’, ‘.5f’, and ‘3.c’.

The formatter scales measurements by the specified scaling unit, storing them internally (with any fractional part discarded) in basic units. The device resolution can therefore be obtained by storing a value of ‘1i’ to a register, then reading the register.

u

Basic unit; it is at least as small as any other unit.

i

Inch; defined as 2.54 centimeters.

c

Centimeter; a centimeter is about 0.3937 inches.

p

Point; a typesetter’s unit used for measuring type size. There are 72 points to an inch.

P

Pica; another typesetter’s unit. There are 6 picas to an inch and 12 points to a pica.

s

Scaled point; see Using Fractional Type Sizes.

z

Typographical point; like p, but used only with type sizes, to overcome a limitation of AT&T troff; see Using Fractional Type Sizes.

f

GNU troff defines this unit to scale decimal fractions in the interval [0, 1] to 16-bit unsigned integers. It multiplies a quantity by 65,536. See Colors, for usage.

The magnitudes of other scaling units depend on the text formatting parameters in effect. These are useful when specifying measurements that need to scale with the typeface or vertical spacing.

m

Em; an em is equal to the current type size in points. It is named thus because it is approximately the width of the letter ‘M’.

n

En; on typesetters, an en is one-half em, but on terminals an en equals an em, because they align all text to a grid of character cells.

v

Vee; recall Page Geometry.

M

Hundredth of an em.


Next: , Previous: , Up: GNU troff Reference   [Contents][Index]