37 template <> FontManager* Singleton<FontManager>::msInstance =
nullptr;
38 template <>
const char* Singleton<FontManager>::mClassTypeName(
"FontManager");
55 mDefaultName =
"Default";
72 mIsInitialise =
false;
88 if (font->
findAttribute(
"resolution").empty()) type =
"ResourceManualFont";
89 else type =
"ResourceTrueTypeFont";
96 node->addAttribute(
"name", name);
103 prop->addAttribute(
"value", tmp);
110 prop->addAttribute(
"value", tmp);
117 prop->addAttribute(
"value", tmp);
124 prop->addAttribute(
"value", tmp);
131 prop->addAttribute(
"value", tmp);
138 prop->addAttribute(
"value", tmp);
145 prop->addAttribute(
"value", tmp);
152 prop->addAttribute(
"value", tmp);
159 prop->addAttribute(
"value", tmp);
166 prop->addAttribute(
"value", tmp);
172 while (codeold.next(
"Code"))
176 if (codeold->findAttribute(
"range", tmp))
179 if (codeold->findAttribute(
"hide", tmp))
180 codenew->addAttribute(
"hide", tmp);
182 if (codeold->findAttribute(
"index", tmp))
183 codenew->addAttribute(
"index", tmp);
185 if (codeold->findAttribute(
"coord", tmp))
186 codenew->addAttribute(
"coord", tmp);
195 if (key ==
"Default")
196 mDefaultName = value;
203 mDefaultName = _value;
213 if (result ==
nullptr)
218 MYGUI_LOG(Error,
"Font '" << _name <<
"' not found. Replaced with default font.");
const std::string RESOURCE_DEFAULT_NAME("Default")
void unregisterLoadXmlDelegate(const std::string &_key)
LoadXmlDelegate & registerLoadXmlDelegate(const std::string &_key)
delegates::IDelegate0 * newDelegate(void(*_func)())
static ResourceManager & getInstance()
void loadFromXmlNode(xml::ElementPtr _node, const std::string &_file, Version _version)
bool findAttribute(const std::string &_name, std::string &_value)
static const char * getClassTypeName()
const std::string XML_TYPE("Font")
IResource * getByName(const std::string &_name, bool _throw=true) const
#define MYGUI_LOG(level, text)
const std::string & getDefaultFont() const
#define MYGUI_ASSERT(exp, dest)
const std::string XML_TYPE_PROPERTY("Property")
Type * castType(bool _throw=true)
void unregisterFactory(const std::string &_category, const std::string &_type)
void registerFactory(const std::string &_category, const std::string &_type, Delegate::IDelegate *_delegate)
ElementEnumerator getElementEnumerator()
IFont * getByName(const std::string &_name) const
const std::string & getName() const
void setDefaultFont(const std::string &_value)
void addAttribute(const std::string &_key, const T &_value)
const std::string XML_TYPE_RESOURCE("Resource")
ElementPtr createChild(const std::string &_name, const std::string &_content="", ElementType _type=ElementType::Normal)