@weasel-js/text 1.7.0 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/textStyle.ts","../src/layout/decorationMetrics.ts","../src/layout/lineBreak/lineBreakTable.ts","../src/layout/lineBreak/lineBreaks.ts","../src/measure/graphemes.ts","../src/layout/lineBreak/wrapLines.ts","../src/layout/layoutRuns.ts","../src/layout/layoutCache.ts"],"names":["lineBreakPropsOf","CLASS_MASK","EAST_ASIAN","PICTOGRAPHIC_CN","BK","CR","LF","NL","SP","ZW","ZWJ","CM","WJ","GL","BA","BB","B2","HY","CB","CL","CP","EX","IN","NS","OP","QU","IS","NU","PO","PR","SY","AL","HL","ID","EB","EM","H2","H3","JL","JV","JT","RI","AK","AP","AS","VF","VI","QU_PI","QU_PF","resolved","kerningBefore","span","group","strokeKey"],"mappings":";;;;;;;;AAoCO,SAAS,YAAA,CACd,OACA,SAAA,EAC6B;AAC7B,EAAA,IAAI,UAAU,OAAA,IAAW,KAAA,KAAU,WAAW,OAAO,SAAA,KAAc,QAAQ,OAAA,GAAU,MAAA;AACrF,EAAA,IAAI,KAAA,KAAU,KAAA,EAAO,OAAO,SAAA,KAAc,QAAQ,MAAA,GAAS,OAAA;AAC3D,EAAA,OAAO,KAAA;AACT;AAiGA,IAAM,YAAA,GAA0B,EAAE,IAAA,EAAM,OAAA,EAAS,OAAO,MAAA,EAAO;AAE/D,SAAS,WAAW,CAAA,EAA6B;AAC/C,EAAA,OAAO,CAAA,KAAM,IAAA,IAAQ,OAAA,IAAW,CAAA,GAAI,EAAE,KAAA,GAAQ,MAAA;AAChD;AAMA,SAAS,2BAA2B,SAAA,EAA2B;AAC7D,EAAA,OAAO,sBAAsB,SAAS,CAAA,kBAAA,CAAA;AACxC;AAGO,IAAM,kBAAA,GAAwC;AAAA,EACnD,QAAA,EAAU,EAAA;AAAA,EACV,UAAA,EAAY,YAAA;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ose` and friends. Every field is optional; consumers\n * pass `{}` or override the few they care about. Defaults live in\n * `DEFAULT_TEXT_STYLE` and are applied at render/measure time, never written\n * back to the pose.\n *\n * Paint is not typography and does not live here. A text node carries its\n * fill and stroke in `data.fill` / `data.stroke`, the slots every other node\n * kind uses; `resolveTextStyle` takes them as its second argument and\n * `StyledRun.fill` / `.stroke` override them per range.\n */\n\nimport type { FillStyle, ScreenLength, Stroke } from '@weasel-js/paint';\nimport { resolveScreenLength } from '@weasel-js/paint';\nimport type { TextTransform } from './runs/textTransform';\nimport type { FontVariantCaps } from './runs/smallCaps';\n\n/**\n * Horizontal alignment. `start` / `end` resolve against the reading direction;\n * `left` / `right` are absolute. `justify` spreads every wrapped line across\n * the box by widening its word gaps, and sets a paragraph's last line at the\n * start edge. The same values as CSS `text-align`, with the same meanings.\n */\nexport type TextAlign = 'left' | 'center' | 'right' | 'start' | 'end' | 'justify';\n\n/** Reading direction, which is what gives `start` / `end` their meaning. */\nexport type TextDirection = 'ltr' | 'rtl';\n\n/**\n * Collapse a possibly reading-order-relative alignment to an absolute edge.\n *\n * Layout works in absolute edges, so this runs once at its entry and `start` /\n * `end` never reach the geometry. `justify` collapses to the start edge, which\n * is where it sets every line it does not spread; whether to spread is carried\n * separately, as `LayoutRunsOpts.justify`.\n */\nexport function resolveAlign(\n align: TextAlign,\n direction: TextDirection,\n): 'left' | 'center' | 'right' {\n if (align === 'start' || align === 'justify') return direction === 'rtl' ? 'right' : 'left';\n if (align === 'end') return direction === 'rtl' ? 'left' : 'right';\n return align;\n}\n\n/** User-facing text style. All fields optional; defaults applied at render time via `resolveTextStyle`. */\nexport interface TextStyle {\n /**\n * World units, or `{ px }` for screen pixels — resolved against the view\n * scale passed to {@link resolveTextStyle}, so a label pinned this way\n * stays the same size on screen as the view zooms. Default 16.\n */\n fontSize?: ScreenLength;\n /** Default `'sans-serif'`. */\n fontFamily?: string;\n /** Default 400. */\n fontWeight?: number | string;\n /** Default `'normal'`. */\n fontStyle?: 'normal' | 'italic';\n /** Default `'left'`. Pass `'start'` to align by reading order instead. */\n align?: TextAlign;\n /** Reading direction, resolving `align: 'start' | 'end'`. Default `'ltr'`. */\n direction?: TextDirection;\n /** Multiplier applied to `fontSize`. Default 1.2. */\n lineHeight?: number;\n /**\n * Break lines where they would pass the box width, at the break\n * opportunities of Unicode's line breaking algorithm (UAX #14) — between\n * words, after a hyphen, between CJK characters. Default\n * `false`: a line runs as long as its text, and the box width only resolves\n * `align`. A word longer than the box is never broken.\n */\n wrap?: boolean;\n /**\n * Caret color used by the edit overlay. Defaults to the node's fill when\n * that fill is solid; falls back to `#000` for non-solid paints.\n */\n caretColor?: string;\n /**\n * Selection background color used by the edit overlay's `::selection`\n * pseudo-element. Defaults to a 25%-opacity tint of `caretColor` via CSS\n * `color-mix`. Pass `'none'` to fall back to the browser-native highlight.\n */\n selectionBackground?: string;\n /** Selection text color paired with `selectionBackground`. Default: inherits text color. */\n selectionColor?: string;\n /** Extra advance added after each glyph. World units, or `{ px }` for\n * screen pixels, like {@link TextStyle.fontSize}. Default 0. */\n letterSpacing?: ScreenLength;\n /** Default `false`. */\n underline?: boolean;\n /** Default `false`. */\n strikethrough?: boolean;\n /** Default `false`. */\n overline?: boolean;\n /** CSS `text-transform` for display; the text itself is not rewritten.\n * Default `'none'`. */\n textTransform?: TextTransform;\n /** `'small-caps'` draws lowercase as smaller capitals; the text itself is\n * not rewritten. Default `'normal'`. */\n fontVariantCaps?: FontVariantCaps;\n /**\n * Set the node's text as a superscript or subscript — the default every run\n * inherits, exactly as a run's own `StyledRun.script` is for that run. The\n * lines keep the height and baseline the unscripted text would have had.\n * Absent is ordinary text.\n */\n script?: 'super' | 'sub';\n}\n\n/** `TextStyle` with all fields filled in from defaults — what the renderer actually consumes. */\nexport interface ResolvedTextStyle {\n fontSize: number;\n fontFamily: string;\n fontWeight: number | string;\n fontStyle: 'normal' | 'italic';\n /** Still relative if the author wrote it that way — `direction` resolves it. */\n align: TextAlign;\n direction: TextDirection;\n lineHeight: number;\n wrap: boolean;\n /** `null` is an explicit no-fill, the way it is on every other node kind:\n * outline-only text, painted by its stroke alone. */\n fill: FillStyle | null;\n caretColor: string;\n selectionBackground: string | null;\n selectionColor: string | null;\n letterSpacing: number;\n underline: boolean;\n strikethrough: boolean;\n overline: boolean;\n textTransform: TextTransform;\n fontVariantCaps: FontVariantCaps;\n /** Absent is ordinary text. */\n script?: 'super' | 'sub';\n /** Absent means no outline — unlike the other fields, this one has no\n * default to fall back to. See {@link TextPaint.stroke}. */\n stroke?: Stroke;\n}\n\nconst DEFAULT_FILL: FillStyle = { fill: 'solid', color: '#000' };\n\nfunction paintColor(p: FillStyle | null): string {\n return p !== null && 'color' in p ? p.color : '#000';\n}\n\n/**\n * Default selection background derived from `textColor` — a 25% tint via\n * CSS `color-mix`. Caller passes `'none'` to opt out.\n */\nfunction defaultSelectionBackground(textColor: string): string {\n return `color-mix(in srgb, ${textColor} 25%, transparent)`;\n}\n\n/** Default resolved style used when a `TextPose` omits `style`. */\nexport const DEFAULT_TEXT_STYLE: ResolvedTextStyle = {\n fontSize: 16,\n fontFamily: 'sans-serif',\n fontWeight: 400,\n fontStyle: 'normal',\n align: 'left',\n direction: 'ltr',\n lineHeight: 1.2,\n wrap: false,\n fill: DEFAULT_FILL,\n caretColor: paintColor(DEFAULT_FILL),\n selectionBackground: defaultSelectionBackground(paintColor(DEFAULT_FILL)),\n selectionColor: null,\n letterSpacing: 0,\n underline: false,\n strikethrough: false,\n overline: false,\n textTransform: 'none',\n fontVariantCaps: 'normal',\n};\n\n/**\n * The paint a text node hands its glyphs — `data.fill` and `data.stroke`,\n * read straight off the node. Runs inherit these when they name none of\n * their own.\n */\nexport interface TextPaint {\n /** `null` is an explicit no-fill and absent takes the default black — the\n * reading every other node kind gives `data.fill`. Unfilled text paints\n * through its stroke and nothing else, so it needs one to be visible. */\n fill?: FillStyle | null;\n /**\n * Outline painted over the glyph fill. Absent means no outline — there is\n * no such thing as a default text stroke.\n *\n * Only glyphs on the outline tier are stroked: above\n * `textOutlineMinScreenSize` a glyph is a real `PolygonPath`, so it gets\n * the ordinary tessellated ribbon with real joins, caps and miters, in any\n * paint. Below it a glyph is a sampled distance field with no geometry to\n * stroke, and it renders unstroked rather than approximated. `width` is in\n * world units, like every other stroke in the kit — it does not scale with\n * `fontSize`.\n */\n stroke?: Stroke | null;\n}\n\n/**\n * Fill in a partial `TextStyle` with defaults from `DEFAULT_TEXT_STYLE`,\n * taking the glyph paint from the node rather than from the style.\n *\n * `scale` is the view scale any `{ px }` size resolves against — the same\n * mean-of-the-axes factor `resolveStrokeWidth` takes. It has to be applied\n * here, at the entry to layout, rather than at draw time: a screen-pixel size\n * changes the glyph advances, the wrap points and the measured bounds, and\n * everything downstream of `ResolvedTextStyle` reads a plain world number.\n */\nexport function resolveTextStyle(\n style?: TextStyle,\n paint?: TextPaint,\n scale = 1,\n): ResolvedTextStyle {\n const fill = paint?.fill === undefined ? DEFAULT_TEXT_STYLE.fill : paint.fill;\n const stroke = paint?.stroke ?? undefined;\n if (!style) {\n return fill === DEFAULT_TEXT_STYLE.fill && stroke === undefined\n ? DEFAULT_TEXT_STYLE\n : {\n ...DEFAULT_TEXT_STYLE,\n fill,\n caretColor: paintColor(fill),\n selectionBackground: defaultSelectionBackground(paintColor(fill)),\n ...(stroke !== undefined ? { stroke } : {}),\n };\n }\n const caretColor = style.caretColor ?? paintColor(fill);\n let selectionBackground: string | null;\n if (style.selectionBackground === 'none') {\n selectionBackground = null;\n } else if (style.selectionBackground != null) {\n selectionBackground = style.selectionBackground;\n } else {\n selectionBackground = defaultSelectionBackground(caretColor);\n }\n return {\n fontSize: resolveScreenLength(style.fontSize ?? DEFAULT_TEXT_STYLE.fontSize, scale),\n fontFamily: style.fontFamily ?? DEFAULT_TEXT_STYLE.fontFamily,\n fontWeight: style.fontWeight ?? DEFAULT_TEXT_STYLE.fontWeight,\n fontStyle: style.fontStyle ?? DEFAULT_TEXT_STYLE.fontStyle,\n align: style.align ?? DEFAULT_TEXT_STYLE.align,\n direction: style.direction ?? DEFAULT_TEXT_STYLE.direction,\n lineHeight: style.lineHeight ?? DEFAULT_TEXT_STYLE.lineHeight,\n wrap: style.wrap ?? DEFAULT_TEXT_STYLE.wrap,\n fill,\n caretColor,\n selectionBackground,\n selectionColor: style.selectionColor ?? null,\n letterSpacing: resolveScreenLength(style.letterSpacing ?? DEFAULT_TEXT_STYLE.letterSpacing, scale),\n underline: style.underline ?? DEFAULT_TEXT_STYLE.underline,\n strikethrough: style.strikethrough ?? DEFAULT_TEXT_STYLE.strikethrough,\n overline: style.overline ?? DEFAULT_TEXT_STYLE.overline,\n textTransform: style.textTransform ?? DEFAULT_TEXT_STYLE.textTransform,\n fontVariantCaps: style.fontVariantCaps ?? DEFAULT_TEXT_STYLE.fontVariantCaps,\n ...(style.script !== undefined ? { script: style.script } : {}),\n ...(stroke !== undefined ? { stroke } : {}),\n };\n}\n\n/** Build a CSS `font` shorthand suitable for `ctx.font`. */\nexport function fontString(s: ResolvedTextStyle): string {\n return `${s.fontStyle} ${s.fontWeight} ${s.fontSize}px ${s.fontFamily}`;\n}\n","import type { FaceMetrics, FaceRuleMetrics } from '@weasel-js/font';\n\n/** The three text decoration rules, in the order every tier paints them. */\nexport type DecorationKind = 'underline' | 'strikethrough' | 'overline';\n\nexport const DECORATION_KINDS: readonly DecorationKind[] = ['underline', 'strikethrough', 'overline'];\n\n/**\n * Decoration placement and weight for a face that states none, as fractions\n * of the run's `fontSize`. Offsets are the *top* edge of the rule, measured\n * down from the baseline — so the two rules that sit above it are negative.\n *\n * Derived, not measured: they apply to an atlas baked before `gen-font`\n * recorded `faceMetrics`, a custom outline parser that reports none, and the\n * canvas tier, which has no font tables to read.\n */\nexport const DEFAULT_DECORATION_METRICS: Readonly<Record<DecorationKind, FaceRuleMetrics>> = Object.freeze({\n underline: Object.freeze({ offset: 0.10, thickness: 0.05 }),\n strikethrough: Object.freeze({ offset: -0.30, thickness: 0.05 }),\n overline: Object.freeze({ offset: -0.90, thickness: 0.05 }),\n});\n\nconst resolved = new WeakMap<FaceMetrics, Readonly<Record<DecorationKind, FaceRuleMetrics>>>();\n\n/**\n * Where each rule sits for a face, in ems: the face's own underline and\n * strikeout where it states them, the defaults where it does not. No font\n * table places an overline, so it keeps the default offset and takes the\n * underline's weight, as browsers draw it.\n *\n * Every text tier places its rules through this, so one face puts a rule in\n * the same place whichever tier paints it.\n */\nexport function decorationMetrics(face?: FaceMetrics): Readonly<Record<DecorationKind, FaceRuleMetrics>> {\n if (!face) return DEFAULT_DECORATION_METRICS;\n let out = resolved.get(face);\n if (!out) {\n const underline = face.underline ?? DEFAULT_DECORATION_METRICS.underline;\n out = Object.freeze({\n underline,\n strikethrough: face.strikethrough ?? DEFAULT_DECORATION_METRICS.strikethrough,\n overline: Object.freeze({ offset: DEFAULT_DECORATION_METRICS.overline.offset, thickness: underline.thickness }),\n });\n resolved.set(face, out);\n }\n return out;\n}\n\n/**\n * The vertical extent of one decoration rule for a run of `fontSize` whose\n * baseline sits at `baselineY` (y grows down), set in `face`.\n */\nexport function decorationRule(\n kind: DecorationKind,\n baselineY: number,\n fontSize: number,\n face?: FaceMetrics,\n): { y0: number; y1: number } {\n const m = decorationMetrics(face)[kind];\n const y0 = baselineY + fontSize * m.offset;\n return { y0, y1: y0 + fontSize * m.thickness };\n}\n","/**\n * GENERATED FILE -- DO NOT EDIT BY HAND.\n *\n * Emitted by `packages/text/scripts/gen-line-break-table.mjs` from the\n * Unicode Character Database. Regenerate with `npm run gen:line-break-table`.\n */\n\n/** The Unicode release this table was generated from. */\nexport const UNICODE_VERSION = '16.0.0';\n\n// Line-breaking classes after UAX #14's LB1 resolution. QU_PI and QU_PF are\n// QU split by General_Category Pi and Pf.\nexport const BK = 0;\nexport const CR = 1;\nexport const LF = 2;\nexport const NL = 3;\nexport const SP = 4;\nexport const ZW = 5;\nexport const ZWJ = 6;\nexport const CM = 7;\nexport const WJ = 8;\nexport const GL = 9;\nexport const BA = 10;\nexport const BB = 11;\nexport const B2 = 12;\nexport const HY = 13;\nexport const CB = 14;\nexport const CL = 15;\nexport const CP = 16;\nexport const EX = 17;\nexport const IN = 18;\nexport const NS = 19;\nexport const OP = 20;\nexport const QU = 21;\nexport const IS = 22;\nexport const NU = 23;\nexport const PO = 24;\nexport const PR = 25;\nexport const SY = 26;\nexport const AL = 27;\nexport const HL = 28;\nexport const ID = 29;\nexport const EB = 30;\nexport const EM = 31;\nexport const H2 = 32;\nexport const H3 = 33;\nexport const JL = 34;\nexport const JV = 35;\nexport const JT = 36;\nexport const RI = 37;\nexport const AK = 38;\nexport const AP = 39;\nexport const AS = 40;\nexport const VF = 41;\nexport const VI = 42;\nexport const QU_PI = 43;\nexport const QU_PF = 44;\n\n/** Low bits of a {@link lineBreakPropsOf} value: the class. */\nexport const CLASS_MASK = 63;\n/** East_Asian_Width is F, W or H — UAX #14's `$EastAsian`. */\nexport const EAST_ASIAN = 64;\n/** Unassigned and Extended_Pictographic, for rule LB30b. */\nexport const PICTOGRAPHIC_CN = 128;\n\nconst ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+,-./:;<=>?@[]^_{|}~';\nconst PALETTE = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 71, 73, 74, 79, 81, 82, 83, 84, 88, 89, 91, 93, 94, 95, 96, 97, 98, 155, 157];\n\n// Run-length encoding over the whole code space: each record is a decimal run\n// length, then one ALPHABET character indexing PALETTE.\nconst RUNS = 2787;\nconst PACKED =\n '9H1K1C2A1B18H1E1R1V1b1Z1Y1b1V1U1Q1b1Z1W1N1W1a10X2W3b1R27b1U1Z1Q29b1U1K1P1b6H1D26H1J1U1Y3Z5b1n1b1' +\n 'K2b1Y1Z2b1L6b1o3b1U520b1L3b1L18b1L32b79H1J12H7J13H14b1W260b7H255b1W1K4b1Z1b45H1K1H1b2H1b2H1R1H8b' +\n '27c4b4c13b6X3b3Y2W2b11H1R1H3R43b21H10X1Y2X3b1H99b1R1b7H1X1b6H2b2H1b4H2b10X23b1H30b27H91b11H15b10' +\n 'X33b9H4b1W1R3b1H2Z22b4H1b9H1b3H1b5H43b3H52b2X5b9H42b24H1X33H54b3H1b18H1b7H10b2H2K10X17b3H56b1H1b' +\n '7H2b2H2b3H9b1H10b2H2b10X2b2Y5b1Y1b1Z2b1H2b3H56b1H1b5H4b2H2b3H3b1H20b10X2H3b1H11b3H56b1H1b8H1b3H1' +\n 'b3H20b2H2b10X1b1Z8b6H1b3H56b1H1b7H2b2H2b3H7b3H10b2H2b10X18b1H59b5H3b3H1b4H9b1H14b10X9b1Z6b5H55b1' +\n 'H1b7H1b3H1b4H7b2H11b2H2b10X7b1L9b3H1L55b1H1b7H1b3H1b4H7b2H11b2H2b10X3b1H12b4H55b2H1b7H1b3H1b4H9b' +\n '1H10b2H2b10X9b1Y7b3H70b1H4b6H1b1H1b8H6b10X2b2H61b1H2b7H4b1Z7b8H1b10X2K85b1H2b9H11b7H1b10X39b4L1b' +\n '2L1J2L1K1J5R1J1b1R3b2H6b10X10b1K1H1b1H1b1H1U1P1U1P2H49b14H1K5H1K2H5b11H1b36H1b2K6b1H9b2L1K1L5b2J' +\n '80b20H1b10X2K10b4H4b3H1b3H2b7H3b4H13b12H1b1H10X4H98b96(72f88g349b3H1b1K158b1K639b1K26b1U1P78b3K3' +\n '6b4H28b3H2K27b2H30b2H64b32H2K1T1b1K1b1K1Z1b1H2b10X24b2R2K1L1b2R1b3H1J1H10X107b2H34b1H118b12H4b12' +\n 'H8b2R10X128b11X60b5H57b10H1b29H2b1H10X6b10X22b31H49b5H47i16H1m8i1b2K10k2K1d4K10d9H9d3K3H30b13H2b' +\n '10X6b38k12H2l48b20H3b5K10X6b10X36b2K80b3H1b21H4b1H6b1H2b3H198b13H1J46H1J3H509b1L2b7K1J3K1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10b1L2b1H10X28b8H2K23b13H' +\n '12b29(3b4H47i13H1m6d3K4d1b1K10k4b2d5b1H10b10X6b41k14H9b3K1H8K2H2b10k2b1d3K27b3H50b1H1b3H2b2H5b2H' +\n '1b1H41b5H2K3b2H236b8H1K2H2b10X6b1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27' +\n '&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&' +\n '1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1' +\n '%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%' +\n '27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%2' +\n '7&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27' +\n '&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&' +\n '1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1' +\n '%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%' +\n '27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%2' +\n '7&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27' +\n '&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&' +\n '1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1' +\n '%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%' +\n '27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%2' +\n '7&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27' +\n '&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&' +\n '1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1' +\n '%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%' +\n '27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%2' +\n '7&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27&1%27' +\n '&1%27&1%27&12b23f4b49g8452b512!29b1c1H10c1b13c1b5c1b1c1b2c1b2c1b10c494b1P1U188b1Y3b16H3s2v2t1w1s' +\n '1u6b1J1H1J1H1J1H2J1H1J1H1J1H2J1H5!1w1s1w1s1w1s1w1s1w1s1w1s1w1s1w1s2!1w1s7!1s1!1s1b2v2t1!1w1s1w1s' +\n '1w1s8!1b1!1y1x1!147b1I1b1t2!1y1x2!1w1s2!1s1!1s11!2v3!1t27!1w1!1s29!1w1!1s1!1w2s1w2s1v1!10v45!2v3' +\n '1!3b6!2b6!2b6!2b3!3b1x1y3!2y1b7z10b3H1O259b3K250b1H226b1H149b5H36b1K48b1K207b10X941b1K199b1K225b' +\n '3H1b2H5b4H40b3H4b1H16b8K141b2H9b6K1S66b7K484b4H8b10X6b10X31b5H1K316b2H1K78b4H70b11H49b4H122b3H2j' +\n '51i14H1m2K5d4b20d10k1H2i2H1i9b1J3H45b11H2b1X4K1H10b1X34b10X6b3H36b14H1b10X4K1b2H44b1H1b1L10b3H48' +\n 'b14H4b2K1b1K4H1b2H10X1b1L1b3K76b12H2K1b2K1b1H2b1H103b1K53b12H5b10X6b4H1b8i2b2i2b22i1b7i1b2i1b5i1' +\n 'b2H1K7H2b2H2b2H1m2b1k6b1H5b1K2k2i2H2b7H3b5H11b10k1b1k2b1k1b2k36i1b1d9H1b1H2b1H1b4H1b4H1m1j1H3d1b' +\n '2d8b2H82b18H4b4K1b10X2K2b1H81b20H12b10X213b7H2b9H1L2K2R3b15K4b2H82b17H2K13b10X6b13L62b13H8b10X6b' +\n '20X57b15H4b10X2b3K237b15H165b10X22b7i2b1i2b8i1b2i1b24i6H1b2H2b3H1m1j1H1j2H3K9b10k119b7H2b7H1b1L1' +\n 'b1H28b10H40b7H1b4H1L1b4K1L1b1H9b11H46b16H3K1b3L2K93b10L230b10X53b8H1b8H1b5K10b10X22b1L1R32b22H1b' +\n '14H122b6H3b1H1b2H1b7H1b1H8b10X48b5H1b2H1b5H8b10X310b18k1K4H2K7b2H1j1H13i1b34i7H3b4H1m2K11d10k1H1' +\n '30b4Y30b1K1136b5K3555b3U3P36b1P3b1U1P1U1P239b1U2P179b1U7J1U1P3J1U1P1U1P1H6b15H4472b1U1P6960b30k1' +\n '8H10k2342b10X4b2K80b10X38b5H1K58b7H3K10b1K11b10X532b2K10X285b2K182b1H1b55H7b4H77b4v1q11b2p14b613' +\n '6!8b768!470z41b1z9!8935b4z1b7z1b2z1b291!15b1v29b3v2b1v14b4v8b396!2465b2H1K4H4172b10X518b46H2b23H' +\n '542b5H3b22H2b7H30b4H148b3H187b87z9b23z1111b50X512b55H4b50H8b1H14b1H2b4K16b5H1b15H1360b7H1b17H2b7' +\n 'H1b2H1b5H100b1H160b7H9b10X356b1H61b4H10X5b1Z492b4H10X244b2H1b10X725b7H109b7H5b10X4b2U844b1Y3b1Y8' +\n '47b4d1!39d4*100d12*15d2*15d1*14d1!1*37d10*142b1z2b10z19b56*26h3!13*44!4*9!7*2!14*6!154*33!12d9!1' +\n 'd70!1d7!1#14!8d2b2d21!2z5!1z5!3#2!1#2!1#2e2d5!12d17!3d1!3d3!5$63!1d1!1d2#2!11#21!19#3!1#4!3#1!3#' +\n '7!1#1!1#14!1z1!1z1!1z5!1#4!1z1!2z74!2d1!7z16!14z13!12z12b1d4!1d24!12d2e4d1#21d1e4d2#13d1!47d8b24' +\n 'd6b1d74!3#3!5#38b3V3T4b35!1#16!3#9!1#5!6d1#3d3!2d3!4*4!11d2!3*4d9!3*116b3d4*5d85b5d6*12!4*1!15*1' +\n '2b4)56b8)10b6)40b8)30b2)12b4)2b62)12b1#2!1#8!8#6!1#9!10#1!1d3#7!1d48!1#61!2#1!2#1!1#17!3#1!13#34' +\n '!84b12*14d2*13!3*10!5*52!3#1!7*15!2*11!6*9#7*240b10X6b1022*2b65534!2b65534!655363b1H30b96H128b24' +\n '0H196112b';\n\nlet bmp: Uint8Array | null = null;\nlet astralStarts: Int32Array | null = null;\nlet astralValues: Uint8Array | null = null;\n\nfunction decode(): void {\n const direct = new Uint8Array(0x10000);\n const starts = new Int32Array(RUNS);\n const values = new Uint8Array(RUNS);\n const slot = new Uint8Array(128);\n for (let i = 0; i < ALPHABET.length; i++) slot[ALPHABET.charCodeAt(i)] = PALETTE[i];\n let cp = 0;\n let run = 0;\n let len = 0;\n for (let i = 0; i < PACKED.length; i++) {\n const code = PACKED.charCodeAt(i);\n if (code <= 57 && code >= 48) len = len * 10 + code - 48;\n else {\n const v = slot[code];\n starts[run] = cp;\n values[run] = v;\n if (cp < 0x10000) direct.fill(v, cp, Math.min(cp + len, 0x10000));\n run++;\n cp += len;\n len = 0;\n }\n }\n bmp = direct;\n astralStarts = starts;\n astralValues = values;\n}\n\n/**\n * The class of `cp` in the low bits (`& CLASS_MASK`), with the\n * {@link EAST_ASIAN} and {@link PICTOGRAPHIC_CN} flags above them.\n */\nexport function lineBreakPropsOf(cp: number): number {\n if (bmp === null) decode();\n if (cp < 0x10000) return bmp![cp];\n if (cp > 0x10ffff) return AL;\n const starts = astralStarts!;\n let lo = 0;\n let hi = starts.length - 1;\n while (lo < hi) {\n const mid = (lo + hi + 1) >> 1;\n if (starts[mid] <= cp) lo = mid;\n else hi = mid - 1;\n }\n return astralValues![lo];\n}\n","/**\n * Line break opportunities per the Unicode Line Breaking Algorithm\n * (UAX #14), default rules, no tailoring: where a line may end, not where it\n * does. Choosing among the opportunities is the wrap's job.\n *\n * Rules LB2–LB31 are applied in order at every position. LB9 is applied up\n * front: a combining mark or ZWJ that follows a base joins it into one unit\n * carrying the base's class, so every later rule reads units, never marks.\n */\n\nimport * as table from './lineBreakTable';\n\n// Copied into module locals: vitest rewrites every read of an imported\n// binding into a property access, which made this loop 25x slower under test.\nconst {\n lineBreakPropsOf, CLASS_MASK, EAST_ASIAN, PICTOGRAPHIC_CN,\n BK, CR, LF, NL, SP, ZW, ZWJ, CM, WJ, GL, BA, BB, B2, HY, CB, CL, CP, EX, IN, NS,\n OP, QU, IS, NU, PO, PR, SY, AL, HL, ID, EB, EM, H2, H3, JL, JV, JT, RI,\n AK, AP, AS, VF, VI, QU_PI, QU_PF,\n} = table;\n\n/** No opportunity before this position. */\nexport const NO_BREAK = 0;\n/** A line may end before this position. */\nexport const BREAK_ALLOWED = 1;\n/** A line must end before this position: after a hard line break, and at the end of text. */\nexport const BREAK_MANDATORY = 2;\n\nconst HYPHEN = 0x2010;\nconst DOTTED_CIRCLE = 0x25cc;\n\nconst isQU = (c: number): boolean => c === QU || c === QU_PI || c === QU_PF;\nconst isHard = (c: number): boolean => c === BK || c === CR || c === LF || c === NL;\n/**\n * Whether a line must end after `cp`: UAX #14's hard breaks, which are LF,\n * VT, FF, CR, NEL, U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR. A CR\n * directly before an LF makes one break with it, not two.\n */\nexport function isHardLineBreak(cp: number): boolean {\n return isHard(lineBreakPropsOf(cp) & CLASS_MASK);\n}\nconst isAlpha =(c: number): boolean => c === AL || c === HL;\nconst isKorean = (c: number): boolean => c === JL || c === JV || c === JT || c === H2 || c === H3;\nconst isIdeoLike = (c: number): boolean => c === ID || c === EB || c === EM;\n\n/**\n * For each position `0..cps.length`, whether a line may break before it:\n * {@link NO_BREAK}, {@link BREAK_ALLOWED} or {@link BREAK_MANDATORY}. Position\n * 0 never breaks and position `cps.length` always does.\n *\n * `cps` is code points, not UTF-16 units — one entry per scalar value.\n */\nexport function lineBreakOpportunities(cps: ArrayLike<number>): Uint8Array {\n const n = cps.length;\n const out = new Uint8Array(n + 1);\n if (n === 0) return out;\n out[n] = BREAK_MANDATORY;\n\n // LB9/LB10: collapse each base and the marks it carries into one unit.\n const cls = new Uint8Array(n);\n const ea = new Uint8Array(n);\n const pict = new Uint8Array(n);\n const cp = new Int32Array(n);\n /** Original index of each unit's first code point. */\n const start = new Int32Array(n);\n let u = 0;\n for (let i = 0; i < n; i++) {\n const props = lineBreakPropsOf(cps[i]);\n const c = props & CLASS_MASK;\n if ((c === CM || c === ZWJ) && u > 0) {\n const base = cls[u - 1];\n if (!isHard(base) && base !== SP && base !== ZW) continue;\n }\n if (c === CM || c === ZWJ) {\n cls[u] = AL; ea[u] = 0; pict[u] = 0;\n } else {\n cls[u] = c; ea[u] = props & EAST_ASIAN ? 1 : 0; pict[u] = props & PICTOGRAPHIC_CN ? 1 : 0;\n }\n cp[u] = cps[i];\n start[u] = i;\n u++;\n }\n const units = u;\n\n // The original class of the code point just before unit `b`, which is the\n // last mark `b - 1` absorbed when it absorbed any.\n const prevIsZWJ = (b: number): boolean => (lineBreakPropsOf(cps[start[b] - 1]) & CLASS_MASK) === ZWJ;\n\n /** The unit before `k`'s run of spaces — `k` itself when it is not a space. */\n const beforeSpaces = (k: number): number => {\n while (k >= 0 && cls[k] === SP) k--;\n return k;\n };\n\n for (let b = 1; b < units; b++) {\n out[start[b]] = decide(b);\n }\n return out;\n\n function decide(b: number): number {\n const a = b - 1;\n const A = cls[a];\n const B = cls[b];\n\n // LB4, LB5\n if (A === CR && B === LF) return NO_BREAK;\n if (isHard(A)) return BREAK_MANDATORY;\n // LB6, LB7\n if (isHard(B) || B === SP || B === ZW) return NO_BREAK;\n // LB8\n const s = beforeSpaces(a);\n if (s >= 0 && cls[s] === ZW) return BREAK_ALLOWED;\n // LB8a\n if (prevIsZWJ(b)) return NO_BREAK;\n // LB11, LB12, LB12a\n if (A === WJ || B === WJ || A === GL) return NO_BREAK;\n if (B === GL && A !== SP && A !== BA && A !== HY) return NO_BREAK;\n // LB13\n if (B === CL || B === CP || B === EX || B === SY) return NO_BREAK;\n // LB14\n const S = s >= 0 ? cls[s] : -1;\n if (S === OP) return NO_BREAK;\n // LB15a\n if (S === QU_PI) {\n const p = s - 1;\n if (p < 0) return NO_BREAK;\n const P = cls[p];\n if (isHard(P) || P === OP || isQU(P) || P === GL || P === SP || P === ZW) return NO_BREAK;\n }\n // LB15b\n if (B === QU_PF) {\n if (b + 1 >= units) return NO_BREAK;\n const N = cls[b + 1];\n if (N === SP || N === GL || N === WJ || N === CL || isQU(N) || N === CP || N === EX\n || N === IS || N === SY || isHard(N) || N === ZW) return NO_BREAK;\n }\n // LB15c, LB15d\n if (A === SP && B === IS && b + 1 < units && cls[b + 1] === NU) return BREAK_ALLOWED;\n if (B === IS) return NO_BREAK;\n // LB16, LB17\n if ((S === CL || S === CP) && B === NS) return NO_BREAK;\n if (S === B2 && B === B2) return NO_BREAK;\n // LB18\n if (A === SP) return BREAK_ALLOWED;\n // LB19\n if (B === QU || B === QU_PF) return NO_BREAK;\n if (A === QU || A === QU_PI) return NO_BREAK;\n // LB19a\n if (isQU(B)) {\n if (!ea[a]) return NO_BREAK;\n if (b + 1 >= units || !ea[b + 1]) return NO_BREAK;\n }\n if (isQU(A)) {\n if (!ea[b]) return NO_BREAK;\n if (a === 0 || !ea[a - 1]) return NO_BREAK;\n }\n // LB20\n if (A === CB || B === CB) return BREAK_ALLOWED;\n // LB20a\n if ((A === HY || cp[a] === HYPHEN) && B === AL) {\n if (a === 0) return NO_BREAK;\n const P = cls[a - 1];\n if (isHard(P) || P === SP || P === ZW || P === CB || P === GL) return NO_BREAK;\n }\n // LB21\n if (B === BA || B === HY || B === NS || A === BB) return NO_BREAK;\n // LB21a\n if (a > 0 && cls[a - 1] === HL && (A === HY || (A === BA && !ea[a])) && B !== HL) return NO_BREAK;\n // LB21b, LB22\n if (A === SY && B === HL) return NO_BREAK;\n if (B === IN) return NO_BREAK;\n // LB23, LB23a, LB24\n if ((isAlpha(A) && B === NU) || (A === NU && isAlpha(B))) return NO_BREAK;\n if ((A === PR && isIdeoLike(B)) || (isIdeoLike(A) && B === PO)) return NO_BREAK;\n if (((A === PR || A === PO) && isAlpha(B)) || (isAlpha(A) && (B === PR || B === PO))) return NO_BREAK;\n // LB25\n if (B === PO || B === PR) {\n let k = A === CL || A === CP ? a - 1 : a;\n while (k >= 0 && (cls[k] === SY || cls[k] === IS)) k--;\n if (k >= 0 && cls[k] === NU) return NO_BREAK;\n }\n if (A === PO || A === PR) {\n if (B === NU) return NO_BREAK;\n if (B === OP && b + 1 < units) {\n const N = cls[b + 1];\n if (N === NU) return NO_BREAK;\n if (N === IS && b + 2 < units && cls[b + 2] === NU) return NO_BREAK;\n }\n }\n if ((A === HY || A === IS) && B === NU) return NO_BREAK;\n if (B === NU) {\n let k = a;\n while (k >= 0 && (cls[k] === SY || cls[k] === IS)) k--;\n if (k >= 0 && cls[k] === NU) return NO_BREAK;\n }\n // LB26, LB27\n if (A === JL && (B === JL || B === JV || B === H2 || B === H3)) return NO_BREAK;\n if ((A === JV || A === H2) && (B === JV || B === JT)) return NO_BREAK;\n if ((A === JT || A === H3) && B === JT) return NO_BREAK;\n if ((isKorean(A) && B === PO) || (A === PR && isKorean(B))) return NO_BREAK;\n // LB28\n if (isAlpha(A) && isAlpha(B)) return NO_BREAK;\n // LB28a\n const aksaraA = A === AK || A === AS || cp[a] === DOTTED_CIRCLE;\n const aksaraB = B === AK || B === AS || cp[b] === DOTTED_CIRCLE;\n if (A === AP && aksaraB) return NO_BREAK;\n if (aksaraA && (B === VF || B === VI)) return NO_BREAK;\n if (A === VI && a > 0 && (cls[a - 1] === AK || cls[a - 1] === AS || cp[a - 1] === DOTTED_CIRCLE)\n && (B === AK || cp[b] === DOTTED_CIRCLE)) return NO_BREAK;\n if (aksaraA && aksaraB && b + 1 < units && cls[b + 1] === VF) return NO_BREAK;\n // LB29, LB30\n if (A === IS && isAlpha(B)) return NO_BREAK;\n if ((isAlpha(A) || A === NU) && B === OP && !ea[b]) return NO_BREAK;\n if (A === CP && !ea[a] && (isAlpha(B) || B === NU)) return NO_BREAK;\n // LB30a\n if (A === RI && B === RI) {\n let k = a;\n while (k >= 0 && cls[k] === RI) k--;\n if ((a - k) % 2 === 1) return NO_BREAK;\n }\n // LB30b\n if (B === EM && (A === EB || pict[a])) return NO_BREAK;\n // LB31\n return BREAK_ALLOWED;\n }\n}\n","/**\n * Grapheme clusters: the unit CSS `letter-spacing` tracks, and therefore the\n * unit every tracked width in this package counts. `measuredWidth` and\n * `layoutRuns` both read clusters from here, so the 2D path, the GL path and\n * a DOM overlay agree on how many gaps a string has.\n */\n\nlet segmenter: Intl.Segmenter | null | undefined;\n\nfunction graphemeSegmenter(): Intl.Segmenter | null {\n if (segmenter === undefined) {\n segmenter = typeof Intl !== 'undefined' && 'Segmenter' in Intl\n ? new Intl.Segmenter(undefined, { granularity: 'grapheme' })\n : null;\n }\n return segmenter;\n}\n\n/**\n * UTF-16 offsets just past each grapheme cluster of `text`, ascending — the\n * last is `text.length`. Without `Intl.Segmenter` every code point is its own\n * cluster.\n */\nexport function graphemeEnds(text: string): number[] {\n const out: number[] = [];\n const seg = graphemeSegmenter();\n if (seg) {\n for (const s of seg.segment(text)) out.push(s.index + s.segment.length);\n return out;\n }\n let at = 0;\n for (const ch of text) out.push(at += ch.length);\n return out;\n}\n\n/** Number of grapheme clusters in `text`: how many times it is tracked. */\nexport function graphemeCount(text: string): number {\n return graphemeEnds(text).length;\n}\n","/**\n * The greedy wrap every text layout in this package shares: `layoutRuns`,\n * `layoutMarkdown` and `measureText` each measure their own way and hand the\n * measuring in here, so where a line ends is decided in one place.\n */\n\nimport { isHardLineBreak, lineBreakOpportunities, NO_BREAK } from './lineBreaks';\n\n/** One line of a wrap, as code point indices into the wrapped sequence. */\nexport interface WrappedLine {\n /** First code point on the line. */\n start: number;\n /** One past the last, excluding the hard break that closed it. Trailing spaces are included. */\n end: number;\n /** Closed by the wrap rather than by a hard break or the end of the text. */\n wrapped: boolean;\n}\n\nconst SPACE = 32;\n\n/**\n * Greedy wrap of `cps` at its UAX #14 break opportunities. A line ends at\n * every hard break (CRLF counts once, and neither code point lands on a\n * line), and before any word — the text up to the next opportunity, spaces\n * after it included — whose ink would take the line past `maxWidth`. Only\n * ink has to fit: trailing spaces hang. A word wider than the line is never\n * split. `Infinity` breaks at hard breaks alone.\n *\n * `widthOf(start, end)` is the width of code points `[start, end)` set on a\n * line of their own starting at `start`; `end` is always one past a\n * non-space.\n */\nexport function wrapLines(\n cps: ArrayLike<number>,\n maxWidth: number,\n widthOf: (start: number, end: number) => number,\n): WrappedLine[] {\n const n = cps.length;\n const breaks = Number.isFinite(maxWidth) ? lineBreakOpportunities(cps) : null;\n const lines: WrappedLine[] = [];\n let start = 0;\n let i = 0;\n while (i < n) {\n const cp = cps[i];\n if (isHardLineBreak(cp)) {\n lines.push({ start, end: i, wrapped: false });\n i += cp === 13 && cps[i + 1] === 10 ? 2 : 1;\n start = i;\n continue;\n }\n // A space here opens the text or follows a hard break: it never wraps.\n if (cp === SPACE) { i++; continue; }\n let j = i + 1;\n let ink = i + 1;\n while (j < n && !isHardLineBreak(cps[j]) && (!breaks || breaks[j] === NO_BREAK)) {\n if (cps[j] !== SPACE) ink = j + 1;\n j++;\n }\n if (breaks && i > start && widthOf(start, ink) > maxWidth) {\n lines.push({ start, end: i, wrapped: true });\n start = i;\n }\n i = j;\n }\n if (start < n) lines.push({ start, end: n, wrapped: false });\n return lines;\n}\n","/**\n * Runs-aware MSDF layout. Walks `ResolvedRun[]` codepoint-by-codepoint,\n * switching atlas per run via `resolveFontVariant`, applying kerning\n * (using the left glyph's atlas table and size scaling, including across\n * run boundaries), and bucketing emitted quads by\n * `(family, resolvedWeight, resolvedStyle, syntheticBold, syntheticItalic, fillKey)`\n * so the renderer issues one draw call per atlas+color group.\n *\n * A run's `letterSpacing` (world units, so it does not scale with `fontSize`)\n * is added to the advance *after* every grapheme cluster of that run,\n * including the last one on a line — the CSS `letter-spacing` rule, chosen so\n * a DOM overlay rendering the same text can be made to agree. The last code\n * point of a cluster carries it, so a combining mark hangs off its base\n * before the gap opens. Clusters are segmented per run. Trailing tracking\n * therefore widens the measured line width and counts toward wrapping. Spaces\n * are tracked like any other character; a newline is not (it consumes no\n * advance).\n *\n * Word wrap is applied when `maxWidth` is finite: words — the text between\n * UAX #14 break opportunities — are committed to a new line when they would\n * exceed the current line width. Forced line breaks are emitted at UAX #14's\n * hard breaks — `\\n`, CR, CRLF as one, VT, FF, NEL, U+2028 and U+2029 — none\n * of which lays out a cell. Every run on a line shares one baseline, sunk to\n * clear whichever run reaches highest above it, so mixing sizes or faces aligns\n * them the way inline text aligns everywhere else; line height is\n * `max(fontSize * lineHeight)` across the line. A face that states its ascent\n * and descent sits in its line the way CSS sets it — half the leading above the\n * ascent, negative when the face is taller than the line, so its glyphs overflow\n * the box rather than growing it. A run a relative size shrank\n * measures at its `strutSize` for both, the way a CSS line keeps its parent's\n * strut under a `<sup>`.\n *\n * A run may also sit off that shared baseline: `ResolvedRun.baselineShift`\n * displaces it, which is what `script: 'super' | 'sub'` resolves to. The shift\n * moves the run's glyphs, its outline geometry and its own decoration rules\n * together, and deliberately does not feed back into the line's baseline or\n * its height — a superscript rides on the line rather than reflowing it.\n *\n * Underline, strikethrough and overline come out on a second channel,\n * `decorations` —\n * solid rectangles, not textured glyphs, so they cannot ride in a group's\n * `quads` (which upload UVs into an MSDF program). They are accumulated\n * during the same per-line pen walk that emits quads, *not* reconstructed\n * from quad extents afterwards: quads exist only for glyphs with ink, so a\n * decorated span's spaces would punch holes in a rule derived from them.\n *\n * ### Coordinates are origin-relative\n *\n * Every coordinate out of here is measured from the text's own top-left, not\n * from anywhere on the page: the caller translates. That is what lets a text\n * node be dragged without re-laying out — `layoutCache` would otherwise need\n * the position in its key and miss on every frame of the drag — and it costs\n * the caller one addition per vertex, inside loops already walking every one.\n * Alignment, wrapping, tracking and decoration placement all read widths and\n * pen deltas, never an absolute coordinate, so the translation is exact.\n */\n\nimport type { FillStyle, Stroke } from '@weasel-js/paint';\nimport {\n resolveFontVariant, resolveGlyphFallback, glyphOutline, fontPending, faceMetricsOf,\n type ResolveResult, type BmFontChar, type BmFont, type FontStyle, type FaceMetrics,\n} from '@weasel-js/font';\nimport type { ResolvedRun } from '../runs/resolveRuns';\nimport { resolveAlign, type TextAlign, type TextDirection } from '../textStyle';\nimport type { BidiResolver } from './bidiSeam';\nimport { DECORATION_KINDS, decorationRule, type DecorationKind } from './decorationMetrics';\nimport { graphemeEnds } from '../measure/graphemes';\nimport { isHardLineBreak } from './lineBreak/lineBreaks';\nimport { wrapLines } from './lineBreak/wrapLines';\n\n/** One textured glyph quad, origin-relative — see the header. */\nexport interface LaidOutQuad {\n x0: number; y0: number; x1: number; y1: number;\n u0: number; v0: number; u1: number; v1: number;\n /** Y coordinate of the line's baseline (penY at quad emission). Used by the\n * synthetic-italic vertex skew so above-baseline vertices lean right. */\n baselineY: number;\n}\n\n/**\n * One glyph the renderer should tessellate rather than sample: real font\n * outline geometry, for text large enough that a distance field shows the\n * raster it was reconstructed from.\n *\n * `d` is em-space SVG path data straight from `@weasel-js/font`'s outline\n * registry — 1 unit is 1 em, y grows down, origin on the baseline at the pen.\n * Placing it is therefore a uniform scale by `scale` (world units per em)\n * followed by a translate to `(x, baselineY)`, and nothing here depends on\n * zoom: the same glyph at the same size in two places is the same geometry\n * twice, which is what lets the renderer tessellate it once and cache it.\n *\n * `key` identifies that cached tessellation — face identity plus codepoint,\n * assembled here because layout is where both are in hand.\n */\nexport interface LaidOutOutlineGlyph {\n d: string;\n key: string;\n /** Pen position: where em-space x = 0 lands, in world units. */\n x: number;\n /** The line's baseline: where em-space y = 0 lands, in world units. */\n baselineY: number;\n /** World units per em — the run's `fontSize`, since em space is unit-scale. */\n scale: number;\n}\n\n/** Glyphs that share a resolved face, glyph source and paint — one draw call's worth. */\nexport interface LaidOutGroup {\n /** Resolved atlas family — may differ from the requested family when the\n * cross-family fallback policy substituted a default. This is what the\n * renderer looks the atlas up by, so it must be the one that resolves. */\n family: string;\n /** Resolved variant — matches the registered atlas and the texture-cache key. */\n weight: number;\n style: FontStyle;\n /** Gap between the request and the resolved match. Drives shader uniforms. */\n synthetic: { bold: boolean; italic: boolean };\n /** Which glyph source (and therefore shader/texture) this group binds:\n * baked MSDF atlas, the runtime canvas-SDF dynamic atlas, or tessellated\n * font outlines. */\n source: 'atlas' | 'canvas' | 'outline';\n /** Dynamic-atlas page index for 'canvas' groups; 0 for the others. */\n page: number;\n /** `null` for an unfilled run: the group's glyphs are painted by `stroke`\n * alone. Only ever null on an `'outline'` group carrying a stroke, since\n * nothing else can put ink down without a fill. */\n fill: FillStyle | null;\n /** Outline painted over the glyphs, or absent for none. Only ever set on\n * an `'outline'` group — the SDF tiers have no geometry to stroke, which\n * is why a stroke pulls its run onto the outline tier at any size. A run\n * the tier cannot serve at all (no registered outlines, synthetic bold)\n * stays on the atlas and carries the request no further. */\n stroke?: Stroke;\n /** Textured glyph quads. Always empty for an `'outline'` group. */\n quads: LaidOutQuad[];\n /** Outline geometry. Always empty for an `'atlas'` / `'canvas'` group —\n * the two channels are exclusive, since the group is also the draw call\n * and one draw call binds one program. */\n glyphs: LaidOutOutlineGlyph[];\n}\n\n/**\n * One decoration rule: an axis-aligned solid rectangle in the same world\n * space as `LaidOutQuad`. Never spans a line break, and carries the fill of\n * the run(s) it decorates so the rule follows the text colour.\n */\nexport interface LaidOutDecoration {\n kind: DecorationKind;\n x0: number; y0: number; x1: number; y1: number;\n fill: FillStyle;\n}\n\n/**\n * One advance cell: a single code point's slot on a line.\n *\n * A cell spans its code point *plus* the kerning that precedes the next one,\n * so a caret snapped to the midpoint between two `x`s lands where the glyphs\n * were actually painted rather than where an unkerned re-measure would put it.\n */\nexport interface LaidOutCell {\n /** UTF-16 offset of this code point in the runs' concatenated source text.\n * Under a length-changing `textTransform` it is the offset of the source\n * character this one was mapped from, so neighbors can share it — both\n * `S` cells of an uppercased `ß` do. */\n srcIndex: number;\n /** One past that source character — `srcIndex + 2` for an astral one. */\n srcEnd: number;\n cp: number;\n /** Left edge of the cell, post-alignment, origin-relative like `x0`/`x1`.\n *\n * **Not monotonic across `cells`** once a bidi engine reorders a line: cells\n * stay in logical order and their x values do not. Sort on `x` for visual\n * order; never assume `cells[i + 1].x` is this cell's right edge. */\n x: number;\n /** Width of the cell: its glyph's advance, plus its run's tracking when it\n * closes a grapheme cluster, plus a justified gap's share of the slack. */\n advance: number;\n /** Resolved bidi embedding level — even reads left-to-right. 0 with no\n * engine, which is the same as saying the text was laid out logically. */\n level: number;\n /**\n * Whether this code point can put ink on the page. False for a space and\n * for a code point no tier could serve — each of which still holds its\n * slot. A zero-advance combining mark is `true`: it inks without advancing.\n *\n * A property of the character and the face, not of this call: it does not\n * change when a dynamic bake lands or the outline threshold is crossed. A\n * blank-but-servable glyph (NBSP in a face that has one) reports `true`;\n * read the quad or outline geometry for exact ink extents.\n */\n drawsInk: boolean;\n}\n\n/**\n * One laid-out line's box, in the same world space as `LaidOutQuad`.\n *\n * `[x0, x1]` is the line's own advance width *after* alignment — not the\n * wrap box — so a short centered line reports the span it actually occupies.\n * `[y0, y1]` is the full line box: `y0` is the pen's line top, `y1` is\n * `y0 + max(fontSize * lineHeight)` over the line's runs. Ink can escape it\n * vertically (a tall accent, a deep descender at a lineHeight below ~1.06 —\n * see the `bounds` note at the end of `layoutRuns`); this is the typographic\n * box, not an ink bounding box.\n *\n * Emitted for every line including empty ones, so indices line up with the\n * wrap. An empty line has `x0 === x1`.\n */\nexport interface LaidOutLineBox {\n x0: number; y0: number; x1: number; y1: number;\n /** The line's baseline, for callers placing carets or rules against it. */\n baselineY: number;\n /**\n * One cell per code point on this line, left to right. Every code point the\n * line covers has exactly one, drawn or not; only a newline has none, since\n * it separates cells rather than being one. The code points are the drawn\n * ones, after `textTransform`, so an uppercased `ß` has two cells.\n *\n * A caret stop is a cell's `x`, and the stop closing the line is `x1` /\n * `srcEnd` — there is one more stop than cell, except that cells sharing a\n * source span have no stop between them.\n */\n cells: LaidOutCell[];\n /**\n * Source offset just past this line's last cell — the closing caret stop's\n * index, and the only source offset a blank line carries.\n */\n srcEnd: number;\n}\n\n/** What {@link layoutRuns} returns. Every coordinate is relative to the text's own top-left. */\nexport interface LaidOutRuns {\n groups: LaidOutGroup[];\n /** Decoration rules, in line order; within a span, underline then\n * strikethrough then overline. Empty when nothing is decorated. */\n decorations: LaidOutDecoration[];\n /** Per-line boxes in layout order. Lets a caller reason about where the\n * text actually sits inside its wrap box without re-running the wrap —\n * `textLineBoxes` builds the text silhouette from these, so picking and\n * painting cannot drift apart. */\n lines: LaidOutLineBox[];\n /** The text's ink box. `width` is the widest line measured to its last\n * non-space cell — a trailing space hangs past the aligned edge, so a\n * block wrapped at `maxWidth` never reports wider than it. */\n bounds: { width: number; height: number };\n}\n\n/**\n * Where a run's advances, kerning and baseline come from.\n *\n * The two tiers that carry metrics express them in different units — a baked\n * atlas in its own bake-size units, a parsed face in ems — so the walk reads\n * both through this instead of naming a `BmFont`. `size` is the divisor that\n * takes either into world units (`fontSize / size`), which is why an em-space\n * face reports `size: 1`.\n *\n * Not exported: a consumer supplies metrics by registering a font, not by\n * implementing this. It exists so the atlas is one case rather than the only\n * one.\n */\ninterface MetricsSource {\n /** Units per em of whatever `advance`, `base` and `kernOf` are measured in. */\n size: number;\n /** Line top to baseline in the glyph frame, in those same units: what an\n * atlas glyph's `yoffset` is measured against. */\n base: number;\n /** Baseline to the top and bottom of the face's line box, in those same\n * units — the ascent and descent a browser sets the face with. `descent`\n * is absent for a face that states neither, which hangs its baseline\n * `base` below the line top instead of centering the face in the line. */\n ascent: number;\n descent?: number;\n /** Advance for `cp`, or null when this source has no glyph for it. */\n advanceOf(cp: number): number | null;\n kernOf(left: number, right: number): number;\n}\n\nfunction atlasMetrics(font: BmFont): MetricsSource {\n const size = font.info.size;\n const { ascent, descent } = font.faceMetrics ?? {};\n return {\n size,\n base: font.common.base,\n ...(ascent !== undefined && descent !== undefined\n ? { ascent: ascent * size, descent: descent * size }\n : { ascent: font.common.base }),\n advanceOf: (cp) => font.charMap.get(cp)?.xadvance ?? null,\n kernOf: (l, r) => font.kerningMap.get(l)?.get(r) ?? 0,\n };\n}\n\n/** Options for {@link layoutRuns}. */\nexport interface LayoutRunsOpts {\n /** Wrap width. `Infinity` never wraps. */\n maxWidth: number;\n /**\n * Width of the box `center` / `right` resolve within, with `x = 0` its left\n * edge. Default `maxWidth`. Separate from it so a box can align text it does\n * not wrap. When both are infinite a line anchors on its own width instead:\n * `x = 0` is its midpoint (`center`) or right edge (`right`).\n */\n alignWidth?: number;\n lineHeight: number;\n /**\n * `start` / `end` resolve against `direction`; `left` / `right` are absolute\n * and ignore it, the way CSS `text-align` treats the same values. `justify`\n * is `justify: true` with the start edge.\n */\n align: TextAlign;\n /**\n * Spread each line that wrapped across `alignWidth`, widening its word gaps\n * (spaces between words; not leading or hanging trailing ones) by equal\n * shares of the slack. A line that closes its paragraph, or has no gap, or\n * no slack, keeps `align` — so `align` is CSS `text-align-last` here.\n * Implied by `align: 'justify'`. Default `false`.\n */\n justify?: boolean;\n /**\n * Bidi engine. Omit and the text lays out in logical order, which is correct\n * for left-to-right text and wrong for right-to-left text — see the warning\n * this emits when it detects the latter without one.\n */\n bidi?: BidiResolver;\n /**\n * Reading direction, for resolving `start` / `end`. Default `'ltr'`.\n *\n * Taken as an input rather than sniffed: this package has no DOM, so a\n * consumer reading `getComputedStyle(box).direction` passes what it found.\n */\n direction?: TextDirection;\n /**\n * World-space `fontSize` at or above which glyphs are emitted as outline\n * geometry, when the resolved face has outlines registered. Omit (the\n * default) to keep every glyph on its SDF tier.\n *\n * A *world* size rather than a screen size because layout knows nothing\n * about the view; `drawText` divides its screen-pixel threshold by the view\n * scale before calling, so zooming in lowers the world size that qualifies.\n *\n * This is a rendering switch only. Advances, kerning, wrapping and\n * baselines are identical either way — the outline tier changes what a\n * glyph looks like, never where it sits — so measurement callers\n * (`measureTextBounds`, `textLineBoxes`) leave it unset and still agree\n * with the paint, and crossing the threshold cannot reflow text.\n *\n * Ignored for a family that resolved to the outline tier because it has no\n * atlas: there the geometry is not an upgrade over another rendering, it is\n * the only one, so the threshold has nothing to choose between.\n */\n outlineMinSize?: number;\n}\n\ninterface LayoutContext {\n groups: Map<string, LaidOutGroup>;\n}\n\nfunction fillKey(p: FillStyle | null): string {\n if (p === null) return 'none';\n if ('color' in p) return `s:${p.color}:${p.opacity ?? 1}`;\n // Non-solid paints (gradients/patterns) defeat grouping in this slice —\n // every occurrence gets its own group. Acceptable in v1 since per-run\n // non-solid fills are rare; revisit if it bites perf.\n return `nx:${Math.random()}`;\n}\n\n/**\n * Whether two runs' fills paint the same, for the purpose of merging their\n * decoration rules. Solid paints compare by value so two separate runs set\n * to the same colour merge; anything else compares by reference, because a\n * gradient/pattern has no cheap structural equality and a false positive\n * would paint one run's rule with another's paint.\n */\nfunction sameFill(a: FillStyle | null, b: FillStyle | null): boolean {\n if (a === b) return true;\n if (a !== null && b !== null && 'color' in a && 'color' in b) {\n return a.color === b.color && (a.opacity ?? 1) === (b.opacity ?? 1);\n }\n return false;\n}\n\n/** Whether a stroke puts ink down — an omitted, unpainted or zero-width one\n * does not, and must not pull a run onto the outline tier for nothing. A\n * screen-pixel width is positive on the same terms; what it resolves to in\n * world units depends on a scale this layer does not have and does not need. */\nfunction strokePaints(s: Stroke | undefined): s is Stroke & { paint: FillStyle } {\n if (s?.paint === undefined) return false;\n const w = s.width ?? 1;\n return (typeof w === 'number' ? w : w.px) > 0;\n}\n\n/**\n * Draw state for a stroke, for grouping. Two runs stroked the same way share\n * a draw call; anything else has to split, since the group *is* the draw call\n * and one call paints one ribbon. Paint identity reuses `fillKey`, so a\n * gradient-stroked run gets its own group the same way a gradient-filled one\n * does.\n */\nfunction strokeKey(s: Stroke | undefined): string {\n if (!strokePaints(s)) return '-';\n const width = s.width ?? 1;\n return [\n // A screen-pixel width keys apart from the equal world-unit number: the two\n // resolve to different ribbons, so they must not share a draw call.\n fillKey(s.paint), typeof width === 'number' ? width : `px${width.px}`,\n s.join ?? 'miter', s.cap ?? 'butt',\n s.miterLimit ?? '', s.align ?? 'center', (s.dash ?? []).join(','),\n ].join(':');\n}\n\nfunction groupKey(\n family: string,\n weight: number,\n style: FontStyle,\n synthetic: { bold: boolean; italic: boolean },\n fill: FillStyle | null,\n stroke: Stroke | undefined,\n source: 'atlas' | 'canvas' | 'outline',\n page: number,\n): string {\n return `${family}|${weight}|${style}|${synthetic.bold ? 1 : 0}${synthetic.italic ? 1 : 0}|${fillKey(fill)}|${strokeKey(stroke)}|${source}|${page}`;\n}\n\n/**\n * `source` overrides the tier the resolver picked. Passed for outline glyphs,\n * which are served by a face the *resolver* still reports as atlas or canvas\n * — the tier decision for a glyph is made per glyph, not per run\n * — and which must not share a draw call with the quads around them.\n */\nfunction getOrCreateGroup(\n ctx: LayoutContext,\n run: ResolvedRun,\n resolved: ResolveResult,\n page: number,\n sourceOverride?: 'outline',\n): LaidOutGroup {\n // The *resolved* family, not the requested one. The renderer looks this up\n // with an exact `getFont`, so a group tagged with a family that has no atlas\n // uploads no texture and draws no quads — the run would occupy layout space\n // and paint nothing. It also has to be in the key: two requested families\n // substituting to different atlases must not collide, and two substituting to\n // the same atlas should merge into one draw call.\n const atlasFamily = resolved.resolved.family;\n const resolvedWeight = resolved.resolved.weight;\n const resolvedStyle = resolved.resolved.style;\n const source = sourceOverride ?? resolved.source;\n const key = groupKey(\n atlasFamily,\n resolvedWeight,\n resolvedStyle,\n resolved.synthetic,\n run.fill,\n source === 'outline' && strokePaints(run.stroke) ? run.stroke : undefined,\n source,\n page,\n );\n let g = ctx.groups.get(key);\n if (!g) {\n g = {\n family: atlasFamily,\n weight: resolvedWeight,\n style: resolvedStyle,\n synthetic: { ...resolved.synthetic },\n source,\n page,\n fill: run.fill,\n // Only the outline tier can paint it, and carrying it on an SDF group\n // would be a promise the renderer cannot keep.\n ...(source === 'outline' && strokePaints(run.stroke) ? { stroke: run.stroke } : {}),\n quads: [],\n glyphs: [],\n };\n ctx.groups.set(key, g);\n }\n return g;\n}\n\n/**\n * A glyph, plus which tier ended up serving it. `resolved`/`font` differ from\n * the run's own when a codepoint escalated to the dynamic tier — the caller\n * has to carry both, because they pick the group (shader, texture, page) and\n * the scale divisor (`font.info.size`).\n */\ninterface GlyphHit {\n glyph: BmFontChar;\n font: BmFont;\n resolved: ResolveResult;\n}\n\n/**\n * Find a glyph for `cp`, escalating past the run's atlas when it has none.\n *\n * Until 2026-07-29 a miss drew codepoint 63 — a literal `?`. That fabricates\n * a character the author never wrote and is indistinguishable from one they\n * did, which is how the committed text baseline came to read \"Themed editing\n * ? magenta caret\" for a whole commit without anyone noticing. Every real\n * text stack draws `.notdef` (tofu) precisely because it can't be mistaken\n * for content; the BmFont atlas format has no such glyph to draw, so the\n * order here is: the atlas, then the dynamic tier (which rasterizes from\n * installed fonts and can usually serve the character for real), then\n * nothing — with a warning naming the codepoint.\n */\nfunction resolveGlyph(\n run: ResolvedRun,\n font: BmFont,\n resolved: ResolveResult,\n cp: number,\n): GlyphHit | null {\n const direct = font.charMap.get(cp);\n if (direct) return { glyph: direct, font, resolved };\n\n const fallback = resolveGlyphFallback(run.fontFamily, run.fontWeight, run.fontStyle);\n const face = fallback?.dynamicFace;\n if (fallback && face) {\n const glyph = face.requestGlyph(cp);\n // A face that can't measure the codepoint reports a zero advance and no\n // ink — nothing worth switching groups for, so fall through to the warn.\n if (glyph.xadvance > 0 || glyph.width > 0) {\n return { glyph, font: face.font, resolved: fallback };\n }\n }\n\n warnMissingGlyphOnce(resolved.resolved.family, cp);\n return null;\n}\n\n// Layout runs per frame, so an unguarded warn would flood the console. Keyed\n// per (family, codepoint): one message per character the app actually can't\n// draw, however many times it appears.\n/**\n * Code point blocks whose strong characters read right-to-left.\n *\n * A heuristic on purpose: the real answer is `Bidi_Class`, which lives in\n * `@weasel-js/bidi` and is exactly what the caller has not installed when this\n * matters. Every range here is wholly right-to-left, so it can miss a script\n * but never accuse a left-to-right one.\n */\nconst RTL_BLOCKS: ReadonlyArray<readonly [number, number]> = [\n [0x0590, 0x05ff], [0x0600, 0x07bf], [0x0860, 0x08ff],\n [0xfb1d, 0xfdff], [0xfe70, 0xfeff],\n [0x10800, 0x10fff], [0x1e800, 0x1efff],\n];\n\nlet warnedLogicalRtl = false;\n\nfunction warnLogicalRtlOnce(): void {\n if (warnedLogicalRtl) return;\n warnedLogicalRtl = true;\n console.warn(\n // Naming the import in `from \"<pkg>\"` form would trip labkit's\n // consumer smoke test, which greps dist for that exact shape.\n 'weasel layoutRuns: this text contains right-to-left characters but no ' +\n '`bidi` engine was supplied, so it is being laid out in logical order — ' +\n 'the glyphs will appear reversed. Import `bidi` out of the ' +\n '`@weasel-js/bidi` package and add it to the layout options.',\n );\n}\n\n/** @internal Test seam — the warning fires once per process otherwise. */\nexport function _resetBidiWarningForTests(): void {\n warnedLogicalRtl = false;\n}\n\nconst warnedMissingGlyphs = new Set<string>();\n\nfunction warnMissingGlyphOnce(family: string, cp: number): void {\n const key = `${family}|${cp}`;\n if (warnedMissingGlyphs.has(key)) return;\n warnedMissingGlyphs.add(key);\n const ch = String.fromCodePoint(cp);\n console.warn(\n `weasel layoutRuns: no glyph for U+${cp.toString(16).toUpperCase().padStart(4, '0')} ` +\n `(${JSON.stringify(ch)}) in \"${family}\", and the dynamic tier could not ` +\n `rasterize it — skipping the character. Bake it into the atlas, or call ` +\n `registerCanvasFont(\"${family}\") to serve missing codepoints from ` +\n `installed fonts.`,\n );\n}\n\n/** @internal Test seam — the warn-once keys are module state. */\nexport function _resetMissingGlyphWarningsForTests(): void {\n warnedMissingGlyphs.clear();\n}\n\nconst warnedNoMetrics = new Set<string>();\n\nfunction warnNoMetricsOnce(family: string, weight: number, style: string): void {\n const key = `${family}|${weight}|${style}`;\n if (warnedNoMetrics.has(key)) return;\n warnedNoMetrics.add(key);\n console.warn(\n `weasel layoutRuns: no metrics for \"${family}\" ${weight}/${style} — neither ` +\n `an atlas nor an outline face resolved, so every run set in it lays out as ` +\n `nothing. Register it with registerFont / registerCanvasFont / ` +\n `registerFontOutlines. If you did, check for a duplicated @weasel-js/font in ` +\n `node_modules — its registry is module state, so a second copy is a second, ` +\n `empty one.`,\n );\n}\n\n/** @internal Test seam — the warn-once keys are module state. */\nexport function _resetNoMetricsWarningsForTests(): void {\n warnedNoMetrics.clear();\n}\n\n/**\n * Lay out `runs` into draw groups, decoration rules and line boxes. Wrapping,\n * baselines, tracking and decorations follow the rules in this file's module doc.\n */\nexport function layoutRuns(\n runs: readonly ResolvedRun[],\n opts: LayoutRunsOpts,\n): LaidOutRuns {\n const ctx: LayoutContext = { groups: new Map() };\n const align = resolveAlign(opts.align, opts.direction ?? 'ltr');\n const justify = opts.justify === true || opts.align === 'justify';\n\n // Per-glyph entry produced by walking runs codepoint-by-codepoint.\n // Position (x) is filled in during the line-fitting pass.\n interface Entry {\n run: ResolvedRun;\n /** The atlas to sample, or null on the outline tier, which has none. */\n font: BmFont | null;\n metrics: MetricsSource;\n glyph: BmFontChar | null;\n cp: number;\n advance: number; // xadvance in world units (already scaled)\n tracking: number; // run letterSpacing if this closes a cluster, else 0 (world units)\n kerningBefore: number; // kerning gap consumed before this glyph\n isSpace: boolean;\n isNewline: boolean;\n /** Whether this code point can put ink on the page — see `LaidOutCell`. */\n drawsInk: boolean;\n resolved: ResolveResult;\n fontSize: number;\n /** UTF-16 offset of this code point in the runs' concatenated text. */\n srcIndex: number;\n /** One past it — `srcIndex + 2` for an astral code point. */\n srcEnd: number;\n /** Position in the flat entry list, which is what the bidi engine indexes.\n * Survives the wrap's copies, unlike object identity. */\n flat: number;\n }\n /** The size an entry holds its line at — its run's, or the larger size a\n * shrunken run inherited. Glyphs are drawn at their own `fontSize`\n * regardless, which small caps sets below the run's. */\n const lineSize = (e: Entry): number => Math.max(e.run.fontSize, e.run.strutSize ?? 0);\n /**\n * How far above the baseline an entry's inline box reaches, CSS's way: the\n * face's ascent plus half the leading its line height leaves around ascent\n * and descent. A face taller than its line box gets negative leading and\n * overflows the box rather than growing it — the box stays `lineHeight`\n * tall either way.\n */\n const aboveBaseline = (e: Entry): number => {\n const k = lineSize(e) / e.metrics.size;\n const ascent = e.metrics.ascent * k;\n if (e.metrics.descent === undefined) return ascent;\n return (lineSize(e) * opts.lineHeight - ascent - e.metrics.descent * k) / 2 + ascent;\n };\n\n // 1. Flatten all runs into entries with per-glyph data, computing\n // kerning using the left glyph's atlas+scale across run boundaries.\n const entries: Entry[] = [];\n /** Each run's own face, which places its rules. Kept per run rather than\n * read off an entry, whose `resolved` may be a per-glyph fallback. */\n const runFaces = new Map<ResolvedRun, FaceMetrics | undefined>();\n let prevCp: number | undefined;\n let prevMetrics: MetricsSource | undefined;\n let prevFontSize: number | undefined;\n let srcIndex = 0;\n\n for (const run of runs) {\n const resolved = resolveFontVariant(run.fontFamily, run.fontWeight, run.fontStyle);\n runFaces.set(run, faceMetricsOf(resolved));\n const outlineFace = resolved.outlineFace;\n const font = resolved.entry?.font ?? resolved.dynamicFace?.font ?? null;\n // Em space is unit-scale, so a parsed face divides by 1 and its advances\n // are already the world-unit fractions of `fontSize` layout wants.\n const metrics: MetricsSource | undefined = outlineFace\n ? {\n size: 1,\n base: outlineFace.ascender,\n ascent: outlineFace.faceMetrics?.ascent ?? outlineFace.ascender,\n ...(outlineFace.faceMetrics?.descent !== undefined ? { descent: outlineFace.faceMetrics.descent } : {}),\n advanceOf: (cp) => outlineFace.advanceOf(cp),\n kernOf: (l, r) => outlineFace.kernOf(l, r),\n }\n : font ? atlasMetrics(font) : undefined;\n if (!metrics) {\n // A run with no metrics lays out as nothing, which is indistinguishable\n // from empty text downstream — the only signal a consumer ever gets.\n // A late face is not a missing one: the settle relayouts and asks again.\n if (!fontPending(run.fontFamily, run.fontWeight, run.fontStyle)) {\n warnNoMetricsOnce(run.fontFamily, run.fontWeight, run.fontStyle);\n }\n // Skipped, but its characters still occupy source offsets — dropping\n // them here would shift every later run's caret indices left.\n srcIndex += run.srcMap?.length ?? run.text.length;\n prevCp = undefined; prevMetrics = undefined; prevFontSize = undefined;\n continue;\n }\n const runBase = srcIndex;\n const map = run.srcMap;\n const sizes = run.sizeMap;\n let at = 0;\n // World units — deliberately not scaled by fontSize, so the same tracking\n // opens the same visual gap whatever size the run is set at.\n const runTracking = run.letterSpacing;\n const clusterEnds = runTracking === 0 ? null : new Set(graphemeEnds(run.text));\n\n for (const ch of [...run.text]) {\n const cp = ch.codePointAt(0)!;\n // Small caps sizes glyphs within the run, so the size is the glyph's.\n const fontSize = sizes ? sizes[at] : run.fontSize;\n const scale = fontSize / metrics.size;\n const tracking = clusterEnds === null || clusterEnds.has(at + ch.length) ? runTracking : 0;\n const isNewline = isHardLineBreak(cp);\n const isSpace = cp === 32;\n // A transformed run draws characters its source does not have; each\n // one takes the source span of the character it was mapped from.\n const srcStart = map ? runBase + map.starts[at] : runBase + at;\n const srcEnd = map ? runBase + map.ends[at] : runBase + at + ch.length;\n at += ch.length;\n srcIndex = map ? runBase + map.length : srcEnd;\n\n if (isNewline) {\n entries.push({\n run, font, metrics,\n glyph: { id: cp, x: 0, y: 0, width: 0, height: 0, xoffset: 0, yoffset: 0, xadvance: 0, page: 0 },\n // A newline consumes no advance, so it takes no tracking either.\n cp, advance: 0, tracking: 0, kerningBefore: 0, isSpace: false, isNewline: true,\n drawsInk: false,\n resolved, fontSize: fontSize, srcIndex: srcStart, srcEnd, flat: 0,\n });\n prevCp = undefined; prevMetrics = undefined; prevFontSize = undefined;\n continue;\n }\n\n if (isSpace) {\n // Use atlas glyph if present; otherwise synthesize a zero-size entry\n // with a reasonable advance so spaces still participate in line-fitting.\n const spaceGlyph = resolved.dynamicFace ? resolved.dynamicFace.requestGlyph(32) : font?.charMap.get(32) ?? null;\n const spaceAdvance = spaceGlyph ? spaceGlyph.xadvance : metrics.advanceOf(32);\n const advance = spaceAdvance !== null\n ? spaceAdvance * scale\n : fontSize * 0.25;\n let kerningBefore = 0;\n if (prevCp !== undefined && prevMetrics !== undefined && prevFontSize !== undefined) {\n kerningBefore = prevMetrics.kernOf(prevCp, cp) * (prevFontSize / prevMetrics.size);\n }\n entries.push({\n run, font, metrics,\n glyph: spaceGlyph ?? { id: 32, x: 0, y: 0, width: 0, height: 0, xoffset: 0, yoffset: 0, xadvance: 0, page: 0 },\n cp, advance, tracking, kerningBefore, isSpace: true, isNewline: false,\n drawsInk: false,\n resolved, fontSize: fontSize, srcIndex: srcStart, srcEnd, flat: 0,\n });\n prevCp = cp; prevMetrics = metrics; prevFontSize = fontSize;\n continue;\n }\n\n // The outline tier has no atlas to miss in and no tier below it to\n // escalate to: the face either has the glyph or the run does not\n // contain it. Its advance is the only thing needed to place it.\n if (outlineFace) {\n const adv = metrics.advanceOf(cp);\n if (adv === null) {\n entries.push({\n run, font: null, metrics, glyph: null, cp,\n advance: 0, tracking: 0, kerningBefore: 0, isSpace, isNewline: false,\n drawsInk: false,\n resolved, fontSize: fontSize, srcIndex: srcStart, srcEnd, flat: 0,\n });\n prevCp = cp; prevMetrics = metrics; prevFontSize = fontSize;\n continue;\n }\n let kerningBefore = 0;\n if (prevCp !== undefined && prevMetrics !== undefined && prevFontSize !== undefined) {\n kerningBefore = prevMetrics.kernOf(prevCp, cp) * (prevFontSize / prevMetrics.size);\n }\n entries.push({\n run, font: null, metrics, glyph: null, cp,\n advance: adv * scale,\n tracking, kerningBefore, isSpace, isNewline: false, drawsInk: !isSpace,\n resolved, fontSize: fontSize, srcIndex: srcStart, srcEnd, flat: 0,\n });\n prevCp = cp; prevMetrics = metrics; prevFontSize = fontSize;\n continue;\n }\n\n const hit = resolved.dynamicFace\n ? { glyph: resolved.dynamicFace.requestGlyph(cp), font: font!, resolved }\n : resolveGlyph(run, font!, resolved, cp);\n if (!hit) {\n entries.push({\n run, font: null, metrics, glyph: null, cp,\n advance: 0, tracking: 0, kerningBefore: 0, isSpace, isNewline: false,\n drawsInk: false,\n resolved, fontSize: fontSize, srcIndex: srcStart, srcEnd, flat: 0,\n });\n prevCp = cp; prevMetrics = metrics; prevFontSize = fontSize;\n continue;\n }\n // An escalated codepoint is served by a different atlas with its own\n // bake size, so its scale — and the group it lands in — are its own.\n const glyphFont = hit.font;\n const glyphMetrics = glyphFont === font ? metrics : atlasMetrics(glyphFont);\n const glyphScale = fontSize / glyphFont.info.size;\n\n let kerningBefore = 0;\n if (prevCp !== undefined && prevMetrics !== undefined && prevFontSize !== undefined) {\n kerningBefore = prevMetrics.kernOf(prevCp, cp) * (prevFontSize / prevMetrics.size);\n }\n\n entries.push({\n run, font: glyphFont, metrics: glyphMetrics, glyph: hit.glyph, cp,\n advance: hit.glyph.xadvance * glyphScale,\n tracking,\n kerningBefore,\n isSpace, isNewline: false, drawsInk: !isSpace,\n resolved: hit.resolved, fontSize: fontSize, srcIndex: srcStart, srcEnd, flat: 0,\n });\n\n prevCp = cp; prevMetrics = glyphMetrics; prevFontSize = fontSize;\n }\n }\n\n for (let i = 0; i < entries.length; i++) entries[i].flat = i;\n\n // The engine analyses the paragraph once; each line then asks for its own\n // range, because L1 resets trailing whitespace against a line's end.\n const analysis = opts.bidi\n ? opts.bidi.analyze(entries.map((e) => e.cp), opts.direction ?? 'auto')\n : null;\n if (!opts.bidi\n && entries.some((e) => RTL_BLOCKS.some(([lo, hi]) => e.cp >= lo && e.cp <= hi))) {\n warnLogicalRtlOnce();\n }\n\n // 2. Break the entries into lines — at hard breaks, and at UAX #14\n // opportunities when `maxWidth` is finite — then fill each one.\n interface Line {\n entries: Entry[];\n width: number;\n height: number;\n /** Set only for a line with no entries at all — the hard break that\n * closed it, which is the only carrier of the style a blank line should\n * take its height and baseline from. */\n blank?: Entry;\n /** Closed by the wrap rather than by a hard break or the end of the\n * text — the lines `justify` spreads. */\n wrapped?: boolean;\n }\n\n // An entry opening a line drops the kerning before it, and a space opening\n // one is a slot, not an indent — it keeps its cell so every code point\n // stays addressable, but takes no width.\n const openingWidth = (e: Entry): number => (e.isSpace ? 0 : e.advance + e.tracking);\n /** `sum[k]`: width of entries `[0, k)` set end to end. */\n const sum = new Float64Array(entries.length + 1);\n for (let k = 0; k < entries.length; k++) {\n const e = entries[k];\n sum[k + 1] = sum[k] + e.kerningBefore + e.advance + e.tracking;\n }\n const widthOf = (start: number, end: number): number =>\n openingWidth(entries[start]) + sum[end] - sum[start + 1];\n\n const lines: Line[] = [];\n for (const span of wrapLines(entries.map((e) => e.cp), opts.maxWidth, widthOf)) {\n const line: Line = { entries: [], width: 0, height: 0, ...(span.wrapped ? { wrapped: true } : {}) };\n if (span.start === span.end) {\n // A blank line still advances the pen, at the size of the break that\n // closed it, since no other entry can supply one. Without this `\"a\\n\\nb\"`\n // painted `b` directly under `a`.\n const brk = entries[span.end];\n line.height = lineSize(brk) * opts.lineHeight;\n line.blank = brk;\n }\n for (let k = span.start; k < span.end; k++) {\n const e = entries[k];\n const placed = k > span.start ? e\n : e.isSpace ? { ...e, kerningBefore: 0, advance: 0, tracking: 0 }\n : { ...e, kerningBefore: 0 };\n line.entries.push(placed);\n line.width += placed.kerningBefore + placed.advance + placed.tracking;\n line.height = Math.max(line.height, lineSize(e) * opts.lineHeight);\n }\n lines.push(line);\n }\n\n /**\n * Em-space outline for `e`, or `null` to leave it on its SDF tier.\n *\n * Every `null` here is a rung of the fallback ladder, and they are all\n * ordinary: the caller never opted in, the glyph is too small to be worth\n * it, the face has no outlines registered, its bytes are still loading or\n * failed to load, or the font simply has no such glyph. The tier is an\n * upgrade applied where it is available, never a requirement.\n */\n function outlineFor(e: Entry): string | null {\n const r0 = e.resolved.resolved;\n // An outline-only run has no atlas behind it. Every gate below trades one\n // rendering for another; here there is no other, so gating would paint\n // nothing at all.\n if (e.resolved.source === 'outline') {\n return glyphOutline(r0.family, r0.weight, r0.style, e.cp);\n }\n const min = opts.outlineMinSize;\n if (min === undefined) return null;\n // A stroked run ignores the size gate. The gate is there because the SDF\n // tiers reconstruct small text better than tessellated geometry does —\n // but they have no geometry to stroke, so leaving a stroked run below the\n // threshold drops the outline the consumer asked for rather than trading\n // one correct rendering for another.\n // Gated on the run's size, so a small-caps word is not split across tiers.\n if (e.run.fontSize < min && !strokePaints(e.run.stroke)) return null;\n // Synthetic bold is an SDF threshold shift, and a path has no threshold.\n // Emboldening geometry properly means offsetting the outline — the same\n // problem as stroke-to-fill, which the kit does not solve yet — and\n // painting the regular weight instead would make text get *lighter* as\n // you zoom past the threshold. Leave it with the tier that can fake it.\n // Synthetic italic is not in the same position: a shear is exact on\n // geometry, and the renderer applies it.\n if (e.resolved.synthetic.bold) return null;\n const r = e.resolved.resolved;\n return glyphOutline(r.family, r.weight, r.style, e.cp);\n }\n\n // 3. Lay out each line: apply alignment, then emit quads (and the\n // decoration rules that span them).\n const decorations: LaidOutDecoration[] = [];\n\n /** An open decoration span: contiguous entries on one line that agree on\n * which rules to draw, what colour to draw them, and the metrics that set\n * their placement. `x1` grows as the pen walks. */\n interface DecoSpan {\n underline: boolean;\n strikethrough: boolean;\n overline: boolean;\n fill: FillStyle;\n fontSize: number;\n face: FaceMetrics | undefined;\n baselineY: number;\n x0: number;\n x1: number;\n }\n let span: DecoSpan | null = null;\n\n function flushSpan(): void {\n const s = span;\n span = null;\n if (!s || s.x1 <= s.x0) return;\n for (const kind of DECORATION_KINDS) {\n if (!s[kind]) continue;\n const { y0, y1 } = decorationRule(kind, s.baselineY, s.fontSize, s.face);\n decorations.push({ kind, x0: s.x0, y0, x1: s.x1, y1, fill: s.fill });\n }\n }\n\n const lineBoxes: LaidOutLineBox[] = [];\n let penY = 0;\n let maxLineWidth = 0;\n const alignWidth = opts.alignWidth ?? opts.maxWidth;\n for (const line of lines) {\n // Trailing whitespace hangs: CSS aligns a line on its ink, so a line that\n // happens to end in a space sits where it would without one. The space\n // keeps its cell and its advance — it just hangs past the aligned edge.\n let hung = 0;\n for (let k = line.entries.length - 1; k >= 0; k--) {\n const e = line.entries[k];\n if (!e.isSpace) break;\n hung += e.kerningBefore + e.advance + e.tracking;\n }\n const inkWidth = line.width - hung;\n // Justification: the interior spaces, each widened by an equal share of\n // the slack. Leading spaces are zero-width slots and trailing ones hang,\n // so neither is a gap between words.\n const gaps = new Set<number>();\n let gapExtra = 0;\n if (justify && line.wrapped && Number.isFinite(alignWidth) && alignWidth > inkWidth) {\n let first = 0;\n while (first < line.entries.length && line.entries[first].isSpace) first++;\n let last = line.entries.length - 1;\n while (last > first && line.entries[last].isSpace) last--;\n for (let k = first + 1; k < last; k++) if (line.entries[k].isSpace) gaps.add(k);\n if (gaps.size > 0) gapExtra = (alignWidth - inkWidth) / gaps.size;\n }\n const spread = gapExtra * gaps.size;\n const alignShift = (() => {\n if (spread > 0) return 0;\n if (align === 'left') return 0;\n // The boxless anchor matches the canvas-2D `renderLabel` model, so\n // point-anchored labels center on x in both backends.\n if (!Number.isFinite(alignWidth)) {\n return align === 'center' ? -inkWidth / 2 : -inkWidth;\n }\n const slack = alignWidth - inkWidth;\n return align === 'center' ? slack / 2 : slack;\n })();\n const lineX0 = alignShift;\n // One baseline for the whole line, sunk far enough below the line top to\n // clear whichever run reaches highest above it — so runs set at different\n // sizes sit on it together instead of each hanging from the line top at\n // its own depth. A blank line has no entry to measure, so it falls back\n // to the newline that closed it.\n //\n // Deliberately computed from *unshifted* ascents: a run's `baselineShift`\n // moves it off this baseline, so letting the shift feed back into the\n // baseline it is measured against would drag the rest of the line with it.\n let lineAscent = 0;\n for (const e of line.entries) lineAscent = Math.max(lineAscent, aboveBaseline(e));\n if (line.entries.length === 0 && line.blank) lineAscent = aboveBaseline(line.blank);\n const lineBaselineY = penY + lineAscent;\n\n const cells: LaidOutCell[] = new Array(line.entries.length);\n\n // Visual order for this line, as positions within `line.entries`. Without\n // an engine that is logical order, and everything below collapses to the\n // straight left-to-right walk it was.\n const flatOf = line.entries.map((e) => e.flat);\n const posOfFlat = new Map<number, number>();\n flatOf.forEach((f, pos) => posOfFlat.set(f, pos));\n let visual: number[] = line.entries.map((_, k) => k);\n let levelOf: (pos: number) => number = () => 0;\n if (opts.bidi && analysis !== null && line.entries.length > 0) {\n const from = flatOf[0];\n const to = flatOf[flatOf.length - 1] + 1;\n const r = opts.bidi.reorder(analysis, from, to);\n const seen = new Set<number>();\n const ordered: number[] = [];\n for (const f of r.order) {\n const pos = posOfFlat.get(f);\n if (pos !== undefined && !seen.has(pos)) { ordered.push(pos); seen.add(pos); }\n }\n // A position the engine dropped is a formatting control it removed; it\n // still holds a cell here, placed where it sits logically.\n for (let k = 0; k < line.entries.length; k++) if (!seen.has(k)) ordered.push(k);\n visual = ordered;\n levelOf = (pos) => {\n const l = r.levels[flatOf[pos] - from];\n return typeof l === 'number' && l >= 0 ? l : 0;\n };\n }\n\n // L4 — a bracket in a right-to-left run paints as its mirror. Done here\n // rather than during analysis because the same code point mirrors in one\n // run and not in another, and the level is only known now.\n if (opts.bidi) {\n for (let pos = 0; pos < line.entries.length; pos++) {\n if (levelOf(pos) % 2 === 0) continue;\n const e = line.entries[pos];\n const m = opts.bidi.mirror(e.cp);\n if (m === null || m === e.cp) continue;\n // The outline tier reads `cp` directly; the atlas tier needs the other\n // glyph looked up. A face without it keeps the unmirrored one.\n if (e.font !== null) {\n const hit = resolveGlyph(e.run, e.font, e.resolved, m);\n if (!hit) continue;\n e.glyph = hit.glyph;\n }\n e.cp = m;\n }\n }\n\n let penX = lineX0;\n let prevPos = -1;\n for (const pos of visual) {\n const e = line.entries[pos];\n // Kerning is a gap between two *adjacent* characters, and the wrap\n // measured it logically. Reordering can put a different pair side by\n // side: take the gap that belongs to whichever of the two is logically\n // second, and none at all across a direction boundary, where the pair\n // never touched in the source.\n penX += prevPos < 0 ? 0\n : pos === prevPos + 1 ? e.kerningBefore\n : prevPos === pos + 1 ? line.entries[prevPos].kerningBefore\n : 0;\n prevPos = pos;\n // One step per character: the glyph's advance plus its run's tracking,\n // plus a justified gap's share of the slack. Every branch below moves\n // the pen by exactly this, so glyph positions stay in step with the line\n // width accumulated above.\n const step = e.advance + e.tracking + (gaps.has(pos) ? gapExtra : 0);\n const cell: LaidOutCell = {\n srcIndex: e.srcIndex, srcEnd: e.srcEnd, cp: e.cp, x: penX,\n advance: step, level: levelOf(pos),\n drawsInk: e.drawsInk,\n };\n cells[pos] = cell;\n const scale = e.fontSize / e.metrics.size;\n // Positive raises, and y grows down, so the shift subtracts. Everything\n // below places against `baselineY` and so follows the run up or down —\n // its glyphs, its outline geometry and its decoration rules alike.\n // `?? 0` because 0 is the identity and the authored run type already\n // makes the field optional. Absent it, every vertical coordinate on the\n // quad goes NaN while x and the UVs stay right, so the glyphs draw as\n // zero-area quads and the text reports as \"rendered nothing\".\n const baselineY = lineBaselineY - (e.run.baselineShift ?? 0);\n\n // Extend or (re)open the decoration span *before* the no-ink bail-out\n // below, so a decorated span's spaces stay under the rule. `step`\n // includes this glyph's trailing tracking, so the rule covers it — the\n // CSS rule, and the same span the line width already accounts for.\n // An unfilled run's rules are dropped with its glyphs: a rule is a solid\n // rect with only a fill to paint it, and no stroked counterpart.\n const decoFill = e.run.fill;\n if (decoFill !== null && (e.run.underline || e.run.strikethrough || e.run.overline)) {\n const face = runFaces.get(e.run);\n if (\n span !== null\n && span.underline === e.run.underline\n && span.strikethrough === e.run.strikethrough\n && span.overline === e.run.overline\n && span.fontSize === e.run.fontSize\n && span.face === face\n && span.baselineY === baselineY\n && sameFill(span.fill, e.run.fill)\n ) {\n // Absorbs the kerning gap we just stepped over, so a run join\n // between two identically-decorated runs shows no seam.\n span.x1 = penX + step;\n } else {\n flushSpan();\n span = {\n underline: e.run.underline,\n strikethrough: e.run.strikethrough,\n overline: e.run.overline,\n fill: decoFill,\n // The run's size, not the glyph's: a small-caps word is one rule.\n fontSize: e.run.fontSize,\n face,\n baselineY,\n x0: penX,\n x1: penX + step,\n };\n }\n } else {\n flushSpan();\n }\n\n // Outline tier, decided per glyph at its run's size. Checked before the\n // no-ink bail-out below, not after: a dynamic-tier glyph still waiting\n // for its bake has `page < 0` and no atlas rect, but its outline is\n // available right now — there is no reason to draw nothing while the\n // exact geometry is in hand.\n const outlineD = outlineFor(e);\n // An unfilled run paints through its stroke, and only tessellated\n // geometry can carry one — an atlas quad would paint the fill that was\n // refused, so it is not emitted at all.\n if (e.run.fill === null\n && !(outlineD !== null && strokePaints(e.run.stroke))) {\n penX += step;\n continue;\n }\n if (outlineD !== null) {\n const group = getOrCreateGroup(ctx, e.run, e.resolved, 0, 'outline');\n group.glyphs.push({\n d: outlineD,\n key: `${e.resolved.resolved.family}|${e.resolved.resolved.weight}|${e.resolved.resolved.style}|${e.cp}`,\n x: penX,\n baselineY,\n // Em space is unit-scale, so world units per em is just the size.\n scale: e.fontSize,\n });\n penX += step;\n continue;\n }\n\n // Nothing to paint — a zero-advance glyph (e.g. a combining mark), a\n // zero-area one (a space in either source), or a dynamic glyph not baked\n // yet (page < 0). Advance the pen anyway so the line doesn't reflow when\n // a bake lands, and so a space's tracking still separates its neighbors.\n if (e.font === null || e.glyph === null\n || e.advance === 0 || e.glyph.width === 0 || e.glyph.page < 0) {\n penX += step;\n continue;\n }\n const group = getOrCreateGroup(ctx, e.run, e.resolved, e.glyph.page);\n const atlasW = e.font.common.scaleW;\n const atlasH = e.font.common.scaleH;\n const qx0 = penX + e.glyph.xoffset * scale;\n // `yoffset` is measured from the line top in the atlas's own frame, so\n // it is relative to that frame's baseline (`metrics.base`) — which is\n // what lets a run hang off the line's shared baseline rather than off\n // the line top, where its own ascent would place it.\n const qy0 = baselineY + (e.glyph.yoffset - e.metrics.base) * scale;\n const qx1 = qx0 + e.glyph.width * scale;\n const qy1 = qy0 + e.glyph.height * scale;\n const u0 = e.glyph.x / atlasW;\n const v0 = e.glyph.y / atlasH;\n const u1 = (e.glyph.x + e.glyph.width) / atlasW;\n const v1 = (e.glyph.y + e.glyph.height) / atlasH;\n // `baselineY` (computed above) is the typographic baseline, not the top\n // of the line box — above-baseline vertices have y < baselineY so the\n // synthetic italic skew leans them right.\n group.quads.push({ x0: qx0, y0: qy0, x1: qx1, y1: qy1, u0, v0, u1, v1, baselineY });\n penX += step;\n }\n // A rule never crosses a line break: close the span at end of line.\n flushSpan();\n // Closing stop: the line's right edge, at the offset just past its last\n // character. A blank line has no cell to close, so its only stop is the\n // newline that made it.\n const lastCell = line.entries[line.entries.length - 1];\n const srcEnd = lastCell ? lastCell.srcEnd : (line.blank?.srcIndex ?? 0);\n lineBoxes.push({\n x0: lineX0,\n y0: penY,\n x1: lineX0 + line.width + spread,\n y1: penY + line.height,\n baselineY: lineBaselineY,\n cells,\n srcEnd,\n });\n maxLineWidth = Math.max(maxLineWidth, inkWidth + spread);\n penY += line.height;\n }\n\n // `bounds` measures line boxes only — a decoration rule, and a run shifted\n // off the baseline, can both fall outside it.\n // An underline's bottom sits `base * scale + (UNDERLINE_OFFSET +\n // DECORATION_THICKNESS) * fontSize` below the line top, so it escapes the\n // last line once `lineHeight` drops below roughly `base / info.size + 0.15`\n // (≈1.06 for the bundled atlases). An overline escapes the first line the\n // other way for a face whose `base / info.size` is under 0.90, and a\n // `baselineShift` escapes by however far it exceeds the slack around it.\n // None of these are reachable at the 1.2 default with the bundled atlases\n // and the `script` presets, so `measureTextBounds` and\n // `verticalAlign: 'bottom'` are left as they are; tightening the box would\n // move every existing text bound.\n return {\n groups: [...ctx.groups.values()],\n decorations,\n lines: lineBoxes,\n bounds: { width: maxLineWidth, height: penY },\n };\n}\n","/**\n * Laid-out text, memoized. The one entry point every caller of `layoutRuns`\n * should reach for — the renderer's paint path, the silhouette measurement\n * behind picking, and caret hit-testing all answer from this.\n *\n * `layoutRuns` is the most expensive derivation in the kit — it walks every\n * codepoint, resolves a face per run, measures, wraps, aligns, and places a\n * quad or an outline glyph for each — and `drawText` ran it per text command\n * per frame. Measured: 2.0 ms/frame for 200 short labels, 9.3 for 1000, and\n * 25.9 for 200 wrapped paragraphs. That last figure is the entire frame\n * budget spent before a single triangle is drawn.\n *\n * ### Two keys, tried in order\n *\n * **Array identity**, in a `WeakMap`, the same contract as the renderer's\n * `WeakMap<Path, Mesh>` — and for the same reason: it makes the entry\n * collectable with whatever owns the runs, and the lookup is a pointer\n * compare. `kit:text`'s memoized `paint` hands back a stable array per node,\n * so the renderer stays on this path.\n *\n * **Structure**, in a bounded `Map`, for every caller that cannot. Measuring\n * a pose resolves its style and allocates a fresh `ResolvedRun[]` each call,\n * so an identity-keyed cache could never hold anything for it — and those\n * callers run on the drag path, once per pose change. Serializing the runs is\n * real work, unlike the pointer compare above, which is exactly why it is\n * second: an identity hit never pays for it.\n *\n * Under either, one entry per distinct `(maxWidth, alignWidth, lineHeight,\n * align, outline threshold)`. Position is deliberately absent: `layoutRuns` emits\n * origin-relative geometry and `drawText` translates at upload, so a text node\n * dragged across the page keeps hitting the same entry.\n *\n * ### The outline threshold\n *\n * `outlineMinSize` is derived from the view scale, so recording it literally\n * would miss on every frame of a zoom. It reaches `layoutRuns` through exactly\n * one comparison (`run.fontSize < min`, in `outlineFor`), so what the layout\n * actually depends on is *which runs clear the bar* — and since the test is a\n * plain `>=` on size, that set is pinned by how many of the distinct run sizes\n * clear it. Recording that count is exact, not a quantization: the entry stays\n * valid across every zoom that doesn't cross a glyph size, and is dropped the\n * moment one does.\n *\n * ### What the keys cannot see\n *\n * The font set. A face landing changes metrics with no change to the runs, so\n * every lookup compares `glyphGeneration()` — advanced by the dynamic SDF\n * atlas, by the outline registry, and by `registerFont` — and drops\n * everything when it moves. That is the same escape hatch `nodeMemo`'s\n * generation counter provides, for the same class of failure. Polled rather\n * than subscribed: a module-load subscription is a cross-package side effect\n * that makes importing this package require the font package's whole surface.\n *\n * ### Bounds\n *\n * Variants per runs array are capped and evicted wholesale, matching\n * `outlineMeshCache`: the refill cost is one layout, and the bookkeeping would\n * cost more than the misses it avoids. The structural map cannot ride an\n * array's lifetime the way the `WeakMap` does — nothing collects its keys —\n * so it is a real LRU with a hard entry count.\n */\n\nimport type { FillStyle, Stroke } from '@weasel-js/paint';\nimport { glyphGeneration } from '@weasel-js/font';\nimport type { ResolvedRun } from '../runs/resolveRuns';\nimport { layoutRuns, type LaidOutRuns, type LayoutRunsOpts } from './layoutRuns';\n\n/** Distinct option combinations held for one runs array before the whole set\n * is dropped. Sized for \"a few views onto the same text\". */\nexport const LAYOUT_CACHE_VARIANT_LIMIT = 8;\n\n/** Layouts held against the structural key before the least recently used one\n * is dropped. Sized for \"every text node visible on a page, plus slack\". */\nexport const LAYOUT_CACHE_STRUCTURAL_LIMIT = 64;\n\ninterface Entry {\n /** `generation` when this entry was filled. */\n generation: number;\n byVariant: Map<string, LaidOutRuns>;\n}\n\nlet cache = new WeakMap<readonly ResolvedRun[], Entry>();\nlet structural = new Map<string, LaidOutRuns>();\nlet structuralGeneration = -1;\n\n/**\n * How many of the distinct font sizes present in `runs` reach `min`. Equal\n * counts mean the same set of runs cleared the threshold, since the count is\n * monotonic in `min` over a fixed `runs` — which is what makes this a key.\n * Stroked runs need no term of their own: a stroke pulls its run onto the\n * outline tier at every `min`, so it cannot distinguish two of them.\n *\n * Returns `-1` for an absent threshold, which must stay distinct from \"a\n * threshold no run reaches\": measurement callers leave it unset, and\n * conflating the two would let a measurement answer a paint.\n */\nfunction outlineBucket(runs: readonly ResolvedRun[], min: number | undefined): number {\n if (min === undefined) return -1;\n const sizes = new Set<number>();\n for (const r of runs) sizes.add(r.fontSize);\n let n = 0;\n for (const size of sizes) if (size >= min) n++;\n return n;\n}\n\nfunction variantKey(runs: readonly ResolvedRun[], opts: LayoutRunsOpts): string {\n const alignWidth = opts.alignWidth ?? opts.maxWidth;\n const justify = opts.justify === true || opts.align === 'justify';\n return `${opts.maxWidth}|${alignWidth}|${opts.lineHeight}|${opts.align}|${justify ? 'j' : ''}|${outlineBucket(runs, opts.outlineMinSize)}`;\n}\n\nlet nextRefId = 1;\nconst refIds = new WeakMap<object, number>();\n\n/** A stable id for a paint this key cannot serialize. */\nfunction refId(o: object): number {\n let id = refIds.get(o);\n if (id === undefined) {\n id = nextRefId++;\n refIds.set(o, id);\n }\n return id;\n}\n\n/**\n * A paint's contribution to the key. Solid paints compare by value, so two\n * runs set to the same colour share a layout; gradients and patterns get a\n * per-object id, because they have no cheap structural equality and a false\n * positive would hand back groups carrying the wrong paint.\n *\n * `layoutRuns`'s own `fillKey` mints a fresh random string for the non-solid\n * case — fine for grouping within one layout, useless as a cache key.\n */\nfunction paintKey(p: FillStyle | null): string {\n if (p === null) return 'none';\n return 'color' in p ? `s${p.color}:${p.opacity ?? 1}` : `#${refId(p)}`;\n}\n\nfunction strokeKey(s: Stroke | undefined): string {\n // A stroke with no paint draws nothing, so it keys as no stroke at all.\n if (!s?.paint) return '-';\n const width = s.width ?? 1;\n return [\n paintKey(s.paint), typeof width === 'number' ? width : `px${width.px}`,\n s.join ?? 'miter', s.cap ?? 'butt',\n s.miterLimit ?? '', s.align ?? 'center', (s.dash ?? []).join(','),\n ].join(':');\n}\n\n/**\n * Everything about `runs` that changes the layout. The two author-supplied\n * strings are length-prefixed so neither can forge a neighbouring field by\n * containing a separator; every other term is a number, an enum, or a paint\n * already escaped by `paintKey`.\n */\nfunction runsKey(runs: readonly ResolvedRun[]): string {\n let out = '';\n for (const r of runs) {\n out += `${r.text.length}:${r.text}|${r.fontFamily.length}:${r.fontFamily}`\n + `|${r.fontSize}|${r.fontWeight}|${r.fontStyle}|${r.letterSpacing}`\n + `|${r.underline ? 1 : 0}${r.strikethrough ? 1 : 0}${r.overline ? 1 : 0}`\n + `|${r.baselineShift}`\n + `|${paintKey(r.fill)}|${strokeKey(r.stroke)}`\n // Ends follow from starts and the length, so the two pin the cells.\n + `|${r.srcMap ? `${r.srcMap.length}:${r.srcMap.starts.join(',')}` : ''}`\n + `|${r.sizeMap ? r.sizeMap.join(',') : ''}|`;\n }\n return out;\n}\n\n/**\n * Lay `runs` out, reusing the previous result when nothing it depends on has\n * changed. Drop-in for `layoutRuns` — same arguments, same return value.\n *\n * **The result is shared and must be treated as immutable.** `drawText`\n * applies position and `verticalAlign` while packing vertices rather than by\n * shifting the layout, precisely so it can be handed the same object every\n * frame.\n */\nexport function cachedLayoutRuns(\n runs: readonly ResolvedRun[],\n opts: LayoutRunsOpts,\n): LaidOutRuns {\n // Polled, not subscribed. A module-level `subscribeGlyphReady` would be a\n // load-time side effect reaching into another package — it made importing\n // the renderer require the font package's whole surface, breaking any\n // consumer that partially mocks it.\n const fonts = glyphGeneration();\n let entry = cache.get(runs);\n if (entry === undefined) {\n entry = { generation: fonts, byVariant: new Map() };\n cache.set(runs, entry);\n } else if (entry.generation !== fonts) {\n entry.generation = fonts;\n entry.byVariant.clear();\n }\n\n const key = variantKey(runs, opts);\n const hit = entry.byVariant.get(key);\n if (hit !== undefined) return hit;\n\n if (structuralGeneration !== fonts) {\n structural.clear();\n structuralGeneration = fonts;\n }\n const structuralK = `${runsKey(runs)}\u0000${key}`;\n let laid = structural.get(structuralK);\n if (laid !== undefined) {\n // Re-insert to move it to the young end; `Map` iterates in insertion order,\n // which is what makes `keys().next()` the least recently used.\n structural.delete(structuralK);\n } else {\n laid = layoutRuns(runs, opts);\n if (structural.size >= LAYOUT_CACHE_STRUCTURAL_LIMIT) {\n structural.delete(structural.keys().next().value!);\n }\n }\n structural.set(structuralK, laid);\n\n if (entry.byVariant.size >= LAYOUT_CACHE_VARIANT_LIMIT) entry.byVariant.clear();\n entry.byVariant.set(key, laid);\n return laid;\n}\n\n/** Test helper. Do not call from product code. */\nexport function _resetLayoutCacheForTests(): void {\n cache = new WeakMap();\n structural = new Map();\n structuralGeneration = -1;\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -1,8 +1,38 @@
1
- import { S as StyledRun, T as TextStyle, L as LaidOutRuns, R as ResolvedTextStyle, a as ResolvedRun, b as LayoutRunsOpts } from './test-seams-D0C8kEcX.js';
2
- export { B as BidiAnalysis, c as BidiReordering, d as BidiResolver, D as DEFAULT_TEXT_STYLE, e as LAYOUT_CACHE_STRUCTURAL_LIMIT, f as LAYOUT_CACHE_VARIANT_LIMIT, g as LaidOutCell, h as LaidOutDecoration, i as LaidOutGroup, j as LaidOutLineBox, k as LaidOutOutlineGlyph, l as LaidOutQuad, M as MARKDOWN_RUN_GRAMMAR, m as RunFlag, n as RunGrammar, o as RunMarker, p as RunSourceMap, q as SCRIPT_METRICS, r as TextAlign, s as TextDirection, t as TextPaint, u as TextTransform, v as TransformedRunText, w as cachedLayoutRuns, x as fontString, y as layoutRuns, z as markdownToRuns, A as resolveAlign, C as resolveRuns, E as resolveTextStyle, F as runsToMarkdown, G as runsToPlainText, H as toRuns, I as transformRunTexts } from './test-seams-D0C8kEcX.js';
1
+ import { S as StyledRun, T as TextStyle, L as LaidOutRuns, R as ResolvedTextStyle, a as ResolvedRun, b as LayoutRunsOpts } from './test-seams-DbGu8K5F.js';
2
+ export { B as BidiAnalysis, c as BidiReordering, d as BidiResolver, D as DEFAULT_DECORATION_METRICS, e as DEFAULT_TEXT_STYLE, f as DecorationKind, F as FontVariantCaps, g as LAYOUT_CACHE_STRUCTURAL_LIMIT, h as LAYOUT_CACHE_VARIANT_LIMIT, i as LaidOutCell, j as LaidOutDecoration, k as LaidOutGroup, l as LaidOutLineBox, m as LaidOutOutlineGlyph, n as LaidOutQuad, M as MARKDOWN_RUN_GRAMMAR, o as RunFlag, p as RunGrammar, q as RunMarker, r as RunSourceMap, s as SCRIPT_METRICS, t as SMALL_CAPS_SCALE, u as ScriptPreset, v as SmallCapsText, w as TextAlign, x as TextDirection, y as TextPaint, z as TextTransform, A as TransformedRunText, C as cachedLayoutRuns, E as decorationMetrics, G as fontString, H as isBoldWeight, I as isSmallCapsLetter, J as layoutRuns, K as markdownToRuns, N as numericWeight, O as resolveAlign, P as resolveRunFace, Q as resolveRuns, U as resolveTextStyle, V as runsToMarkdown, W as runsToPlainText, X as scriptMetrics, Y as scriptMetricsFor, Z as smallCapsScale, _ as smallCapsScaleFor, $ as smallCapsText, a0 as toRuns, a1 as transformRunTexts } from './test-seams-DbGu8K5F.js';
3
3
  import { FillStyle, Stroke } from '@weasel-js/paint';
