Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TextStyle

Hierarchy

  • TextStyle

Index

Constructors

constructor

Properties

applyFill

applyFill: boolean = true

Whether to apply a fill to the style

applyStroke

applyStroke: boolean = false

Whether to apply a stroke to the style

autoLeading

autoLeading: boolean = false

Whether auto leading is enabled for a style

baselineDirection

baselineDirection: "default" | "rotated" | "tate-chuu-yoko" = "default"

baselineOption

baselineOption: "default" | "subscript" | "superscript" = "default"

baselineShift

baselineShift: number = 0

The baseline shift value for a style

digitSet

digitSet: "default" | "hindidigits" = "default"

fillColor

fillColor: [number, number, number] = ...

The fill color of a style

font

font: string = "Arial"

Font of the style

fontSize

fontSize: number = 0

Font size of the style

horizontalScaling

horizontalScaling: number = 100

isAllCaps

isAllCaps: boolean = false

Whether all caps is enabled for a style

isFauxBold

isFauxBold: boolean = false

Whether faux bold is enabled for a style

isFauxItalic

isFauxItalic: boolean = false

Whether faux italic is enabled

isLigature

isLigature: boolean = false

isSmallCaps

isSmallCaps: boolean = false

Whether small caps is enabled for a style

kerning

kerning: number = 0

kerningType

kerningType: "metrics" | "optical" = "metrics"

leading

leading: number = 60

The leading value for a style

lineJoin

lineJoin: "bevel" | "miter" | "round" = "miter"

strokeColor

strokeColor: [number, number, number] = ...

The stroke colour of a style

strokeWidth

strokeWidth: number = 0

The stroke width for a style

tracking

tracking: number = 0

Tracking value for a style

tsume

tsume: number = 0

verticalScaling

verticalScaling: number = 100

Methods

replaceText

  • replaceText(content: string, s?: number, n?: number): TextStyle
  • Replaces the content between s and n with the given content, or if s and n aren't given replaces the entire string

    Parameters

    • content: string
    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setAllCaps

  • setAllCaps(isAllCaps: boolean, s?: number, n?: number): TextStyle
  • Set the all caps property for a style

    Parameters

    • isAllCaps: boolean
    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setApplyFill

  • setApplyFill(applyFill: boolean, s?: number, n?: number): TextStyle
  • Enable or disable the fill for a style

    Parameters

    • applyFill: boolean
    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setApplyStroke

  • setApplyStroke(applyStroke: boolean, s?: number, n?: number): TextStyle
  • Enable or disable the stroke for a style

    Parameters

    • applyStroke: boolean
    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setAutoLeading

  • setAutoLeading(autoLeading: boolean, s?: number, n?: number): TextStyle
  • Set the auto leading property for a style

    Parameters

    • autoLeading: boolean
    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setBaselineDirection

  • setBaselineDirection(baselineDirection: "default" | "rotated" | "tate-chuu-yoko", s?: number, n?: number): TextStyle
  • Parameters

    • baselineDirection: "default" | "rotated" | "tate-chuu-yoko"
    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setBaselineOption

  • setBaselineOption(baselineOption: "default" | "subscript" | "superscript", s?: number, n?: number): TextStyle
  • Parameters

    • baselineOption: "default" | "subscript" | "superscript"
    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setBaselineShift

  • setBaselineShift(baselineShift: number, s?: number, n?: number): TextStyle
  • Set the baseline shift value for a style

    Parameters

    • baselineShift: number

      The baseline shift to set

    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setDigitSet

  • setDigitSet(digitSet: "default" | "hindidigits", s?: number, n?: number): TextStyle
  • Parameters

    • digitSet: "default" | "hindidigits"
    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setFauxBold

  • setFauxBold(isFauxBold: boolean, s?: number, n?: number): TextStyle
  • Set the faux bold property for a style

    Parameters

    • isFauxBold: boolean
    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setFauxItalic

  • setFauxItalic(isFauxItalic: boolean, s?: number, n?: number): TextStyle
  • Set the faux italic property for a style

    Parameters

    • isFauxItalic: boolean
    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setFillColor

  • setFillColor(fillColor: [number, number, number], s?: number, n?: number): TextStyle
  • Set the fill color for a style

    Parameters

    • fillColor: [number, number, number]

      The color to set

    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setFont

  • setFont(font: string, s?: number, n?: number): TextStyle
  • Set the font for a style

    Parameters

    • font: string

      The typeface to set

    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setFontSize

  • setFontSize(fontSize: number, s?: number, n?: number): TextStyle
  • Set the font size for a style

    Parameters

    • fontSize: number

      Font size in pixels

    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setHorizontalScaling

  • setHorizontalScaling(horizontalScaling: number, s?: number, n?: number): TextStyle
  • Parameters

    • horizontalScaling: number
    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setKerning

  • setKerning(kerning: number, s?: number, n?: number): TextStyle
  • Parameters

    • kerning: number
    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setKerningType

  • setKerningType(kerningType: "metrics" | "optical", s?: number, n?: number): TextStyle
  • Parameters

    • kerningType: "metrics" | "optical"
    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setLeading

  • setLeading(leading: number, s?: number, n?: number): TextStyle
  • Set the leading value for a style

    Parameters

    • leading: number
    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setLigature

  • setLigature(ligature: boolean, s?: number, n?: number): TextStyle
  • Parameters

    • ligature: boolean
    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setLineJoin

  • setLineJoin(lineJoin: "bevel" | "miter" | "round", s?: number, n?: number): TextStyle
  • Parameters

    • lineJoin: "bevel" | "miter" | "round"
    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setSmallCaps

  • setSmallCaps(isSmallCaps: boolean, s?: number, n?: number): TextStyle
  • Set the small caps property for a style

    Parameters

    • isSmallCaps: boolean
    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setStrokeColor

  • setStrokeColor(strokeColor: [number, number, number], s?: number, n?: number): TextStyle
  • Set the stroke colour for a style

    Parameters

    • strokeColor: [number, number, number]

      The color to set

    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setStrokeWidth

  • setStrokeWidth(strokeWidth: number, s?: number, n?: number): TextStyle
  • Set the stroke width for a style

    Parameters

    • strokeWidth: number

      The stroke width to set

    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setText

  • Set the text content of a sourceText property, used when you need to return a style object and set the value

    Parameters

    • text: string

      The string to set

    Returns TextStyle

setTracking

  • setTracking(tracking: number, s?: number, n?: number): TextStyle
  • Set the tracking style for a style

    Parameters

    • tracking: number
    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setTsume

  • setTsume(tsume: number, s?: number, n?: number): TextStyle
  • Parameters

    • tsume: number
    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

setVerticalScaling

  • setVerticalScaling(verticalScaling: number, s?: number, n?: number): TextStyle
  • Parameters

    • verticalScaling: number
    • Optional s: number

      Start index

    • Optional n: number

      Number of characters

    Returns TextStyle

Generated using TypeDoc