/** * Chinese and Japanese inline annotations before measurement (#193, #194, * #195, #421): what the configuration makes of the spans the parser * marked, on every text the layout measures as a block. * * - `cjk.emphasis: 'dots'`: the Chinese and Japanese characters of `*…*` * lose their italics and take emphasis dots; Latin letters in the same * emphasis keep the italics. * - `cjk.emphasisMark`: what an emphasis mark leaves unset (`:dots[…]` * without `style`, `*…*`) takes the configured or regional shape, fill * and side (the sesame over the text in Japan). * - `cjk.bookTitleMark`: `'brackets'` adds the `cjk.bookTitleBrackets` * (《》 and 〈〉 nested; 『』 and 「」 in Japan) around each `:book[…]` * title as text the lines are broken with (spans flagged `inserted`, * which take no character of the plain text); `'wavy'` keeps the * title's run for the wavy line; `'none'` drops it. * - Ruby readings and warichu notes get their font (at their size, in the * text's face unless `cjk.ruby.fontFamily` names one) and colour; a note * gets the brackets `cjk.warichu` gives it unless it names its own. In * Japan (and where `cjk.ruby` asks for them) readings also take their * overhang and alignment rules, and a reading per character of a word * becomes a jukugo ruby (#422). * - Kanbun marks (`:kunten[…]`, #430) get their font (`cjk.kunten.fontSize` * in the text's face), colour and placement. * * Spans without any of these marks pass through untouched (the same * array), so text without them measures and caches as before. */ import type { InlineSpan } from '../parse/index.js'; import type { ResolvedCjkConfig } from '../types.js'; /** What annotation resolution needs. */ export interface AnnotationContext { cjk: ResolvedCjkConfig; dpi: number; /** The text's font (CSS shorthand) and size. */ fontString: string; fontSizePx: number; } /** `font` at `sizePx`, its style, weight and family kept. */ export declare function fontAtSize(font: string, sizePx: number): string; /** Whether a span list holds anything {@link resolveAnnotationSpans} * changes under `cjk`. */ export declare function hasAnnotations(spans: readonly InlineSpan[], cjk: ResolvedCjkConfig): boolean; /** * A block's text and spans with the 《》 of its book titles in them, when * they are the document's book-title mark (`cjk.bookTitleMark: * 'brackets'`): for what reads a heading from its source rather than from * its lines (contents rows, bookmarks). The brackets are spans flagged * `inserted` (they may be there already: a heading set plain). The same * text and spans otherwise, and when the spans do not spell the text. */ export declare function withBookTitleBrackets(text: string, spans: readonly InlineSpan[], cjk: Pick): { text: string; spans: readonly InlineSpan[]; }; /** Book titles as `cjk.bookTitleMark` sets them, for a text measured * outside the paragraph path (an index entry): brackets added (《》, 『』 * in Japan), the titles left for the wavy line, or plain. The same array * when nothing changes. */ export declare function bookTitlesAsConfigured(spans: InlineSpan[], cjk: Pick): InlineSpan[]; /** * The spans as the configuration sets them (see the module comment). The * same array when nothing changes. */ export declare function resolveAnnotationSpans(spans: InlineSpan[], ctx: AnnotationContext): InlineSpan[]; //# sourceMappingURL=annotations.d.ts.map