Expand description
Printed pages from the document’s template: a cover, the parts list, the tools list, then the steps at 1, 2 or 4 per page, portrait or landscape.
Everything is in paper millimetres from the page’s top-left corner. The
layout only says WHERE each thing goes; the renderer draws the step’s view
into a slot’s picture and its text into text.
A step’s Record block (crate::record: its fields as a paper form, a
serial line per serial-tracked unit, the sign-off lines) goes under the
step’s text. Its height is known here, measured through a
TextMeasure, so the paging accounts for it: a step with a block may
take more of a tall cell from its picture (down to PICTURE_MIN_SHARE
of the cell and PICTURE_MIN_MM),
and what still does not fit continues on Record pages right after the
steps page, never over the picture and never cut off. A document whose
steps record nothing and need no sign-off lays out exactly as before.
Structs§
- Estimate
- A measure for a caller without font metrics (a page count on a server, a test): every character half an em wide, the em 1.39 cap heights. Close to a sans-serif’s average; a renderer passes its own.
- Page
- Record
Row - One band of a step’s Record block, placed: the item it belongs to, which
of the item’s bands it is, and where it goes. The renderer draws
record::bandsof the item atrect.wand takes bandband. - Rect
- Slot
- One step’s place on a page.
Enums§
Constants§
- BODY_MM
- Body text’s cap height, in millimetres.
- GUTTER_
MM - HEADER_
MM - The band at the top of every page: document title and page number.
- HEADING_
MM - A heading’s cap height.
- LEADING
- Line pitch over cap height.
- MARGIN_
MM - PAPER_
SIZES - Paper sizes in millimetres, landscape (the same keys and sizes as drawing sheets; portrait swaps them).
- PARTS_
ROW_ MM - PICTURE_
MIN_ MM - PICTURE_
MIN_ SHARE - What the picture of a step with a Record block keeps when the text area
grows into it: this share of the cell’s height, and never less than
PICTURE_MIN_MM(a picture smaller than that says little). - RECORD_
COLUMN_ MM - The widest a Record page’s column is: a line longer than this is hard to write along.
- TEXT_
INSET_ MM - The inset of a step’s text inside its text area.
- TEXT_
SHARE - The share of a tall cell the text area takes.
- TOOLS_
ROW_ MM
Traits§
- Text
Measure - How wide a run of text is on paper: the renderer’s font metrics, so the layout and the drawing agree.
Functions§
- pages
- The block’s pages, in print order, measured with
Estimate: for a caller without font metrics. A renderer callspages_withwith its own measure, so its pages are the ones it draws. - pages_
with - The block’s pages, in print order, text measured by
m. - paper_
mm - A paper key’s millimetres in
orientation. - step_
text - What a step’s text area says, top to bottom, wrapped to
width: its number and title, the parts it adds, its tools and torque, its callouts and its notes. - step_
text_ height - The height of
step_text: trailing space not counted. - wrap
textbroken into lines no wider thanwidthat cap heightcap, at spaces; a word wider than the line stands alone on one.