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.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | IVectorTextInitialValues | No | (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.
| Argument | Type | Required | Description |
|---|---|---|---|
fn | Yes | - 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
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IVectorTextInitialValues | No | for pre-setting some of its content |
setBevelEnabled
Enables or disables beveling.
| Argument | Type | Required | Description |
|---|---|---|---|
bevelEnabled | Yes | - True to enable beveling, false to disable. |
setBevelOffset
Sets the offset of the bevel.
| Argument | Type | Required | Description |
|---|---|---|---|
bevelOffset | Yes | - The bevel offset. |
setBevelSegments
Sets the number of segments used for the bevel geometry.
| Argument | Type | Required | Description |
|---|---|---|---|
bevelSegments | Yes | - The number of bevel segments. |
setBevelSize
Sets the size of the bevel.
| Argument | Type | Required | Description |
|---|---|---|---|
bevelSize | Yes | - The bevel size. |
setBevelThickness
Sets the thickness of the bevel.
| Argument | Type | Required | Description |
|---|---|---|---|
bevelThickness | Yes | - The bevel thickness. |
setCurveSegments
Sets the number of curve segments used for the text geometry.
| Argument | Type | Required | Description |
|---|---|---|---|
curveSegments | Yes | - The number of curve segments. |
setDepth
Sets the extrusion depth of the text.
| Argument | Type | Required | Description |
|---|---|---|---|
depth | Yes | - The new depth value. |
setFont
Sets the font object used for rendering the text. This should be a parsed font object from opentype.js.
| Argument | Type | Required | Description |
|---|---|---|---|
font | Yes | - The font object. |
setFontSize
Sets the font size.
| Argument | Type | Required | Description |
|---|---|---|---|
fontSize | Yes | - The new font size. |
setPerLetterFaceColors
Sets the per-letter face color function.
| Argument | Type | Required | Description |
|---|---|---|---|
fn | Yes | - Function mapping letter index to [r,g,b] color. |
setSteps
Sets the number of steps used for the text geometry.
| Argument | Type | Required | Description |
|---|---|---|---|
steps | Yes | - The number of steps. |
setText
Sets the text string.
| Argument | Type | Required | Description |
|---|---|---|---|
text | Yes | - The new text to display. |