13 #ifndef __CU_TTFONT_H__
14 #define __CU_TTFONT_H__
21 #pragma mark Font Class
23 #define COMPUTE_NAME(source,size) (source+"::"+std::to_string(size))
41 CC_DISALLOW_COPY_AND_ASSIGN(
TTFont);
58 #pragma mark Attributes
67 const std::string&
getName()
const {
return _ident; }
74 const std::string&
getSource()
const {
return _source; }
84 float getSize()
const {
return _config.fontSize; }
94 const TTFConfig&
getTTF()
const {
return _config; }
104 const FontAtlas*
getAtlas()
const {
return _atlas; }
107 CC_CONSTRUCTOR_ACCESS:
108 #pragma mark Initializers
112 TTFont() : Ref(), _ident(
""), _source(
""), _atlas(nullptr) {}
119 ~TTFont() { CCASSERT(_atlas ==
nullptr,
"Font asset was not unloaded"); }
131 static TTFont* create(std::string source,
float size);
143 bool init(std::string source,
float size);
const std::string & getSource() const
Definition: CUTTFont.h:74
~TTFont()
Definition: CUTTFont.h:119
float getSize() const
Definition: CUTTFont.h:84
const FontAtlas * getAtlas() const
Definition: CUTTFont.h:104
std::string _source
Definition: CUTTFont.h:48
Definition: CUFontLoader.h:62
std::string _ident
Definition: CUTTFont.h:45
const TTFConfig & getTTF() const
Definition: CUTTFont.h:94
TTFConfig _config
Definition: CUTTFont.h:51
Definition: CUTTFont.h:38
const std::string & getName() const
Definition: CUTTFont.h:67
FontAtlas * _atlas
Definition: CUTTFont.h:54