Skip to content

getLineBreakRanges

Under Construction

This documentation is auto-generated, and is a work in progress. Please see the source code at https://github.com/phetsims/scenery/blob/main/js/util/getLineBreakRanges.ts for the most up-to-date information.

Overview

Returns where possible line breaks can exist in a given string, according to the Unicode Line Breaking Algorithm (UAX #14). Uses https://github.com/foliojs/linebreak.

@author Jonathan Olson <jonathan.olson@colorado.edu>

Type GetLineBreaksOptions

import type { GetLineBreaksOptions } from 'scenerystack/scenery';
  • requiredOnly?: boolean
    Line breaks can be "required" or "optional". If this is true, ranges will only be given for required line breaks.

Source Code

See the source for getLineBreakRanges.ts in the scenery repository.