/** * The Chinese and Japanese interlinear marks of a laid-out document (#193, * #421): emphasis dots (着重号, 傍点), the proper-name line (专名号), the * wavy book-title line (书名号甲式) and side lines (傍線), as * `VDTLine.marks` — primitives the renderers draw as they are — and the * leading checks of marks, ruby (#194) and kanbun marks (#430). * * The measurer flags the segments (`VDTLineSegment.cjkMarks`); the marks are * placed once the document is laid out, where the renderers paint each * segment ({@link segmentPositions}: alignment and the justified word * spaces of a line included), in the flow frame of the line. Dots are * centred on each character, spacing after it left out, and skip * punctuation and spaces; a line spans its run's characters, and where two * runs meet each end gives up an eighth of an em (clreq §5.6.1). A side * line runs on across every character of its run, punctuation and spaces * included. Marks sit against the characters' em box, centred on the * font's central axis, on the side they were given (`over`: above * horizontal text, right of vertical text): when dots and a line mark the * same text on one side, the line is nearer the text, and dots on the side * of a ruby reading go outside it (as CSS Text Decoration 3 sets them). */ import type { ContentWarning, VDTBlock, VDTDocument, VDTLine, VDTLineMark, VDTLineSegment } from './vdt.js'; import type { CjkRegion, ResolvedCjkConfig } from './types.js'; /** What a block contributes to its lines' painting. */ type BlockLike = Pick; /** * Where the renderers paint each segment of a line: its x (absolute, in * the flow frame) and the advance they give it — a word space of a * justified line its share of the slack, a centred or right-aligned line * shifted by its slack. Mirrors the line painters of the canvas, PDF and * HTML backends. */ export declare function segmentPositions(line: VDTLine, block: BlockLike): { xs: number[]; widths: number[]; }; /** The font a segment is painted in. */ export declare function segmentFont(seg: VDTLineSegment, block: BlockLike): string; /** What a vertical line's dots need to find its upright cells. */ interface VerticalMarks { region: CjkRegion; uprightDigits: number; } /** The marks of one line (see the module comment), relative to it; empty * when it has none. `color` is `cjk.annotationColor` (hex), if set; * `vertical` is set on a vertical page. */ export declare function lineMarks(line: VDTLine, block: BlockLike, color?: string, vertical?: VerticalMarks): VDTLineMark[]; /** * Set `VDTLine.marks` on every line of the document that holds Chinese * marks, and report the paragraphs whose line gap is narrower than their * marks, readings or kanbun marks need (`cjkMarksExceedLeading`, * `rubyExceedsLeading`, `kuntenExceedsLeading`), once per paragraph. `cjk` * is the resolved configuration (its `annotationColor`). * * The gap between two lines of a column is shared: what the upper line * sets under it and the lower one over it (dots under one line and the * readings over the next, in one paragraph or across two) must fit in it * together. Where they do not, the lower line's paragraph is reported * (`rubyExceedsLeading` when readings take part, `kuntenExceedsLeading` * when kanbun marks do, else `cjkMarksExceedLeading`). * * The cells, captions and notes of resource blocks (#429) are texts of * their own: their marks are set and their leading checked the same way, * each text's lines sharing their gaps only with one another (a table's * cells sit apart, a caption under its figure). A resource's text is set * horizontally on every page, a vertical one turning the whole block. */ export declare function annotateDocument(doc: VDTDocument, cjk: ResolvedCjkConfig | undefined): ContentWarning[]; export {}; //# sourceMappingURL=cjkMarks.d.ts.map