ofxOui - UI Components for OpenFrameworks

Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ofxOui::Globals Class Reference

Global configuration. More...

#include <ofxOuiCommon.hpp>

Static Public Member Functions

static void setRetina (bool enabled)
 Set retina display on/off. More...
 
static bool getRetina ()
 Get the retina setting. More...
 
static void setDefaultFontPath (string path)
 Set the default font path. More...
 
static string getDefaultFontPath ()
 Get the default font path. More...
 
static void setDefaultFontSize (float font_size)
 Set the default font size. More...
 
static float getDefaultFontSize ()
 Get the default font size. More...
 
static void setDefaultLineHeight (float line_height)
 Set the default line height. More...
 
static float getDefaultLineHeight ()
 Get the default line height. More...
 
static ofTrueTypeFont * requestFont (void *client, string font_path, float font_size, float line_height, float letter_spacing)
 Request a font with a particular setting. More...
 
static void releaseFont (void *client)
 Release a font from a particular client. More...
 

Private Member Functions

 Globals ()
 
 Globals (const Globals &)=delete
 
 Globals (Globals &&)=delete
 
Globalsoperator= (const Globals &)=delete
 
Globalsoperator= (Globals &&)=delete
 
void reloadFonts ()
 

Static Private Member Functions

static GlobalsgetInstance ()
 

Private Attributes

bool retina_enabled_ = false
 
string font_path_ = "Lato-Regular.ttf"
 
float font_size_ = 10.
 
float line_height_ = 12.
 
map< pair< string, vector< float > >, pair< ofTrueTypeFont *, set< void * > > > catalog_
 

Detailed Description

Global configuration.

Constructor & Destructor Documentation

§ Globals() [1/3]

ofxOui::Globals::Globals ( )
inlineprivate

§ Globals() [2/3]

ofxOui::Globals::Globals ( const Globals )
privatedelete

§ Globals() [3/3]

ofxOui::Globals::Globals ( Globals &&  )
privatedelete

Member Function Documentation

§ getDefaultFontPath()

static string ofxOui::Globals::getDefaultFontPath ( )
inlinestatic

Get the default font path.

Returns
path to the default TTF font

§ getDefaultFontSize()

static float ofxOui::Globals::getDefaultFontSize ( )
inlinestatic

Get the default font size.

Returns
the default font size for all UI components

§ getDefaultLineHeight()

static float ofxOui::Globals::getDefaultLineHeight ( )
inlinestatic

Get the default line height.

Returns
the default line height for all UI components

§ getInstance()

static Globals& ofxOui::Globals::getInstance ( )
inlinestaticprivate

§ getRetina()

static bool ofxOui::Globals::getRetina ( )
inlinestatic

Get the retina setting.

Returns
true if the screen is high definition

§ operator=() [1/2]

Globals& ofxOui::Globals::operator= ( const Globals )
privatedelete

§ operator=() [2/2]

Globals& ofxOui::Globals::operator= ( Globals &&  )
privatedelete

§ releaseFont()

static void ofxOui::Globals::releaseFont ( void *  client)
inlinestatic

Release a font from a particular client.

Parameters
clientpointer to the client who initially requested the font

§ reloadFonts()

void ofxOui::Globals::reloadFonts ( )
inlineprivate

§ requestFont()

static ofTrueTypeFont* ofxOui::Globals::requestFont ( void *  client,
string  font_path,
float  font_size,
float  line_height,
float  letter_spacing 
)
inlinestatic

Request a font with a particular setting.

Parameters
clientpointer to the client who requested the font
font_pathpath to the TTF font
font_sizefont size (pts)
line_heightline height (pts)
letter_spacingletter spacing (pts)
Returns
a pointer to the font with required settings

§ setDefaultFontPath()

static void ofxOui::Globals::setDefaultFontPath ( string  path)
inlinestatic

Set the default font path.

Parameters
pathpath to the default TTF font

§ setDefaultFontSize()

static void ofxOui::Globals::setDefaultFontSize ( float  font_size)
inlinestatic

Set the default font size.

Parameters
font_sizefont size

§ setDefaultLineHeight()

static void ofxOui::Globals::setDefaultLineHeight ( float  line_height)
inlinestatic

Set the default line height.

Parameters
line_heightline height

§ setRetina()

static void ofxOui::Globals::setRetina ( bool  enabled)
inlinestatic

Set retina display on/off.

Parameters
enabledSpecifies if high definition should be enabled

Member Data Documentation

§ catalog_

map<pair<string, vector<float> >, pair<ofTrueTypeFont*, set<void*> > > ofxOui::Globals::catalog_
private

§ font_path_

string ofxOui::Globals::font_path_ = "Lato-Regular.ttf"
private

§ font_size_

float ofxOui::Globals::font_size_ = 10.
private

§ line_height_

float ofxOui::Globals::line_height_ = 12.
private

§ retina_enabled_

bool ofxOui::Globals::retina_enabled_ = false
private

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