Typeface.measure

Measure space the given text would span. Uses dots as the unit.

If availableSpace is specified, assumes text wrapping. Text wrapping is only performed on whitespace characters.

  1. Vector2 measure(Vector2 availableSpace, String text, bool wrap)
  2. Vector2 measure(String text)
  3. void measure(TextRuler ruler, String text, bool wrap)
    interface Typeface
    static
    void
    measure
    (
    alias chunkWords = defaultWordChunks
    String
    )
    (,
    String text
    ,
    bool wrap = true
    )

Parameters

chunkWords

Algorithm to use to break words when wrapping text; separators must be preserved as separate words.

text String

Text to measure.

wrap bool

Toggle text wrapping. Defaults to on, unless using the single argument overload.

Return Value

Type: void

Vector2 representing the text size, if TextRuler is not specified as an argument.

Meta