4
4
  import { Rect } from '@weasel-js/geom';
5
- import '@weasel-js/font';
5
+ import { FaceMetrics } from '@weasel-js/font';
6
+
7
+ /**
8
+ * Line break opportunities per the Unicode Line Breaking Algorithm
9
+ * (UAX #14), default rules, no tailoring: where a line may end, not where it
10
+ * does. Choosing among the opportunities is the wrap's job.
11
+ *
12
+ * Rules LB2–LB31 are applied in order at every position. LB9 is applied up
13
+ * front: a combining mark or ZWJ that follows a base joins it into one unit
14
+ * carrying the base's class, so every later rule reads units, never marks.
15
+ */
16
+ /** No opportunity before this position. */
17
+ declare const NO_BREAK = 0;
18
+ /** A line may end before this position. */
19
+ declare const BREAK_ALLOWED = 1;
20
+ /** A line must end before this position: after a hard line break, and at the end of text. */
21
+ declare const BREAK_MANDATORY = 2;
22
+ /**
23
+ * Whether a line must end after `cp`: UAX #14's hard breaks, which are LF,
24
+ * VT, FF, CR, NEL, U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR. A CR
25
+ * directly before an LF makes one break with it, not two.
26
+ */
27
+ declare function isHardLineBreak(cp: number): boolean;
28
+ /**
29
+ * For each position `0..cps.length`, whether a line may break before it:
30
+ * {@link NO_BREAK}, {@link BREAK_ALLOWED} or {@link BREAK_MANDATORY}. Position
31
+ * 0 never breaks and position `cps.length` always does.
32
+ *
33
+ * `cps` is code points, not UTF-16 units — one entry per scalar value.
34
+ */
35
+ declare function lineBreakOpportunities(cps: ArrayLike<number>): Uint8Array;
6
36
 
