/** * Arabic vowel marks (ḥarakāt, tashkīl) in a laid-out document (#376). * * The marks a vocalised text carries (fatḥa, ḍamma, kasra, tanwīn, sukūn, * shadda, the dagger alef, the Qurʾānic annotation signs) stack over and * under the letters, so the ink of a vocalised line reaches far past the * letters' own ascenders and descenders: a shadda with a fatḥa over a lām * stands about 1.3 em above the baseline in Amiri, a kasra under a final yāʾ * hangs about 0.7 em under it. The line pitch never changes for them, as * for the Chinese marks (`cjkMarks.ts`): they live in the leading. Two * things follow from that. * * - The renderers clip each column to its box (`columnClipRect`). The * first line of a column may hold marks that rise above the column's top * and the last one marks that hang under its foot; the clip takes them * in. A line holding marks carries how far its ink reaches * (`VDTLine.markInk`), measured once here, so every renderer reads the * same extent without measuring (the PDF backend has no canvas). * - Where the marks of one line meet the ink of the line above or below, * the paragraph is reported (`arabicMarksExceedLeading`). Two lines are * compared word by word: a mark over a word of the lower line only * collides with what hangs under the words of the upper line standing * above it, which keeps tall marks on an alif from being reported against * a descender at the other end of the line. Ink boxes are what the * measurer gives (`TextMetrics.actualBoundingBox*`); without them (no * canvas metrics) a word's box is estimated from its size and from the * marks it holds. Two words whose boxes meet are painted and compared * pixel column by pixel column (`profileNeed`, #445): a box only says * how high a word's tallest mark rises and how low its deepest * descender hangs, wherever they stand along it, and fully vocalised * text set at its face's own line spacing has boxes that meet on * nearly every line while its ink never does. * * A document without vowel marks is looked at once per line (one regular * expression test) and left as it was. */ import type { ContentWarning, VDTBlock, VDTDocument, VDTLine } from './vdt.js'; import { segmentPositions } from './cjkMarks.js'; /** The combining marks of Arabic vocalisation and Qurʾānic annotation: * the honorific and Qurʾānic signs U+0610–U+061A, the ḥarakāt and their * extensions U+064B–U+065F, the superscript (dagger) alef U+0670, the * small high and low Qurʾānic marks U+06D6–U+06ED (the symbols and * letters among them left out: U+06DD end of āya, U+06DE rubʿ el-ḥizb, * U+06E5–U+06E6 small wāw and yāʾ, U+06E9 place of sajda), and the * extended Arabic marks U+08CA–U+08FF (U+08E2, a format character, left * out). */ export declare const ARABIC_MARK_RE: RegExp; /** Whether `text` holds an Arabic vowel or Qurʾānic mark. */ export declare function hasArabicMarks(text: string): boolean; /** How far a word's ink reaches above and below the baseline, px. */ interface Ink { ascent: number; descent: number; } /** The ink box of `text` set in `font`, px above and below the baseline: * measured, else estimated (see `ESTIMATE`). */ export declare function inkBoxOf(text: string, font: string): Ink; /** A word of a line: where it is painted along the line, its ink, and * whether it holds a vowel mark. */ interface WordInk { x0: number; x1: number; ascent: number; descent: number; marked: boolean; /** What is painted and in which font, and how far it is moved off the * baseline (up: positive), for its ink profile. */ text: string; font: string; shift: number; } type BlockLike = Parameters[1]; /** The words of a line with their ink, at the x the renderers paint them * (the flow order `VDTLine.order` followed when the line has one). Spaces, * formulas, chips and swatches hold no Arabic and are left out. */ export declare function lineWordInks(line: VDTLine, block: BlockLike): WordInk[]; /** * Set `VDTLine.markInk` on every line of the document that holds an * Arabic vowel mark, and report the paragraphs where those marks meet the * ink of a neighbouring line of their column (`arabicMarksExceedLeading`, * once per paragraph, on the lower line's paragraph). See the module * comment. */ export declare function annotateArabicMarks(doc: VDTDocument): ContentWarning[]; /** How far the vowel marks of a column's lines reach above `y0` (its top) * and below `y1` (its foot), px (`VDTLine.markInk`; 0 when they stay * inside). */ export declare function markInkOverhang(blocks: readonly VDTBlock[], y0: number, y1: number): [number, number]; export {}; //# sourceMappingURL=arabicMarks.d.ts.map