Repository
public class |source

StyledTextElement

StyledTextElement is a simple class to organise text elements extacted from HTML text. It contains an array of StyledLetter.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public

color: *

public

font: *

public
public
public

path: *

public

size: *

public
public

text: *

public
public
public

Method Summary

Public Methods
public

setColor(color: Color)

Defines the letter's color

public

setFont(font: Font)

Defines the letter's font

public

setPath(path: Path)

Defines the letter's path

public

setSize(size: Font)

Defines the letter's font size

public

setText(text: String)

Defines the letter's text string

public

Defines the letter's x

public

Defines the letter's y

public

Updates properties according to the new settings (including styledLetters array properties)

Public Constructors

public constructor(params: Object) source

Params:

NameTypeAttributeDescription
paramsObject

Parameters object, given by the constructor.

params.textString

the text string (character)

params.sizeNumber
  • optional
  • default: 40

the size of the font

params.fontFont

a Mobilizing font reference

params.colorColor
  • optional
  • default: "black"

a CSS Color

Public Members

public boundingBox: * source

public color: * source

public font: * source

public height: number source

public line: number source

public path: * source

public size: * source

public styledLetters: *[] source

public text: * source

public width: number source

public x: number source

public y: number source

Public Methods

public setColor(color: Color) source

Defines the letter's color

Params:

NameTypeAttributeDescription
colorColor

public setFont(font: Font) source

Defines the letter's font

Params:

NameTypeAttributeDescription
fontFont

public setPath(path: Path) source

Defines the letter's path

Params:

NameTypeAttributeDescription
pathPath

openType.js object's Path

public setSize(size: Font) source

Defines the letter's font size

Params:

NameTypeAttributeDescription
sizeFont

public setText(text: String) source

Defines the letter's text string

Params:

NameTypeAttributeDescription
textString

public setX(x: Number) source

Defines the letter's x

Params:

NameTypeAttributeDescription
xNumber

public setY(y: Number) source

Defines the letter's y

Params:

NameTypeAttributeDescription
yNumber

public update() source

Updates properties according to the new settings (including styledLetters array properties)