Open CASCADE Technology
7.2.0
|
This class intended to prepare formatted text. More...
#include <Font_TextFormatter.hxx>
Public Member Functions | |
Font_TextFormatter () | |
Default constructor. More... | |
void | SetupAlignment (const Graphic3d_HorizontalTextAlignment theAlignX, const Graphic3d_VerticalTextAlignment theAlignY) |
Setup alignment style. More... | |
void | Reset () |
Reset current progress. More... | |
void | Append (const NCollection_String &theString, Font_FTFont &theFont) |
Render specified text to inner buffer. More... | |
void | Format () |
Perform formatting on the buffered text. Should not be called more than once after initialization! More... | |
const NCollection_Vec2< Standard_ShortReal > & | TopLeft (const Standard_Integer theIndex) const |
Returns specific glyph rectangle. More... | |
const NCollection_String & | String () const |
Returns current rendering string. More... | |
Standard_Integer | TabSize () const |
Returns tab size. More... | |
Standard_ShortReal | ResultWidth () const |
Standard_ShortReal | ResultHeight () const |
void | BndBox (Font_Rect &theBndBox) const |
Protected Member Functions | |
class auxiliary methods | |
void | newLine (const Standard_Integer theLastRect) |
Move glyphs on the current line to correct position. More... | |
Protected Attributes | |
configuration | |
Graphic3d_HorizontalTextAlignment | myAlignX |
horizontal alignment style More... | |
Graphic3d_VerticalTextAlignment | myAlignY |
vertical alignment style More... | |
Standard_Integer | myTabSize |
horizontal tabulation width (number of space symbols) More... | |
input data | |
NCollection_String | myString |
currently rendered text More... | |
NCollection_Vec2< Standard_ShortReal > | myPen |
current pen position More... | |
NCollection_Vector< NCollection_Vec2< Standard_ShortReal > > | myCorners |
The top left corners of a formatted rectangles. More... | |
Standard_Integer | myRectsNb |
rectangles number More... | |
NCollection_Vector< Standard_ShortReal > | myNewLines |
position at LF More... | |
Standard_ShortReal | myLineSpacing |
line spacing (computed as maximum of all fonts involved in text formatting) More... | |
Standard_ShortReal | myAscender |
currently rendered text More... | |
bool | myIsFormatted |
formatting state More... | |
temporary variables for formatting routines | |
Standard_Integer | myLinesNb |
overall (new)lines number (including splitting by width limit) More... | |
Standard_Integer | myRectLineStart |
id of first rectangle on the current line More... | |
Standard_Integer | myRectWordStart |
id of first rectangle in the current word More... | |
Standard_Integer | myNewLineNb |
overall (new)lines number (including splitting by width limit) More... | |
Standard_ShortReal | myPenCurrLine |
current baseline position More... | |
Standard_ShortReal | myBndTop |
overall (new)lines number (including splitting by width limit) More... | |
Standard_ShortReal | myBndWidth |
overall (new)lines number (including splitting by width limit) More... | |
NCollection_Vec2< Standard_ShortReal > | myMoveVec |
local variable More... | |
This class intended to prepare formatted text.
Font_TextFormatter::Font_TextFormatter | ( | ) |
Default constructor.
void Font_TextFormatter::Append | ( | const NCollection_String & | theString, |
Font_FTFont & | theFont | ||
) |
Render specified text to inner buffer.
|
inline |
bounding | box. |
void Font_TextFormatter::Format | ( | ) |
Perform formatting on the buffered text. Should not be called more than once after initialization!
|
protected |
Move glyphs on the current line to correct position.
void Font_TextFormatter::Reset | ( | ) |
Reset current progress.
|
inline |
|
inline |
void Font_TextFormatter::SetupAlignment | ( | const Graphic3d_HorizontalTextAlignment | theAlignX, |
const Graphic3d_VerticalTextAlignment | theAlignY | ||
) |
Setup alignment style.
|
inline |
Returns current rendering string.
|
inline |
Returns tab size.
|
inline |
Returns specific glyph rectangle.
|
protected |
horizontal alignment style
|
protected |
vertical alignment style
|
protected |
currently rendered text
|
protected |
overall (new)lines number (including splitting by width limit)
|
protected |
overall (new)lines number (including splitting by width limit)
|
protected |
The top left corners of a formatted rectangles.
|
protected |
formatting state
|
protected |
overall (new)lines number (including splitting by width limit)
|
protected |
line spacing (computed as maximum of all fonts involved in text formatting)
|
protected |
local variable
|
protected |
overall (new)lines number (including splitting by width limit)
|
protected |
position at LF
|
protected |
current pen position
|
protected |
current baseline position
|
protected |
id of first rectangle on the current line
|
protected |
rectangles number
|
protected |
id of first rectangle in the current word
|
protected |
currently rendered text
|
protected |
horizontal tabulation width (number of space symbols)