AvogadroLibs 1.97.0
|
The TextProperties class controls formatting options for text.
#include <avogadro/rendering/textproperties.h>
Public Types | |
enum | FontFamily { SansSerif , Serif , Mono } |
enum | HAlign { HLeft , HCenter , HRight } |
enum | VAlign { VTop , VCenter , VBottom } |
enum | FontStyle { NoFontStyle = 0x0 , Bold = 0x1 , Italic = 0x2 , Underline = 0x4 } |
typedef int | FontStyles |
Public Member Functions | |
TextProperties (const TextProperties &other) | |
TextProperties & | operator= (TextProperties other) |
void | swap (TextProperties &other) |
bool | operator== (const TextProperties &other) const |
bool | operator!= (const TextProperties &other) const |
void | setPixelHeight (size_t height) |
size_t | pixelHeight () const |
void | setHAlign (HAlign align) |
HAlign | hAlign () const |
void | setVAlign (VAlign align) |
VAlign | vAlign () const |
void | setAlign (HAlign hAlign, VAlign vAlign) |
void | setRotationDegreesCW (float rot) |
float | rotationDegreesCW () const |
void | setFontFamily (FontFamily family) |
FontFamily | fontFamily () const |
void | setFontStyles (FontStyles styles) |
FontStyles | fontStyles () const |
void | setBold (bool b) |
bool | bold () const |
void | setItalic (bool b) |
bool | italic () const |
void | setUnderline (bool b) |
bool | underline () const |
void | setColorRgba (unsigned char r, unsigned char g, unsigned char b, unsigned char a) |
void | setColorRgba (const unsigned char rgba[4]) |
void | setColorRgba (const Vector4ub &rgba) |
void | colorRgba (unsigned char rgba[4]) const |
Vector4ub | colorRgba () const |
void | setColorRgb (unsigned char r, unsigned char g, unsigned char b) |
void | setColorRgb (const unsigned char rgb[3]) |
void | setColorRgb (const Vector3ub &rgb) |
void | colorRgb (unsigned char rgb[3]) const |
Vector3ub | colorRgb () const |
void | setRed (unsigned char r) |
unsigned char | red () const |
void | setGreen (unsigned char g) |
unsigned char | green () const |
void | setBlue (unsigned char b) |
unsigned char | blue () const |
void | setAlpha (unsigned char a) |
unsigned char | alpha () const |
typedef int FontStyles |
Used for bitwise combinations of FontStyle values.
enum FontFamily |
Enum defining a minimal set of font families.
enum HAlign |
Horizontal alignment options.
enum VAlign |
Vertical alignment options.
enum FontStyle |
Flags for style options (bold, italic, ...)
void setPixelHeight | ( | size_t | height | ) |
The height of the text in pixels.
void setHAlign | ( | HAlign | align | ) |
Horizontal alignment of the text.
void setVAlign | ( | VAlign | align | ) |
Vertical alignment of the text.
void setAlign | ( | TextProperties::HAlign | h, |
TextProperties::VAlign | v | ||
) |
Set the horizontal and vertical alignment of the quad to the anchor point.
void setRotationDegreesCW | ( | float | rot | ) |
Rotates the text clockwise.
void setFontFamily | ( | FontFamily | family | ) |
The font family.
void setFontStyles | ( | FontStyles | styles | ) |
Font style flags.
void setBold | ( | bool | b | ) |
Toggle bold text.
void setItalic | ( | bool | b | ) |
Toggle italic text.
void setUnderline | ( | bool | b | ) |
Toggle underlined text.
void setColorRgba | ( | unsigned char | r, |
unsigned char | g, | ||
unsigned char | b, | ||
unsigned char | a | ||
) |
Set the color of the text. Components are in the range [0, 255]
void setColorRgba | ( | const unsigned char | rgba[4] | ) |
Set the color of the text. Components are in the range [0, 255]
void setColorRgba | ( | const Vector4ub & | rgba | ) |
Set the color of the text. Components are in the range [0, 255]
void colorRgba | ( | unsigned char | rgba[4] | ) | const |
Set the color of the text. Components are in the range [0, 255]
Vector4ub colorRgba | ( | ) | const |
Set the color of the text. Components are in the range [0, 255]
void setColorRgb | ( | unsigned char | r, |
unsigned char | g, | ||
unsigned char | b | ||
) |
Set the color of the text. Components are in the range [0, 255]
void setColorRgb | ( | const unsigned char | rgb[3] | ) |
Set the color of the text. Components are in the range [0, 255]
void setColorRgb | ( | const Vector3ub & | rgb | ) |
Set the color of the text. Components are in the range [0, 255]
void colorRgb | ( | unsigned char | rgb[3] | ) | const |
Set the color of the text. Components are in the range [0, 255]
Vector3ub colorRgb | ( | ) | const |
Set the color of the text. Components are in the range [0, 255]
void setRed | ( | unsigned char | r | ) |
Set the color of the text. Components are in the range [0, 255]
unsigned char red | ( | ) | const |
Set the color of the text. Components are in the range [0, 255]
void setGreen | ( | unsigned char | g | ) |
Set the color of the text. Components are in the range [0, 255]
unsigned char green | ( | ) | const |
Set the color of the text. Components are in the range [0, 255]
void setBlue | ( | unsigned char | b | ) |
Set the color of the text. Components are in the range [0, 255]
unsigned char blue | ( | ) | const |
Set the color of the text. Components are in the range [0, 255]
void setAlpha | ( | unsigned char | a | ) |
Set the color of the text. Components are in the range [0, 255]
unsigned char alpha | ( | ) | const |
Set the color of the text. Components are in the range [0, 255]