Skip to content

VectorText ​

Introduction ​

vtkVectorText generates vtkPolyData from an input string. The TTF file needs to be parsed using opentype.js and then passed to vtkVectorText via the setFont method.

Methods ​

extend ​

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

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

getBevelEnabled ​

Returns whether beveling is enabled.

getBevelOffset ​

Returns the offset of the bevel.

getBevelSegments ​

Returns the number of segments used for the bevel geometry.

getBevelSize ​

Returns the size of the bevel.

getBevelThickness ​

Returns the thickness of the bevel.

getCurveSegments ​

Returns the number of curve segments used for the text geometry.

getDepth ​

Returns the extrusion depth of the text.

getFontSize ​

Returns the current font size.

getPerLetterFaceColors ​

Gets or sets the per-letter face color function.

ArgumentTypeRequiredDescription
fnYes- Function mapping letter index to [r,g,b] color.

getSteps ​

Returns the number of steps used for the text geometry.

getText ​

Returns the current text string.

newInstance ​

Method use to create a new instance of vtkVectorText

ArgumentTypeRequiredDescription
initialValuesIVectorTextInitialValuesNofor pre-setting some of its content

setBevelEnabled ​

Enables or disables beveling.

ArgumentTypeRequiredDescription
bevelEnabledYes- True to enable beveling, false to disable.

setBevelOffset ​

Sets the offset of the bevel.

ArgumentTypeRequiredDescription
bevelOffsetYes- The bevel offset.

setBevelSegments ​

Sets the number of segments used for the bevel geometry.

ArgumentTypeRequiredDescription
bevelSegmentsYes- The number of bevel segments.

setBevelSize ​

Sets the size of the bevel.

ArgumentTypeRequiredDescription
bevelSizeYes- The bevel size.

setBevelThickness ​

Sets the thickness of the bevel.

ArgumentTypeRequiredDescription
bevelThicknessYes- The bevel thickness.

setCurveSegments ​

Sets the number of curve segments used for the text geometry.

ArgumentTypeRequiredDescription
curveSegmentsYes- The number of curve segments.

setDepth ​

Sets the extrusion depth of the text.

ArgumentTypeRequiredDescription
depthYes- The new depth value.

setFont ​

Sets the font object used for rendering the text. This should be a parsed font object from opentype.js.

ArgumentTypeRequiredDescription
fontYes- The font object.

setFontSize ​

Sets the font size.

ArgumentTypeRequiredDescription
fontSizeYes- The new font size.

setPerLetterFaceColors ​

Sets the per-letter face color function.

ArgumentTypeRequiredDescription
fnYes- Function mapping letter index to [r,g,b] color.

setSteps ​

Sets the number of steps used for the text geometry.

ArgumentTypeRequiredDescription
stepsYes- The number of steps.

setText ​

Sets the text string.

ArgumentTypeRequiredDescription
textYes- The new text to display.