Skip to content

TextProperty ​

Introduction ​

vtkTextProperty is an object that represents text properties. The primary properties that can be set are color, opacity, font size, font family horizontal and vertical justification, bold/italic/shadow styles.

Methods ​

extend ​

Method use to decorate a given object (publicAPI+model) with vtkProperty characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesITextPropertyInitialValuesNo(default: {})

getBackgroundColor ​

Get the background color.

getBackgroundColorByReference ​

Get the background color by reference.

getFillStyle ​

Get the fill style.

getFontColor ​

Get the font color.

getFontColorByReference ​

Get the font color by reference.

getFontFamily ​

Get the font family.

getFontSizeScale ​

Get the font size scale.

getFontStyle ​

Get the font style.

getResolution ​

Get the resolution.

getShadowBlur ​

Get the shadow blur radius.

getShadowColor ​

Get the shadow color.

getShadowColorByReference ​

Get the shadow color by reference.

getShadowOffset ​

Get the shadow offset.

getShadowOffsetByReference ​

Get the shadow offset by reference.

newInstance ​

Method use to create a new instance of vtkTextProperty.

ArgumentTypeRequiredDescription
initialValuesITextPropertyInitialValuesNofor pre-setting some of its content

setBackgroundColor ​

Set the background color.

ArgumentTypeRequiredDescription
backgroundColorRGBColorYesThe background color to set.

setFillStyle ​

Set the fill style.

ArgumentTypeRequiredDescription
fillStylestringYesThe fill style to set.

setFontColor ​

Set the font color from RGB values.

ArgumentTypeRequiredDescription
rnumberYesRed component (0-255)
gnumberYesGreen component (0-255)
bnumberYesBlue component (0-255)

setFontColorFrom ​

Set the font color.

ArgumentTypeRequiredDescription
fontColorRGBColorYesThe font color to set.

setFontFamily ​

Set the font family.

ArgumentTypeRequiredDescription
fontFamilystringYesThe font family to set.

setFontSizeScale ​

Set the font size scale. Scales the font size based on the given resolution. Dividing by 1.8 ensures the font size is proportionate and not too large. The value 1.8 is a chosen scaling factor for visual balance.

ArgumentTypeRequiredDescription
resolutionnumberYesThe resolution to set.

setFontStyle ​

Set the font style.

ArgumentTypeRequiredDescription
fontStylestringYesThe font style to set.

setResolution ​

Set the resolution.

ArgumentTypeRequiredDescription
resolutionnumberYesThe resolution to set.

setShadowBlur ​

Set the shadow blur radius.

ArgumentTypeRequiredDescription
shadowBlurnumberYesThe shadow blur radius to set.

setShadowColor ​

Set the shadow color from RGB values.

ArgumentTypeRequiredDescription
rnumberYesRed component (0-255)
gnumberYesGreen component (0-255)
bnumberYesBlue component (0-255)

setShadowColorFrom ​

Set the shadow color.

ArgumentTypeRequiredDescription
shadowColorRGBColorYesThe shadow color to set.

setShadowOffset ​

Set the shadow offset from x and y values.

ArgumentTypeRequiredDescription
xnumberYesHorizontal offset
ynumberYesVertical offset

setShadowOffsetFrom ​

Set the shadow offset.

ArgumentTypeRequiredDescription
shadowOffsetArrayYesThe shadow offset to set, as an array of [x, y].