UNPKG

@itwin/core-common

Version:

iTwin.js components common to frontend and backend

62 lines 2.67 kB
/** @packageDocumentation * @module Annotation */ import { Range2dProps, XAndY } from "@itwin/core-geometry"; import { FontId } from "../Fonts"; import { TextStyleSettingsProps } from "./TextStyle"; /** * Represents a single run in a [[LineLayoutResult]]. * @note Get the text content of the RunLayoutResult using a combination of the `sourceRunIndex`, `characterOffset`, and `characterCount`. * @beta */ export interface RunLayoutResult { /** The ID of the font for the run. */ fontId: FontId; /** * The number of characters from the source [[Run]] that have already appeared in the layout. * @note A single source [[TextRun]] can be split into multiple lines to respect the [[TextBlock.width]]. */ characterOffset: number; /** The number of characters in the RunLayoutResult. */ characterCount: number; /** The offset of the RunLayoutResult from the top and left of the [[LineLayoutResult]] */ offsetFromLine: XAndY; /** Bounding box enclosing this RunLayoutResult's content. */ range: Range2dProps; /** The resolved [[TextStyleSettings]] for the run. Takes into account overrides and styles on the parent classes. */ textStyle: TextStyleSettingsProps; /** Bounding box used when justifying the run. This may be smaller than [[range]]. */ justificationRange?: Range2dProps; /** The range containing the contents of the [[FractionRun]]'s numerator. */ numeratorRange?: Range2dProps; /** The range containing the contents of the [[FractionRun]]'s denominator. */ denominatorRange?: Range2dProps; } /** * Represents a single line in a [[TextBlockLayoutResult]]. * @beta */ export interface LineLayoutResult { /** The runs contained in the line. */ runs: RunLayoutResult[]; /** The marker run for the line, if any */ marker: RunLayoutResult | undefined; /** The range of all the runs (including the marker) contained in the line. */ range: Range2dProps; /** Bounding box used when justifying the line. This may be smaller than [[range]]. */ justificationRange: Range2dProps; /** The offset of the line from the top and left of the [[TextBlock]]. */ offsetFromDocument: XAndY; } /** * Represents the result of laying out a [[TextBlock]]'s contents into a series of lines containing runs. * @see [computeLayoutTextBlockResult]($backend) to lay out a `TextBlock`. * @beta */ export interface TextBlockLayoutResult { /** The laid out lines of a [[TextBlock]]. */ lines: LineLayoutResult[]; /** The range containing the contents of a [[TextBlock]]. */ range: Range2dProps; } //# sourceMappingURL=TextBlockLayoutResult.d.ts.map