Table of Contents

Field MaxMeasure

Namespace
DocWright.Core.Primitives
Assembly
DocWright.Core.dll

The largest magnitude, in twips, that a measure read out of a document may carry: 2^24 twips, or about 291 feet.

public const int MaxMeasure = 16777216

Returns

int
The largest magnitude, in twips, that a measure read out of a document may carry: 2^24 twips, or about 291 feet.

Remarks

Why a bound is needed at all. Layout arithmetic on this type is checked, which is correct — a silently wrapped length would be a wrong document rather than a rejected one. But the operands come from the file, and no file format bounds them: ECMA-376's ST_SignedTwipsMeasure is xsd:integer. So a single attribute set to 2147483647 makes the very first addition in the layout engine throw OverflowException, which is neither a document error a caller can act on nor a member of the library's exception taxonomy.

Why this particular value. It is derived, not fitted. Layout sums a bounded number of measures — a margin plus an indent plus a border plus a cell margin and so on — and 2^24 leaves 2^7 headroom before a sum of them can leave int. So any expression combining up to 127 clamped measures is representable by construction, which is what makes the checked operators safe rather than merely loud. It is also about 370 times the largest page Word supports (22 inches), so no real document can reach it and no measurement is being fitted to a corpus.

Readers clamp to this range at the parse boundary — the same thing Word does with its own narrower per-attribute limits — and report a diagnostic when they do.