18 mSubstituteGlyphInfo(nullptr),
25 CharMap::const_iterator iter = mCharMap.find(_id);
27 if (iter != mCharMap.end())
30 return mSubstituteGlyphInfo;
33 void ResourceManualFont::loadTexture()
35 if (mTexture ==
nullptr)
39 if (mTexture ==
nullptr)
42 if (mTexture !=
nullptr)
55 if (node->
getName() ==
"Property")
59 if (key ==
"Source") mSource = value;
61 else if (key ==
"Shader") mShader = value;
67 if (mTexture !=
nullptr)
71 int textureWidth = mTexture->
getWidth();
72 int textureHeight = mTexture->
getHeight();
80 while (element.
next(
"Code"))
87 if (value ==
"cursor")
89 else if (value ==
"selected")
91 else if (value ==
"selected_back")
93 else if (value ==
"substitute")
98 float advance(utility::parseValue<float>(element->
findAttribute(
"advance")));
105 std::string sizeString;
109 size = utility::parseValue<FloatSize>(sizeString);
113 advance = size.
width;
123 coord.
left / textureWidth,
124 coord.
top / textureHeight,
125 coord.
right() / textureWidth,
126 coord.
bottom() / textureHeight)
130 mSubstituteGlyphInfo = &glyphInfo;
145 return mDefaultHeight;
158 if (mTexture !=
nullptr)
170 mDefaultHeight = value;
175 GlyphInfo& inserted = mCharMap.insert(CharMap::value_type(
id, info)).first->second;
178 mSubstituteGlyphInfo = &inserted;
void deserialization(xml::ElementPtr _node, Version _version) override
virtual void setShader(const std::string &_shaderName)=0
virtual int getWidth() const =0
virtual void loadFromFile(const std::string &_filename)=0
virtual int getHeight() const =0
virtual ITexture * getTexture(const std::string &_name)=0
virtual ITexture * createTexture(const std::string &_name)=0
static RenderManager & getInstance()
ITexture * getTextureFont() const override
void setShader(const std::string &value)
void addGlyphInfo(Char id, const GlyphInfo &info)
void setSource(const std::string &value)
void setDefaultHeight(int value)
int getDefaultHeight() const override
const GlyphInfo * getGlyphInfo(Char _id) const override
void setTexture(MyGUI::ITexture *texture)
void deserialization(xml::ElementPtr _node, Version _version) override
ElementEnumerator getElementEnumerator()
const std::string & getName() const
bool findAttribute(const std::string &_name, std::string &_value)
int parseInt(const std::string &_value)
unsigned int parseUInt(const std::string &_value)