UNPKG

@sheetxl/models

Version:

Models - A Headless javascript spreadsheet library.

72 lines 2.31 kB
import { Bounds } from "@sheetxl/common"; import { TextCap, TextStrikeStyle } from "./types"; import { ITextVisitor } from "./TextVisitor"; /** * Represents a span of character all with the same formatting */ export interface ITextRun { /** * The characters included in this run */ readonly text: string; /** * Will default from paragraph if not specified */ readonly fontName: string; /** * Will default from paragraph if not specified */ readonly fontSize: number; readonly bold: boolean; readonly italic: boolean; readonly superSub: boolean; /** * Specifies the spacing between characters within a text run. */ readonly letterSpacing: number; /** * Specifies the minimum font size at which character kerning will occur for this text run. * If this attribute is omitted, than kerning will occur for all font sizes down to a 0 point font. */ readonly kerningMin: number; /** * Specifies the capitalization that is to be applied to the text run during layout and rendering. * This does not actually effect the stored results */ readonly textCap: TextCap; /** * percent of font height shifted up + down. does not affect line-height. */ readonly offset: number; readonly strikeStyle: TextStrikeStyle; } export interface PlacedTextRun extends ITextRun { /** * Bounds is not copied during clone. */ readonly bounds?: Bounds; } export interface CloneableTextRun extends ITextRun { clone(visitor?: ITextVisitor): ITextRun; equals(other: ITextVisitor): boolean; } export declare class DefaultTextRun implements ITextRun, PlacedTextRun, CloneableTextRun { private _private; private _bounds?; constructor(overrides: Partial<ITextRun>, bounds?: Bounds); clone(visitor?: ITextVisitor): ITextRun; equals(other: ITextVisitor): boolean; get bounds(): Bounds; get text(): string; get fontName(): string; get bold(): boolean; get italic(): boolean; get fontSize(): number; get superSub(): boolean; get letterSpacing(): number; get kerningMin(): number; get textCap(): TextCap; get offset(): number; get strikeStyle(): TextStrikeStyle; } //# sourceMappingURL=TextRun.d.ts.map