/** The type of a printed sheet, in millimetres: `kid` is large and round for children, `normal` for everyone else. */ export interface SheetType { titleMm: number; nameMm: number; bodyMm: number; smallMm: number; /** The thickness of a sheet's own lines. */ lineMm: number; } /** The two type presets: the same sizes as kazoku-ui's `TYPE_PRESETS` (title, name, body and small in points, and the line in millimetres), checked against it by a test. */ export declare const TYPES: Readonly>; export type Lang = "en" | "ja"; export declare const n: (v: number) => string; export declare const esc: (text: string) => string; /** The width of a text in millimetres, estimated on the wide side so a fallback font still fits: a full-width character is as wide as the type is tall, a Latin capital or a digit 0.82 of it, a small letter 0.7 (DejaVu Sans Bold, the usual fallback on a server, is that wide), a percent sign or a wide capital (M, W) 1.0, a space or a stop 0.38. */ export declare function textWidth(text: string, sizeMm: number): number; /** Break a sentence into lines no wider than `maxMm`: at spaces for English; for Japanese after a space or a comma or a full stop (the words are written with spaces between), and anywhere only for a word wider than the line. */ export declare function wrap(text: string, maxMm: number, sizeMm: number): string[]; export declare const text: (x: number, y: number, size: number, body: string, extra?: string) => string; /** Lines of words one under the other, left aligned at `x`, the first baseline at `y`; the height they take is `lines * 1.3 * size`. */ export declare function paragraph(words: string, x: number, y: number, widthMm: number, sizeMm: number, extra?: string): { markup: string; height: number; }; export declare const svgOpen: (width: number, height: number, label: string, id: string) => string; /** Lines of words at the foot of a page: the last baseline sits `0.55` of a line above the edge, so the letters that hang below it still fit the room in a font taller than the sheet's own. */ export declare function footer(words: string, widthMm: number, heightMm: number, sizeMm: number, extra?: string): { markup: string; height: number; }; export type TypeName = "kid" | "normal"; /** The thickness of a sheet's outline in millimetres, and of the lines inside it (1 mm when the outline is kazoku-ui's kid line, 1.2 mm). */ export declare const outlineMm: (type: TypeName) => number; export declare const innerMm: (type: TypeName) => number; /** The size of the names written on a picture: 24 pt for a child (never less), else the normal name size. */ export declare const labelMm: (type: TypeName) => number; /** Text with a white edge so it reads over a line: the edge is painted first. */ export declare const haloText: (x: number, y: number, size: number, body: string, extra?: string, anchor?: "start" | "middle" | "end") => string; /** A name of one or more lines, centred on `x` with the middle of the block at `y`. */ export declare function nameBlock(lines: readonly string[], x: number, y: number, size: number, extra?: string): { markup: string; width: number; height: number; }; export interface Block { markup: string; height: number; } /** The facts as numbered dots and lines of words, one under the other, `width` wide, the first at `y`. */ export declare function factsBlock(list: readonly string[], width: number, y: number, type?: TypeName): Block;