Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
om::graphics::gui::fonts::TextStyle Class Reference

A class that describes how a style of text should be displayed. More...

#include <omGraphicsGUITextStyle.h>

Public Member Functions

 TextStyle ()
 Create a default text style object with no font. More...
 
 TextStyle (Font *newFont, Float newFontSize, const Color4f &newColor)
 Create a new text style object that has the specified attributes. More...
 
 TextStyle (Font *newFont, Float newFontSize, const Color4f &newColor, const TextLayout &newLayout)
 Create a new text style object that has the specified attributes. More...
 
FontgetFont () const
 Return a pointer to a Font object that determines the glyphs that are used for a text style. More...
 
void setFont (Font *newFont)
 Set a pointer to a Font object that determines the glyphs that are used for a text style. More...
 
Float getSize () const
 Return a number that indicates the nominal size of the font for the style. More...
 
void setSize (Float newSize)
 Set a number that indicates the nominal size of the font for the style. More...
 
const Color4f & getColor () const
 Return a reference to an object that describes the RGBA color of the font glyphs. More...
 
void setColor (const Color4f &newColor)
 Set an object that describes the RGBA color of the font glyphs. More...
 
const Color4f & getOutlineColor () const
 Return a reference to an object that describes the RGBA outline color of the text style. More...
 
void setOutlineColor (const Color4f &newOutlineColor)
 Set an object that describes the RGBA outline color of the text style. More...
 
const TextLayoutgetLayout () const
 Return an object that describes the direction that the text style is layed out. More...
 
void setLayout (const TextLayout &newLayout)
 Set an object that describes the direction that the text style is layed out. More...
 
Float getTabWidth () const
 Return the number of spaces that are used for each tab character. More...
 
void setTabWidth (Float newTabWidth)
 Set the number of spaces that are used for each tab character. More...
 
Float getUnderlineWidth () const
 Return the width in pixels of the text style's underline, if applicable. More...
 
void setUnderlineWidth (Float newUnderlineWidth)
 Set the width in pixels of the text style's underline, if applicable. More...
 
TextFlagsgetFlags ()
 Return a reference to the flags for this text style. More...
 
const TextFlagsgetFlags () const
 Return a const reference to the flags for this text style. More...
 
void setFlags (const TextFlags &newFlags)
 Set the flags for this text style. More...
 
Bool flagIsSet (TextFlags::Flag flag) const
 Return whether or not the specified boolan flag is set for this text style. More...
 
void setFlag (TextFlags::Flag flag, Bool newIsSet=true)
 Set whether or not the specified boolan flag is set for this text style. More...
 
Bool getGlyphLayout (const UTF8String &text, GlyphLayout &layout)
 Update a glyph layout for this text style and the specified. More...
 

Static Public Member Functions

static TextStyle getDefault ()
 Return the default text style that uses the default font. More...
 

Static Public Attributes

static const Float DEFAULT_SIZE
 The default nominal font size to use for this text style. More...
 
static const TextLayout DEFAULT_LAYOUT
 The default layout direction to use for a text style. More...
 
static const Float DEFAULT_TAB_WIDTH
 The default width of a tab character, as a multiple of the width of a space character. More...
 
static const Float DEFAULT_UNDERLINE_WIDTH
 The default width in pixels of a text style underline. More...
 
static const Color4f DEFAULT_COLOR
 The default RGBA color to use for font glyphs. More...
 
static const Color4f DEFAULT_OUTLINE_COLOR
 The default RGBA color to use for font glyph outlines. More...
 

Detailed Description

A class that describes how a style of text should be displayed.

This includes the font to use when rendering text, the nominal size of the font, and the text color.

Constructor & Destructor Documentation

om::graphics::gui::fonts::TextStyle::TextStyle ( )

Create a default text style object with no font.

om::graphics::gui::fonts::TextStyle::TextStyle ( Font newFont,
Float  newFontSize,
const Color4f &  newColor 
)

Create a new text style object that has the specified attributes.

om::graphics::gui::fonts::TextStyle::TextStyle ( Font newFont,
Float  newFontSize,
const Color4f &  newColor,
const TextLayout newLayout 
)

Create a new text style object that has the specified attributes.

