Text

class Communicator.Markup.Shape.Text()

This object represents markup text that is drawn on the canvas.

Constructors


Constructors

Text.constructor(text, position)

Creates a new markup text item.

Arguments
  • text (string()) –

  • position (Point2()) –

Return type

Text()

Methods

getFillColor

Text.getFillColor()

Gets the fill color for this shape

Return type

Color()

Returns

the fill color

getFillOpacity

Text.getFillOpacity()

Gets the fill opacity for this shape

Return type

number

Returns

the fill opacity

getFontFamily

Text.getFontFamily()

Gets the font family for this text

Return type

string | null

Returns

the font family

getFontSize

Text.getFontSize()

Gets the font size for this text

Return type

number

Returns

the font size

getPosition

Text.getPosition()

Gets the text position

Return type

Point2()

Returns

the text position

getStrokeColor

Text.getStrokeColor()

Gets the stroke color for this shape

Return type

Color()

Returns

the stroke color

getStrokeWidth

Text.getStrokeWidth()

Gets the stroke width for this shape in pixels

Return type

Pixels

Returns

the stroke width in pixels

getText

Text.getText()

Gets the text content

Return type

string

Returns

the text content

setFillColor

Text.setFillColor(color)

Sets the fill color for this shape

Arguments
  • color (Color()) – the fill color

Return type

void

setFillOpacity

Text.setFillOpacity(fillOpacity)

Sets the fill opacity for this shape

Arguments
  • fillOpacity (number()) – the fill opacity

Return type

void

setFontFamily

Text.setFontFamily(fontFamily)

Sets the font family this shape

Arguments
  • fontFamily (string()) – font family to use for this text

Return type

void

setFontSize

Text.setFontSize(fontSize)

Sets the font size for this text

Arguments
  • fontSize (number()) – size to use for this text

Return type

void

setPosition

Text.setPosition(position)

Sets the text position

Arguments
Return type

void

Returns

the top left position to render text from

setStrokeColor

Text.setStrokeColor(color)

Sets the stroke color for this shape

Arguments
  • color (Color()) – the stroke color

Return type

void

setStrokeWidth

Text.setStrokeWidth(strokeWidth)

Sets the stroke width for this shape in pixels

Arguments
  • strokeWidth (Pixels) – the stroke width in pixels

Return type

void

setText

Text.setText(text)

Sets the text content

Arguments
  • text (string()) – the text to render

Return type

void