TextStyle
Defined in: src/index.ts:360
TextStyle for text watermark
Example
Section titled “Example”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 }Properties
Section titled “Properties”
optionalbold?:boolean
Defined in: src/index.ts:478
text bold
Default Value
Section titled “Default Value”falseExample
Section titled “Example”bold: truecolor?
Section titled “color?”
optionalcolor?:string
Defined in: src/index.ts:367
font color
Default Value
Section titled “Default Value”'#000000'Example
Section titled “Example”color: '#aacc22'direction?
Section titled “direction?”
optionaldirection?:"auto"|"ltr"|"rtl"
Defined in: src/index.ts:399
Unicode base direction used for layout.
Default Value
Section titled “Default Value”'auto'fontFallbacks?
Section titled “fontFallbacks?”
optionalfontFallbacks?:string[]
Defined in: src/index.ts:375
Ordered platform font families tried after fontName.
fontName?
Section titled “fontName?”
optionalfontName?:string
Defined in: src/index.ts:373
font name
Example
Section titled “Example”fontName: 'Arial'fontSize?
Section titled “fontSize?”
optionalfontSize?:number
Defined in: src/index.ts:381
font size used when rendering text onto the output image
Example
Section titled “Example”fontSize: 12fontSizeRatio?
Section titled “fontSizeRatio?”
optionalfontSizeRatio?:number
Defined in: src/index.ts:387
font size ratio relative to the background image width
Example
Section titled “Example”fontSizeRatio: 0.03italic?
Section titled “italic?”
optionalitalic?:boolean
Defined in: src/index.ts:471
text italic
Default Value
Section titled “Default Value”falseExample
Section titled “Example”italic: trueletterSpacing?
Section titled “letterSpacing?”
optionalletterSpacing?:number
Defined in: src/index.ts:397
Additional spacing between grapheme clusters in output pixels.
lineHeight?
Section titled “lineHeight?”
optionallineHeight?:number
Defined in: src/index.ts:395
Absolute distance between line origins in output pixels.
maxLines?
Section titled “maxLines?”
optionalmaxLines?:number
Defined in: src/index.ts:403
Maximum number of rendered lines.
maxWidth?
Section titled “maxWidth?”
optionalmaxWidth?:string|number
Defined in: src/index.ts:393
Maximum text box width in output pixels or as a percentage of the background width.
Example
Section titled “Example”maxWidth: '60%'overflow?
Section titled “overflow?”
optionaloverflow?:"clip"|"ellipsis"
Defined in: src/index.ts:405
Behavior when text exceeds maxWidth or maxLines.
Default Value
Section titled “Default Value”'clip'rotate?
Section titled “rotate?”
optionalrotate?:number
Defined in: src/index.ts:485
rotate text
Default Value
Section titled “Default Value”0Example
Section titled “Example”rotate: 45shadowStyle?
Section titled “shadowStyle?”
optionalshadowStyle?:ShadowLayerStyle|null
Defined in: src/index.ts:416
text shadow style
Example
Section titled “Example”shadowStyle: { dx: 10, dy: 10, radius: 10, color: '#aacc22' }skewX?
Section titled “skewX?”
optionalskewX?:number
Defined in: src/index.ts:450
Horizontal text shear factor. Use italic for font-provided italics.
Example
Section titled “Example”skewX: -0.25strikeThrough?
Section titled “strikeThrough?”
optionalstrikeThrough?:boolean
Defined in: src/index.ts:457
text strikethrough
Default Value
Section titled “Default Value”falseExample
Section titled “Example”strikeThrough: truestrokeStyle?
Section titled “strokeStyle?”
optionalstrokeStyle?: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.
Example
Section titled “Example”strokeStyle: { color: '#00000099', width: 2,}textAlign?
Section titled “textAlign?”
optionaltextAlign?:"center"|"left"|"right"
Defined in: src/index.ts:464
text align
Default Value
Section titled “Default Value”'left'Example
Section titled “Example”textAlign: 'left'textBackgroundStyle?
Section titled “textBackgroundStyle?”
optionaltextBackgroundStyle?:TextBackgroundStyle|null
Defined in: src/index.ts:427
text background style
Example
Section titled “Example”textBackgroundStyle: { paddingX: 10, paddingY: 10, type: TextBackgroundType.stretchX, color: '#aacc22' }underline?
Section titled “underline?”
optionalunderline?:boolean
Defined in: src/index.ts:444
text underline style
Default Value
Section titled “Default Value”falseExample
Section titled “Example”underline: true
optionalwrap?:"word"|"character"|"none"
Defined in: src/index.ts:401
Wrapping strategy.
Default Value
Section titled “Default Value”'word'