Member Function Documentation

Font* om::graphics::gui::fonts::TextStyle::getFont ( ) const
inline

Return a pointer to a Font object that determines the glyphs that are used for a text style.

void om::graphics::gui::fonts::TextStyle::setFont ( Font newFont)
inline

Set a pointer to a Font object that determines the glyphs that are used for a text style.

Float om::graphics::gui::fonts::TextStyle::getSize ( ) const
inline

Return a number that indicates the nominal size of the font for the style.

void om::graphics::gui::fonts::TextStyle::setSize ( Float  newSize)
inline

Set a number that indicates the nominal size of the font for the style.

const Color4f& om::graphics::gui::fonts::TextStyle::getColor ( ) const
inline

Return a reference to an object that describes the RGBA color of the font glyphs.

void om::graphics::gui::fonts::TextStyle::setColor ( const Color4f &  newColor)
inline

Set an object that describes the RGBA color of the font glyphs.

const Color4f& om::graphics::gui::fonts::TextStyle::getOutlineColor ( ) const
inline

Return a reference to an object that describes the RGBA outline color of the text style.

void om::graphics::gui::fonts::TextStyle::setOutlineColor ( const Color4f &  newOutlineColor)
inline

Set an object that describes the RGBA outline color of the text style.

const TextLayout& om::graphics::gui::fonts::TextStyle::getLayout ( ) const
inline

Return an object that describes the direction that the text style is layed out.

void om::graphics::gui::fonts::TextStyle::setLayout ( const TextLayout newLayout)
inline

Set an object that describes the direction that the text style is layed out.

Float om::graphics::gui::fonts::TextStyle::getTabWidth ( ) const
inline

Return the number of spaces that are used for each tab character.

void om::graphics::gui::fonts::TextStyle::setTabWidth ( Float  newTabWidth)
inline

Set the number of spaces that are used for each tab character.

Float om::graphics::gui::fonts::TextStyle::getUnderlineWidth ( ) const
inline

Return the width in pixels of the text style's underline, if applicable.

void om::graphics::gui::fonts::TextStyle::setUnderlineWidth ( Float  newUnderlineWidth)
inline

Set the width in pixels of the text style's underline, if applicable.

TextFlags& om::graphics::gui::fonts::TextStyle::getFlags ( )
inline

Return a reference to the flags for this text style.

const TextFlags& om::graphics::gui::fonts::TextStyle::getFlags ( ) const
inline

Return a const reference to the flags for this text style.

void om::graphics::gui::fonts::TextStyle::setFlags ( const TextFlags newFlags)
inline

Set the flags for this text style.

Bool om::graphics::gui::fonts::TextStyle::flagIsSet ( TextFlags::Flag  flag) const
inline

Return whether or not the specified boolan flag is set for this text style.

void om::graphics::gui::fonts::TextStyle::setFlag ( TextFlags::Flag  flag,
Bool  newIsSet = true 
)
inline

Set whether or not the specified boolan flag is set for this text style.

Bool om::graphics::gui::fonts::TextStyle::getGlyphLayout ( const UTF8String &  text,
GlyphLayout layout 
)

Update a glyph layout for this text style and the specified.

static TextStyle om::graphics::gui::fonts::TextStyle::getDefault ( )
inlinestatic

Return the default text style that uses the default font.

Member Data Documentation

const Float om::graphics::gui::fonts::TextStyle::DEFAULT_SIZE
static

The default nominal font size to use for this text style.

const TextLayout om::graphics::gui::fonts::TextStyle::DEFAULT_LAYOUT
static

The default layout direction to use for a text style.

const Float om::graphics::gui::fonts::TextStyle::DEFAULT_TAB_WIDTH
static

The default width of a tab character, as a multiple of the width of a space character.

const Float om::graphics::gui::fonts::TextStyle::DEFAULT_UNDERLINE_WIDTH
static

The default width in pixels of a text style underline.

const Color4f om::graphics::gui::fonts::TextStyle::DEFAULT_COLOR
static

The default RGBA color to use for font glyphs.

const Color4f om::graphics::gui::fonts::TextStyle::DEFAULT_OUTLINE_COLOR
static

The default RGBA color to use for font glyph outlines.


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