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)
    interface Typeface
    final const
    measure
    (
    alias chunkWords = defaultWordChunks
    String
    )
    (,
    String text
    ,
    bool wrap = true
    )
    if (
    isSomeString!String
    )
  2. Vector2 measure(String text)

Parameters

chunkWords

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

availableSpace Vector2

Amount of available space the text can take up (dots), used to wrap text.

text String

Text to measure.

wrap bool

Toggle text wrapping.

Meta