View as Markdown

API reference: @salmonui/editors/image-editor

ImageEditorTextAnnotationinterface

import type { ImageEditorTextAnnotation } from '@salmonui/editors/image-editor';
interface ImageEditorTextAnnotation extends AnnotationCommon {
    readonly kind: 'text';
    readonly x: number;
    readonly y: number;
    readonly text: string;
    readonly fontFamily?: string | undefined;
    readonly fontSize?: number | undefined;
    readonly color?: string | undefined;
    readonly bold?: boolean | undefined;
    readonly italic?: boolean | undefined;
}

Text annotation. x, y are the top-left corner of the first line.

ImageEditorTextAnnotation members (12, 3 inherited)
NameSignatureDescription
kindreadonly kind: 'text';
xreadonly x: number;
yreadonly y: number;
textreadonly text: string;
fontFamilyoptionalreadonly fontFamily?: string | undefined;

Default 'sans-serif'.

fontSizeoptionalreadonly fontSize?: number | undefined;

In oriented-image pixels. Default 32.

coloroptionalreadonly color?: string | undefined;

Default '#e5484d'.

boldoptionalreadonly bold?: boolean | undefined;
italicoptionalreadonly italic?: boolean | undefined;
idinheritedid: string;

Stable id; selection, history and callbacks use it.

rotationoptionalinheritedrotation?: number;

Clockwise degrees around the annotation's center. Default 0.

opacityoptionalinheritedopacity?: number;

0 to 1. Default 1.