8#ifdef GA_OPENFRAMEWORKS
9#include "ofTrueTypeFont.h"
14#ifdef GA_OPENFRAMEWORKS
15class Font :
public ofTrueTypeFont
18 const ofTrueTypeFontSettings& getSettings()
20 return ofTrueTypeFont::settings;
22 float getWidth(
const std::string& str )
const
24 return getStringBoundingBox( str, 0, 0 ).width;
26 float getHeight(
const std::string& str )
const
28 return getStringBoundingBox( str, 0, 0 ).width;
30 Rect getBounds(
const std::string& str )
const
32 return getStringBoundingBox( str, 0, 0 );
36inline bool load( Font& font,
const ofTrueTypeFontSettings& settings )
38 return font.load( settings );
60 FontStyle(
const std::string& file_,
int size_,
const std::string&
name =
"" )
64#ifdef GA_OPENFRAMEWORKS
65 ofTrueTypeFontSettings settings(
file,
size );
66 settings.antialiased =
true;
67 settings.contours =
false;
68 settings.simplifyAmt = 0.3f;
71 ofUnicode::Latin1Supplement,
72 ofUnicode::LatinExtendedAdditional,
75 ofUnicode::GeneralPunctuation,
81 ss <<
file.substr(
file.find_last_of(
"/\\" ) + 1 ) <<
"@" <<
size;
resource cache class, represents a container for a resource type organized by name (string)
Definition: resource.h:30
std::shared_ptr< ResourceT > get(const std::string &name)
Definition: resource.h:33
FontCache & fontCache()
Definition: font.h:49
std::string m_name
Definition: font.h:99
int size
Definition: font.h:96
std::string file
Definition: font.h:95
const std::string & name()
Definition: font.h:92
FontStyle()
Definition: font.h:59
const std::shared_ptr< Font > font()
Definition: font.h:93
FontStyle(const std::string &file_, int size_, const std::string &name="")
Definition: font.h:60
bool loaded()
Definition: font.h:91