This class intended to prepare formatted text.
Public Member Functions |
| OpenGl_TextFormatter () |
| Default constructor.
|
void | SetupAlignment (const Graphic3d_HorizontalTextAlignment theAlignX, const Graphic3d_VerticalTextAlignment theAlignY) |
| Setup alignment style.
|
void | Reset () |
| Reset current progress.
|
void | Append (const Handle< OpenGl_Context > &theCtx, const NCollection_String &theString, OpenGl_Font &theFont) |
| Render specified text to inner buffer.
|
void | Format () |
| Perform formatting on the buffered text. Should not be called more than once after initialization!
|
void | Result (NCollection_Vector< GLuint > &theTextures, NCollection_Vector< NCollection_Handle< NCollection_Vector< OpenGl_Vec2 > > > &theVertsPerTexture, NCollection_Vector< NCollection_Handle< NCollection_Vector< OpenGl_Vec2 > > > &theTCrdsPerTexture) const |
| Retrieve formatting results.
|
void | Result (const Handle< OpenGl_Context > &theCtx, NCollection_Vector< GLuint > &theTextures, NCollection_Vector< Handle< OpenGl_VertexBuffer >> &theVertsPerTexture, NCollection_Vector< Handle< OpenGl_VertexBuffer >> &theTCrdsPerTexture) const |
| Retrieve formatting results.
|
void | Result (const Handle< OpenGl_Context > &theCtx, NCollection_Vector< GLuint > &theTextures, NCollection_Vector< Handle< OpenGl_Vec2Array >> &theVertsPerTexture, NCollection_Vector< Handle< OpenGl_Vec2Array >> &theTCrdsPerTexture) const |
| Retrieve formatting results.
|
Standard_ShortReal | ResultWidth () const |
Standard_ShortReal | ResultHeight () const |
void | BndBox (Font_FTFont::Rect &theBndBox) const |
Protected Member Functions |
|
void | newLine (const Standard_Integer theLastRect) |
| Move glyphs on the current line to correct position.
|
Protected Attributes |
|
Graphic3d_HorizontalTextAlignment | myAlignX |
| horizontal alignment style
|
Graphic3d_VerticalTextAlignment | myAlignY |
| vertical alignment style
|
Standard_Integer | myTabSize |
| horizontal tabulation width (number of space symbols)
|
|
NCollection_String | myString |
| currently rendered text
|
OpenGl_Vec2 | myPen |
| current pen position
|
NCollection_Vector
< OpenGl_Font::Tile > | myRects |
| glyphs rectangles
|
Standard_Integer | myRectsNb |
| rectangles number
|
NCollection_Vector
< Standard_ShortReal > | myNewLines |
| position at LF
|
Standard_ShortReal | myLineSpacing |
| line spacing (computed as maximum of all fonts involved in text formatting)
|
Standard_ShortReal | myAscender |
| currently rendered text
|
bool | myIsFormatted |
| formatting state
|
OpenGl_VertexBufferEditor
< OpenGl_Vec2 > | myVboEditor |
| currently rendered text
|
|
Standard_Integer | myLinesNb |
| overall (new)lines number (including splitting by width limit)
|
Standard_Integer | myRectLineStart |
| id of first rectangle on the current line
|
Standard_Integer | myRectWordStart |
| id of first rectangle in the current word
|
Standard_Integer | myNewLineNb |
| overall (new)lines number (including splitting by width limit)
|
Standard_ShortReal | myPenCurrLine |
| current baseline position
|
Standard_ShortReal | myLineLeft |
| left x position of first glyph on line before formatting applied
|
Standard_ShortReal | myLineTail |
| overall (new)lines number (including splitting by width limit)
|
Standard_ShortReal | myBndTop |
| overall (new)lines number (including splitting by width limit)
|
Standard_ShortReal | myBndWidth |
| overall (new)lines number (including splitting by width limit)
|
OpenGl_Vec2 | myMoveVec |
| local variable
|