import type { CjkWordBreak, Dimension, EmphasisStyle, ParagraphDropCap, ResolvedHeadingLevelConfig, ResolvedParagraphStyleConfig, TabStop, TextAlign } from '../types.js'; import type { ResolvedConfig } from '../vdt.js'; export interface BlockStyle { fontString: string; boldFontString?: string; italicFontString?: string; boldItalicFontString?: string; fontSizePx: number; lineHeightPx: number; color: string; boldColor?: string; italicColor?: string; /** Colour for inline `:ref` reference labels. */ referenceColor?: string; /** Whether reference labels render in the bold font. */ referenceBold?: boolean; /** Whether reference labels render italic. */ referenceItalic?: boolean; textAlign: TextAlign; hyphenate: boolean; /** Hyphenation zone (px) of a ragged block that hyphenates * (`bodyText.hyphenation.ragged`); unset for justified text and for * blocks that do not hyphenate. */ hyphenationZonePx?: number; marginTopPx: number; marginBottomPx: number; firstLineIndentPx: number; hangingIndent: boolean; /** The indent of every line but the first (px) when the style pairs a * first-line indent with a hanging one (#620): `firstLineIndentPx` is * then the first line's own and `hangingIndent` is on. Unset: with * `hangingIndent`, `firstLineIndentPx` is the hang and the first line * is not indented. */ hangingIndentPx?: number; /** Indent of every line (px) from the left edge of the column or box — * a paragraph style's `indent`; the first-line and hanging indents are * measured from it. Unset: none. */ indentPx?: number; /** Indent of every line (px) from the side lines end on — a paragraph * style's `endIndent` (地からN字上げ): the measure narrows by it, the * lines keep their start. Unset: none. */ endIndentPx?: number; /** A heading level's `lineSpan` (行取り, #424): the heading takes this * many body grid lines, its text centred in them, in place of its * margins (see `headingLineSpanBand`). Unset: the margins apply. */ lineSpan?: number; /** A heading level's `jidori` (字取り, #424): a one-line heading * narrower than this many of its own ems is spaced out evenly to that * width. Unset: no spacing. */ jidori?: number; /** Set the text in small capitals (a paragraph style's or a callout * body's `smallCaps`): every span is measured and painted so. */ smallCaps?: boolean; /** Set the text in capitals (a paragraph style's `textTransform: * 'uppercase'`): the block's text is upper-cased, length for length, * before it is measured. */ uppercase?: boolean; /** Tracking the style itself sets (px after every glyph; negative * tightens) — a heading level's or a paragraph style's `letterSpacing`. Measured on the rich * path and stamped on the block (`VDTBlock.letterSpacing`). Unset: none. */ letterSpacingPx?: number; /** How the style sets `*…*` when not in italics (`bodyText.emphasis`, * #376): its italic faces are then upright (`'color'`, `'overline'`) * or bold (`'bold'`), and `'overline'` draws a rule over the runs. * Unset: in italics. */ emphasis?: Exclude; /** Where the block's CJK lines break between characters (a paragraph * style's `wordBreak`). Unset: the document's `cjk.wordBreak`. */ cjkWordBreak?: CjkWordBreak; /** The block's tab stops and default interval (#622): a paragraph * style's, a callout body's or the body's (`bodyText.tabStops`), as * written; `measureContentBlock` resolves them. Unset: none. */ tabStops?: TabStop[]; tabInterval?: Dimension; /** A paragraph style's drop cap (#623), as written: the first paragraph * of a group in the style opens with it (every one with `each`). * `measureContentBlock` reads it. Unset: none. */ dropCap?: ParagraphDropCap; } /** The space under a paragraph that `paragraphSpacing` asks for (#1115): * `true` is one line (`lineHeightPx`, the baseline grid in the flow, the * box's leading in a box), `false` none, a length that length (`em` of * the text's size). A negative or unreadable length gives none. */ export declare function paragraphSpacingPx(spacing: boolean | Dimension | undefined, lineHeightPx: number, dpi: number, fontSizePx: number): number; export declare function resolveBodyStyle(resolved: ResolvedConfig): BlockStyle; export declare function resolveHeadingStyle(level: number, resolved: ResolvedConfig, /** The level config to use — a heading style's merged level (see * `headingLevelFor`) — instead of the plain level lookup. */ levelConfig?: ResolvedHeadingLevelConfig, /** Whether the heading carries a bold run (`**…**`, EF-122): its bold * faces then take the body's bold weight, or the level's own when it is * heavier. Without one they stay the level's face, so a heading with no * bold run keeps the font strings it always had. */ hasBold?: boolean): BlockStyle; export declare function resolveMathDisplayStyle(resolved: ResolvedConfig): BlockStyle; /** Block style for Markdown blockquotes (`> …`), from * `bodyText.blockquote` over the body's face, size, leading, alignment and * hyphenation: its colour (1.4's grey by default), italics (a `*…*` run * inside flips back to upright), the side indent every line takes * (`indentPx`) and the first-line indent measured from it (the body's * unless the blockquote names one). The body's bold, italic and * reference colours do not apply, as in postext 1.4. */ export declare function resolveBlockquoteStyle(resolved: ResolvedConfig): BlockStyle; /** Block style for paragraphs inside a `:::paragraphs{style="…"}` container. * Mirrors {@link resolveBodyStyle} (reference colours come from the body * text; the bold and italic colours too, unless the style sets its own) * with the style's own face, weights, slant, size, leading, alignment, * indents and small caps. A non-zero `hangingIndent` * turns into the measurer's hanging mode (lines 2+ indented; the first * line keeps a first-line indent the style sets itself, #620), and `indent` * shifts every line (`indentPx`); `spaceBetween` lands in * `marginBottomPx`, the same slot body `paragraphSpacing` uses, so the gap * flows through pending spacing and the grid snap like any other margin. */ export declare function resolveParagraphStyle(style: ResolvedParagraphStyleConfig, resolved: ResolvedConfig): BlockStyle; //# sourceMappingURL=styles.d.ts.map