Skip to main content

fragmentText

Callable

  • fragmentText(text: string, maxWidth: number): string[]

  • Wrapping text in fragments to support languages that do not separate between words using space. This function can also break between a long English word if somehow needed in the script.


    Parameters

    • text: string

      The text to be fragmented.

    • maxWidth: number

      The max width the text will be filled in.

    Returns string[]

    • A list of string that being fragmented.