TextTTF permits to render text in the pixmap buffer by using the freetype fonts. More...
#include <TextTTF.h>
Public Types | |
enum | Justification { LEFT = 0x01, RIGHT = 0x02, CENTER = 0x03, BOTTOM = 0x04, MIDDLE = 0x05, TOP = 0x06 } |
enum | ViewportMapping { NONE, RESCALE, ADJUST } |
Public Member Functions | |
void | render () |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// | |
void | setFileName (const std::string &) |
void | setJustification (Justification, Justification) |
void | setRotated (bool) |
void | setSize (float) |
void | setString (const std::string &) |
void | setStrings (const std::vector< std::string > &) |
TextTTF () | |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// | |
virtual | ~TextTTF () |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// | |
Private Member Functions | |
bool | getTextSizePixels (short &, short &) |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// | |
void | initFont () |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// | |
void | renderCharacter (char) |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// | |
void | renderString (const std::string &) |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// | |
bool | setup () |
Private Attributes | |
bool | fInitFont |
int | fPointSize |
bool | fRotated |
bool | fStatus |
TextTTF_Internal * | fTTF |
int | fViewportHeight |
int | fViewportWidth |
std::string | m_fileName |
Justification | m_horizontalJustification |
float | m_size |
std::vector< std::string > | m_strings |
Justification | m_verticalJustification |
ViewportMapping | m_viewportMapping |
TextTTF permits to render text in the pixmap buffer by using the freetype fonts.
It permits to have portable (X11, Win32) rendering for scalable fonts.
Definition at line 24 of file TextTTF.h.
enum Justification |
enum ViewportMapping |
TextTTF | ( | ) |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
Definition at line 57 of file TextTTF.cxx.
References TextTTF::BOTTOM, TextTTF::fInitFont, TextTTF::fPointSize, TextTTF::fTTF, TextTTF::initFont(), TextTTF::LEFT, TextTTF::m_fileName, TextTTF::m_horizontalJustification, TextTTF::m_size, TextTTF::m_verticalJustification, TextTTF::m_viewportMapping, and TextTTF::NONE.
~TextTTF | ( | ) | [virtual] |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
Definition at line 101 of file TextTTF.cxx.
References TextTTF::fStatus, and TextTTF::fTTF.
bool getTextSizePixels | ( | short & | aWidth, | |
short & | aHeight | |||
) | [private] |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
Definition at line 633 of file TextTTF.cxx.
References TextTTF::fStatus, TextTTF::fTTF, and TextTTF::m_strings.
Referenced by TextTTF::render().
void initFont | ( | ) | [private] |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
Definition at line 264 of file TextTTF.cxx.
References TextTTF::fPointSize, TextTTF::fStatus, TextTTF::fTTF, and TextTTF::m_fileName.
Referenced by TextTTF::render(), and TextTTF::TextTTF().
void render | ( | ) |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
Definition at line 144 of file TextTTF.cxx.
References TextTTF::BOTTOM, TextTTF::CENTER, TextTTF::fInitFont, TextTTF::fPointSize, TextTTF::fStatus, TextTTF::fTTF, TextTTF::getTextSizePixels(), TextTTF::initFont(), TextTTF::LEFT, TextTTF::m_horizontalJustification, TextTTF::m_size, TextTTF::m_strings, TextTTF::m_verticalJustification, TextTTF::m_viewportMapping, TextTTF::MIDDLE, TextTTF::NONE, TextTTF::renderString(), TextTTF::RIGHT, and TextTTF::TOP.
Referenced by OpenGLView::draw_Text().
void renderCharacter | ( | char | aChar | ) | [private] |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
Definition at line 439 of file TextTTF.cxx.
References TextTTF::fRotated, and TextTTF::fTTF.
Referenced by TextTTF::renderString().
void renderString | ( | const std::string & | aString | ) | [private] |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
Definition at line 421 of file TextTTF.cxx.
References TextTTF::fTTF, and TextTTF::renderCharacter().
Referenced by TextTTF::render().
void setFileName | ( | const std::string & | aFileName | ) |
Definition at line 118 of file TextTTF.cxx.
References TextTTF::fInitFont, and TextTTF::m_fileName.
void setJustification | ( | Justification | aH, | |
Justification | aV | |||
) |
Definition at line 135 of file TextTTF.cxx.
References TextTTF::fInitFont, TextTTF::m_horizontalJustification, and TextTTF::m_verticalJustification.
Referenced by OpenGLView::draw_Text().
void setRotated | ( | bool | aYesNo | ) |
Definition at line 140 of file TextTTF.cxx.
References TextTTF::fRotated.
Referenced by OpenGLView::draw_Text().
void setSize | ( | float | aSize | ) |
Definition at line 131 of file TextTTF.cxx.
References TextTTF::fInitFont, and TextTTF::m_size.
Referenced by OpenGLView::draw_Text().
void setString | ( | const std::string & | aString | ) |
Definition at line 122 of file TextTTF.cxx.
References TextTTF::fInitFont, and TextTTF::m_strings.
Referenced by OpenGLView::draw_Text().
void setStrings | ( | const std::vector< std::string > & | aStrings | ) |
Definition at line 127 of file TextTTF.cxx.
References TextTTF::fInitFont, and TextTTF::m_strings.
bool setup | ( | ) | [private] |
bool fInitFont [private] |
Definition at line 65 of file TextTTF.h.
Referenced by TextTTF::render(), TextTTF::setFileName(), TextTTF::setJustification(), TextTTF::setSize(), TextTTF::setString(), TextTTF::setStrings(), and TextTTF::TextTTF().
int fPointSize [private] |
Definition at line 66 of file TextTTF.h.
Referenced by TextTTF::initFont(), TextTTF::render(), and TextTTF::TextTTF().
bool fRotated [private] |
Definition at line 69 of file TextTTF.h.
Referenced by TextTTF::renderCharacter(), and TextTTF::setRotated().
bool fStatus [private] |
Definition at line 63 of file TextTTF.h.
Referenced by TextTTF::getTextSizePixels(), TextTTF::initFont(), TextTTF::render(), and TextTTF::~TextTTF().
TextTTF_Internal* fTTF [private] |
Definition at line 62 of file TextTTF.h.
Referenced by TextTTF::getTextSizePixels(), TextTTF::initFont(), TextTTF::render(), TextTTF::renderCharacter(), TextTTF::renderString(), TextTTF::TextTTF(), and TextTTF::~TextTTF().
int fViewportHeight [private] |
int fViewportWidth [private] |
std::string m_fileName [private] |
Definition at line 55 of file TextTTF.h.
Referenced by TextTTF::initFont(), TextTTF::setFileName(), and TextTTF::TextTTF().
Justification m_horizontalJustification [private] |
Definition at line 58 of file TextTTF.h.
Referenced by TextTTF::render(), TextTTF::setJustification(), and TextTTF::TextTTF().
float m_size [private] |
Definition at line 57 of file TextTTF.h.
Referenced by TextTTF::render(), TextTTF::setSize(), and TextTTF::TextTTF().
std::vector<std::string> m_strings [private] |
Definition at line 56 of file TextTTF.h.
Referenced by TextTTF::getTextSizePixels(), TextTTF::render(), TextTTF::setString(), and TextTTF::setStrings().
Justification m_verticalJustification [private] |
Definition at line 59 of file TextTTF.h.
Referenced by TextTTF::render(), TextTTF::setJustification(), and TextTTF::TextTTF().
ViewportMapping m_viewportMapping [private] |
Definition at line 60 of file TextTTF.h.
Referenced by TextTTF::render(), and TextTTF::TextTTF().