7
37
  /**
8
38
  * Box vertical alignment for text draw commands. Given the command's box
@@ -51,6 +81,7 @@ interface TextPoseLayoutInput {
51
81
  runs: ResolvedRun[];
52
82
  opts: LayoutRunsOpts & {
53
83
  align: 'left' | 'center' | 'right';
84
+ justify: boolean;
54
85
  };
55
86
  }
56
87
  /**
@@ -77,18 +108,18 @@ interface TextPoseLayout {
77
108
  declare function layoutTextPose(pose: TextPose, scale?: number): TextPoseLayout;
78
109
 
79
110
  /**
80
- * Wrap-aware text measurement. Greedy word-wrap against `maxWidth` using
81
- * `ctx.measureText`. Lines explicitly broken by `\n` are preserved; long
82
- * single words that exceed `maxWidth` are emitted on their own line without
83
- * mid-word breaking (caller can decide to clip).
111
+ * Wrap-aware text measurement for a 2D context. Lines end where `layoutRuns`
112
+ * ends them — at UAX #14 break opportunities when a word would overflow
113
+ * `maxWidth`, and at every hard break — through the same `wrapLines`, with
114
+ * widths from `ctx.measureText` plus tracking. A word wider than `maxWidth`
115
+ * is emitted on its own line unbroken (caller can decide to clip).
84
116
  *
85
117
  * Returns the laid-out lines, the total block height in world units
86
118
  * (`lines.length * fontSize * lineHeight`), and per-line `lineStarts` —
87
- * the offset of each line's first character in the original `text`. The
88
- * starts are used by `caretIndexAt` to map a clicked (x, y) back to a
89
- * character offset in the source string. Trailing whitespace consumed by
90
- * the wrap is not included in `lines[i]` but is implicit in the gap
91
- * between `lineStarts[i] + lines[i].length` and `lineStarts[i + 1]`.
119
+ * the UTF-16 offset of each line's first character in `text`, which
120
+ * `caretIndexAt` uses to map a clicked (x, y) back to a source offset.
121
+ * Trailing spaces hang and are not included in `lines[i]`; neither is the
122
+ * hard break that closed it.
92
123
  *
93
124
  * The caller owns the `ctx.font` setup — pass a context whose `font`
94
125
  * already matches `style` (use `fontString(style)`).
@@ -99,7 +130,7 @@ declare function layoutTextPose(pose: TextPose, scale?: number): TextPoseLayout;
99
130
  *
100
131
  * `letter-spacing` is not part of the CSS `font` shorthand, so a context
101
132
  * whose `font` was set from `fontString(style)` measures glyphs only. The
102
- * GL path (`layoutRuns`) adds `letterSpacing` after **every** code point
133
+ * GL path (`layoutRuns`) adds `letterSpacing` after every grapheme cluster
103
134
  * including the last, matching CSS, so this does too — and every 2D-side
104
135
  * width has to go through here or the two paths disagree about where a line
105
136
  * breaks.
@@ -111,7 +142,10 @@ interface MeasuredText {
111
142
  lineStarts: number[];
112
143
  height: number;
113
144
  }
114
- /** Greedy word-wrap text measurement against `maxWidth`; preserves explicit `\n` breaks. */
145
+ /**
146
+ * Wrap `text` against `maxWidth` at the break opportunities `layoutRuns`
147
+ * wraps at, measuring with `ctx`.
148
+ */
115
149
  declare function measureText(ctx: CanvasRenderingContext2D, text: string, maxWidth: number, style: ResolvedTextStyle): MeasuredText;
