Loading...
Searching...
No Matches
TextProperties Class Reference

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

## Member Typedef Documentation

## FontStyles

typedef int FontStyles

Used for bitwise combinations of FontStyle values.

## Member Enumeration Documentation

## FontFamily

enum FontFamily

Enum defining a minimal set of font families.

## HAlign

enum HAlign

Horizontal alignment options.

## VAlign

enum VAlign

Vertical alignment options.

## FontStyle

enum FontStyle

Flags for style options (bold, italic, ...)

## Member Function Documentation

## setPixelHeight()

void setPixelHeight | ( | size_t | height | ) |

The height of the text in pixels.

## setHAlign()

void setHAlign | ( | HAlign | align | ) |

Horizontal alignment of the text.

## setVAlign()

void setVAlign | ( | VAlign | align | ) |

Vertical alignment of the text.

## setAlign()

void setAlign | ( | TextProperties::HAlign | h,
|  | TextProperties::VAlign | v )

Set the horizontal and vertical alignment of the quad to the anchor point.

## setRotationDegreesCW()

void setRotationDegreesCW | ( | float | rot | ) |

Rotates the text clockwise.

## setFontFamily()

void setFontFamily | ( | FontFamily | family | ) |

The font family.

## setFontStyles()

void setFontStyles | ( | FontStyles | styles | ) |

Font style flags.

## setBold()

void setBold | ( | bool | b | ) |

Toggle bold text.

## setItalic()

void setItalic | ( | bool | b | ) |

Toggle italic text.

## setUnderline()

void setUnderline | ( | bool | b | ) |

Toggle underlined text.

## setColorRgba() [1/3]

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]

## setColorRgba() [2/3]

void setColorRgba | ( | const unsigned char | rgba[4] | ) |

Set the color of the text. Components are in the range [0, 255]

## setColorRgba() [3/3]

void setColorRgba | ( | const Vector4ub & | rgba | ) |

Set the color of the text. Components are in the range [0, 255]

## colorRgba() [1/2]

void colorRgba | ( | unsigned char | rgba[4] | ) | const

Set the color of the text. Components are in the range [0, 255]

## colorRgba() [2/2]

Vector4ub colorRgba | ( |  | ) | const

Set the color of the text. Components are in the range [0, 255]

## setColorRgb() [1/3]

void setColorRgb | ( | unsigned char | r,
|  | unsigned char | g,
|  | unsigned char | b )

Set the color of the text. Components are in the range [0, 255]

## setColorRgb() [2/3]

void setColorRgb | ( | const unsigned char | rgb[3] | ) |

Set the color of the text. Components are in the range [0, 255]

## setColorRgb() [3/3]

void setColorRgb | ( | const Vector3ub & | rgb | ) |

Set the color of the text. Components are in the range [0, 255]

## colorRgb() [1/2]

void colorRgb | ( | unsigned char | rgb[3] | ) | const

Set the color of the text. Components are in the range [0, 255]

## colorRgb() [2/2]

Vector3ub colorRgb | ( |  | ) | const

Set the color of the text. Components are in the range [0, 255]

## setRed()

void setRed | ( | unsigned char | r | ) |

Set the color of the text. Components are in the range [0, 255]

## red()

unsigned char red | ( |  | ) | const

Set the color of the text. Components are in the range [0, 255]

## setGreen()

void setGreen | ( | unsigned char | g | ) |

Set the color of the text. Components are in the range [0, 255]

## green()

unsigned char green | ( |  | ) | const

Set the color of the text. Components are in the range [0, 255]

## setBlue()

void setBlue | ( | unsigned char | b | ) |

Set the color of the text. Components are in the range [0, 255]

## blue()

unsigned char blue | ( |  | ) | const

Set the color of the text. Components are in the range [0, 255]

## setAlpha()

void setAlpha | ( | unsigned char | a | ) |

Set the color of the text. Components are in the range [0, 255]

## alpha()

unsigned char alpha | ( |  | ) | const

Set the color of the text. Components are in the range [0, 255]

The documentation for this class was generated from the following file:

- textproperties.h