class
TextGeometry
This object takes as input a string, a font and optionally some constraints (like word wrap) and outputs a set of character data you may use for rendering or calculating dimensions.
Public
Constructors
TextGeometry
Initializes a new text geometry object using the specified string and font.
Text will attempt to fit into the provided area. If enabled it will wrap words to new line when they don't fit. Individual words will be broken into multiple pieces if they don't fit on a single line when word break is enabled, otherwise they will be clipped. If the specified area is zero size then the text will not be clipped or word wrapped in any way.
After this object is constructed you may call various getter methods to get needed information.
Methods
~TextGeometry
GetLineCount
Returns the number of lines that were generated.
GetPageCount
Returns the number of font pages references by the used characters.
GetLineHeight
Returns the height of a line in pixels.
GetLine
Gets information describing a single line at the specified index.
GetTextureForPage
Returns font texture for the provided page index.
GetQuadCount
Returns the number of quads used by all the characters in the provided page.
GetWidth
Returns the width of the actual text in pixels.
GetHeight
Returns the height of the actual text in pixels.
Protected
Methods
GeneratePersistentData
Copies internally stored data in temporary buffers to a persistent buffer.
- text
- Text originally used for creating the internal temporary buffer data.
- buffer
- Memory location to copy the data to. If null then no data will be copied and the parameter will contain the required buffer size.
- size
- Size of the provided memory buffer, or if the buffer is null, this will contain the required buffer size after method exists.
- freeTemporary
- If true the internal temporary data will be freed after copying.
staticEnsurePerThreadTemporaryBufferIsInitialized
Allocates an initial set of buffers that will be reused while parsing text data.
Fields
mCharacters
mCharacterCount
mWords
mWordCount
mLines
mLineCount
mPageInfos
mPageCount
mFont
mFontBitmapInformation
Private
Methods
GetBaselineOffset
Returns Y offset that determines the line on which the characters are placed.
In pixels.
GetSpaceWidth
Returns the width of a single space in pixels.
GetCharacter
Gets a description of a single character referenced by its sequential index based on the original string.
GetWord
Gets a description of a single word referenced by its sequential index based on the original string.