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.
| Name | Signature | Description |
|---|---|---|
kind | readonly kind: 'text'; | |
x | readonly x: number; | |
y | readonly y: number; | |
text | readonly text: string; | |
fontFamilyoptional | readonly fontFamily?: string | undefined; | Default |
fontSizeoptional | readonly fontSize?: number | undefined; | In oriented-image pixels. Default 32. |
coloroptional | readonly color?: string | undefined; | Default |
boldoptional | readonly bold?: boolean | undefined; | |
italicoptional | readonly italic?: boolean | undefined; | |
idinherited | id: string; | Stable id; selection, history and callbacks use it. |
rotationoptionalinherited | rotation?: number; | Clockwise degrees around the annotation's center. Default 0. |
opacityoptionalinherited | opacity?: number; | 0 to 1. Default 1. |