Skip to content
Menu
Auto
English
GitHub
Auto
English

TextStyle

Defined in: src/index.ts:360

TextStyle for text watermark

textStyle: {
color: '#aacc22',
fontName: 'Arial',
fontSize: 12,
shadowStyle: {
dx: 10,
dy: 10,
radius: 10,
color: '#aacc22'
},
textBackgroundStyle: {
paddingX: 10,
paddingY: 10,
type: TextBackgroundType.stretchX,
color: '#aacc22'
},
underline: true,
skewX: -0.25,
strikeThrough: true,
textAlign: 'left',
italic: true,
bold: true,
rotate: 45
}

optional bold?: boolean

Defined in: src/index.ts:478

text bold

false
bold: true

optional color?: string

Defined in: src/index.ts:367

font color

'#000000'
color: '#aacc22'

optional direction?: "auto" | "ltr" | "rtl"

Defined in: src/index.ts:399

Unicode base direction used for layout.

'auto'

optional fontFallbacks?: string[]

Defined in: src/index.ts:375

Ordered platform font families tried after fontName.


optional fontName?: string

Defined in: src/index.ts:373

font name

fontName: 'Arial'

optional fontSize?: number

Defined in: src/index.ts:381

font size used when rendering text onto the output image

fontSize: 12

optional fontSizeRatio?: number

Defined in: src/index.ts:387

font size ratio relative to the background image width

fontSizeRatio: 0.03

optional italic?: boolean

Defined in: src/index.ts:471

text italic

false
italic: true

optional letterSpacing?: number

Defined in: src/index.ts:397

Additional spacing between grapheme clusters in output pixels.


optional lineHeight?: number

Defined in: src/index.ts:395

Absolute distance between line origins in output pixels.


optional maxLines?: number

Defined in: src/index.ts:403

Maximum number of rendered lines.


optional maxWidth?: string | number

Defined in: src/index.ts:393

Maximum text box width in output pixels or as a percentage of the background width.

maxWidth: '60%'

optional overflow?: "clip" | "ellipsis"

Defined in: src/index.ts:405

Behavior when text exceeds maxWidth or maxLines.

'clip'

optional rotate?: number

Defined in: src/index.ts:485

rotate text

0
rotate: 45

optional shadowStyle?: ShadowLayerStyle | null

Defined in: src/index.ts:416

text shadow style

shadowStyle: {
dx: 10,
dy: 10,
radius: 10,
color: '#aacc22'
}

optional skewX?: number

Defined in: src/index.ts:450

Horizontal text shear factor. Use italic for font-provided italics.

skewX: -0.25

optional strikeThrough?: boolean

Defined in: src/index.ts:457

text strikethrough

false
strikeThrough: true

optional strokeStyle?: TextStrokeStyle | null

Defined in: src/index.ts:437

Optional outline drawn around the text before the fill. The width is measured in output-image pixels. Set width to 0 to disable it.

strokeStyle: {
color: '#00000099',
width: 2,
}

optional textAlign?: "center" | "left" | "right"

Defined in: src/index.ts:464

text align

'left'
textAlign: 'left'

optional textBackgroundStyle?: TextBackgroundStyle | null

Defined in: src/index.ts:427

text background style

textBackgroundStyle: {
paddingX: 10,
paddingY: 10,
type: TextBackgroundType.stretchX,
color: '#aacc22'
}

optional underline?: boolean

Defined in: src/index.ts:444

text underline style

false
underline: true

optional wrap?: "word" | "character" | "none"

Defined in: src/index.ts:401

Wrapping strategy.

'word'