API Docs for:
Show:

Text Class

Defined in: src/core/text.js:8
Module: core
Parent Module: multigraph

Text is a Jermaine model that supports storing and determining metrics of strings in different graphics contexts.

Constructor

Text

(
  • string
)

Defined in src/core/text.js:8

Parameters:

  • string String

    The string stored in the Text model

Methods

initializeGeometry

(
  • graphicsContext
)
chainable

Defined in src/core/text.js:64

Determines unrotated and rotated widths and heights for the stored string. Overridden by implementations in graphics drivers.

Parameters:

  • graphicsContext Object
    • angle Float

initializeGeometry

(
  • graphicsContext
)
chainable

Provided by the canvas module.

Defined in src/graphics/canvas/text.js:12

Determines unrotated and rotated widths and heights for the stored string in the canvas environment

Parameters:

  • graphicsContext Object
    • context Context
    • angle Float
    • fontSize String

initializeGeometry

(
  • graphicsContext
)
chainable

Provided by the raphael module.

Defined in src/graphics/raphael/text.js:12

Determines unrotated and rotated widths and heights for the stored string in the raphael environment

Parameters:

  • graphicsContext Object
    • elem TextElem
    • angle Float
    • fontSize String

measureStringHeight

(
  • graphicsContext
)
Float private

Determines unrotated height for the stored string. Overridden by implementations in graphics drivers.

Parameters:

  • graphicsContext Object

Returns:

Float:

Unrotated height of string.

measureStringHeight

(
  • context
)
Float private

Provided by the canvas module.

Defined in src/graphics/canvas/text.js:75

Determines unrotated height for the stored string in the canvas environment.

Parameters:

  • context Context

Returns:

Float:

Unrotated height of string.

measureStringHeight

(
  • text
)
Float private

Provided by the raphael module.

Defined in src/graphics/raphael/text.js:97

Determines unrotated height for the stored string in the raphael environment.

Parameters:

  • text TextElem

Returns:

Float:

Unrotated height of string.

measureStringWidth

(
  • graphicsContext
)
Float private

Defined in src/core/text.js:98

Determines unrotated width for the stored string. Overridden by implementations in graphics drivers.

Parameters:

  • graphicsContext Object

Returns:

Float:

Unrotated width of string.

measureStringWidth

(
  • context
)
Float private

Provided by the canvas module.

Defined in src/graphics/canvas/text.js:57

Determines unrotated width for the stored string in the canvas environment.

Parameters:

  • context Context

Returns:

Float:

Unrotated width of string.

measureStringWidth

(
  • elem
)
Float private

Provided by the raphael module.

Defined in src/graphics/raphael/text.js:79

Determines unrotated width for the stored string in the raphael environment.

Parameters:

  • elem TextElem

Returns:

Float:

Unrotated width of string.

Properties

origHeight

Float final

Defined in src/core/text.js:37

The unrotated height of the string

origWidth

Float final

Defined in src/core/text.js:28

The unrotated width of the string

rotatedHeight

Float final

Defined in src/core/text.js:55

The rotated height of the string

rotatedWidth

Float final

Defined in src/core/text.js:46

The rotated width of the string

string

String

Defined in src/core/text.js:20

The string stored in the Text model