116
150
 
117
151
  /** Options for `measureTextBounds`. */
@@ -180,6 +214,10 @@ declare function textLineBoxes(pose: TextPose, opts?: TextLineBoxesOpts): Rect[]
180
214
 
181
215
  /** Width-measurement strategy for `layoutMarkdown`; canvas-backed default supplied by `createMarkdownRenderer`. */
182
216
  type MeasureFn = (text: string, fontSize: number, bold: boolean, italic: boolean) => number;
217
+ /** The face a run's rules and script presets come from, for `layoutMarkdown`.
218
+ * `createMarkdownRenderer` supplies one that looks the family up in the font
219
+ * registry, so a registered face places them as it does on the GL tier. */
220
+ type FaceMetricsFn = (bold: boolean, italic: boolean) => FaceMetrics | undefined;
183
221
  /** A `StyledRun` with its resolved size and its position relative to the
184
222
  * start of its line: `x` along the line, `y` off its baseline. */
185
223
  interface PositionedRun extends StyledRun {
@@ -192,6 +230,8 @@ interface PositionedRun extends StyledRun {
192
230
  /** The run's font size in px, with `fontScale` and `script` already folded
193
231
  * in. Resolved once here so layout and paint cannot disagree about it. */
194
232
  size: number;
233
+ /** The face that placed the run's script and places its rules. */
234
+ face?: FaceMetrics;
195
235
  }
196
236
  /** A single laid-out line of text: its positioned runs, total width, and computed line height. */
197
237
  interface LayoutLine {
@@ -205,8 +245,12 @@ interface LayoutResult {
205
245
  width: number;
206
246
  height: number;
207
247
  }
208
- /** Word-wrap parsed runs into lines bounded by `maxWidth`; pass `Infinity` for single-line layout. */
209
- declare function layoutMarkdown(runs: StyledRun[], maxWidth: number, fontSize: number, measure: MeasureFn, lineHeightFactor?: number): LayoutResult;
248
+ /**
249
+ * Word-wrap parsed runs into lines bounded by `maxWidth`, breaking at the
250
+ * UAX #14 opportunities `layoutRuns` breaks at; pass `Infinity` for
251
+ * single-line layout.
252
+ */
253
+ declare function layoutMarkdown(runs: StyledRun[], maxWidth: number, fontSize: number, measure: MeasureFn, lineHeightFactor?: number, faceOf?: FaceMetricsFn): LayoutResult;
210
254
  /** Pluggable text-painting strategy. The default fills white at `(x, y)`; markdown renderers replace this. */
211
255
  type TextRenderer = (ctx: CanvasRenderingContext2D, text: string, x: number, y: number) => void;
212
256
  /** Font styling options threaded through `createMarkdownRenderer`. */
@@ -236,4 +280,4 @@ declare function createMarkdownRenderer(ctx: CanvasRenderingContext2D, text: str
236
280
  height: number;
237
281
  };
238
282
 
239
- export { LaidOutRuns, type LayoutLine, type LayoutResult, LayoutRunsOpts, type MarkdownFontOptions, type MeasureFn, type MeasureTextBoundsOpts, type MeasuredText, type PositionedRun, ResolvedRun, ResolvedTextStyle, StyledRun, type TextLineBoxesOpts, type TextPose, type TextPoseLayout, type TextPoseLayoutInput, type TextRenderer, TextStyle, type TextVerticalAlign, createMarkdownRenderer, layoutMarkdown, layoutTextPose, measureText, measureTextBounds, measuredWidth, textLineBoxes, textPoseLayoutInput, verticalAlignOffset };
283
+ export { BREAK_ALLOWED, BREAK_MANDATORY, type FaceMetricsFn, LaidOutRuns, type LayoutLine, type LayoutResult, LayoutRunsOpts, type MarkdownFontOptions, type MeasureFn, type MeasureTextBoundsOpts, type MeasuredText, NO_BREAK, type PositionedRun, ResolvedRun, ResolvedTextStyle, StyledRun, type TextLineBoxesOpts, type TextPose, type TextPoseLayout, type TextPoseLayoutInput, type TextRenderer, TextStyle, type TextVerticalAlign, createMarkdownRenderer, isHardLineBreak, layoutMarkdown, layoutTextPose, lineBreakOpportunities, measureText, measureTextBounds, measuredWidth, textLineBoxes, textPoseLayoutInput, verticalAlignOffset };