class
TextGeometry::Word
Represents a single word as a set of characters, or optionally just a blank space of a certain length.
Public
Methods
Initialize
Initializes the word and signals if it just a space (or multiple spaces), or an actual word with letters.
AddCharacter
Appends a new character to the word.
- characterIndex
- Sequential index of the character in the original string.
- characterInformation
- Character description from the font.
Returns: How many pixels did the added character expand the word by.
AddSpace
Adds a space to the word.
Word must have previously have been declared as a "spacer".
GetWidth
Returns the width of the word in pixels.
GetHeight
Returns height of the word in pixels.
CalculateWidthWithCharacter
Calculates new width of the word if we were to add the provided character, without actually adding it.
- characterInformation
- Character description from the font.
Returns: Width of the word in pixels with the character appended to it.
IsSpacer
Returns true if word is a spacer.
Spacers contain just a space of a certain length with no actual characters.
GetCharacterCount
Returns the number of characters in the word.
GetStartCharacterIndex
Returns the index of the starting character in the word.
GetEndCharacterIndex
Returns the index of the last character in the word.
staticCalculateCharacterWidth
Calculates width of the character by which it would expand the width of the word if it was added to it.
- previousCharacter
- Descriptor of the character preceding the one we need the width for. Can be null.
- currentCharacter
- Character description from the font.
Returns: How many pixels would the added character expand the word by.