18 CharMap::const_iterator iter = mCharMap.find(_id);
20 if (iter != mCharMap.end())
23 return mSubstituteGlyphInfo;
26 void ResourceManualFont::loadTexture()
28 if (mTexture ==
nullptr)
32 if (mTexture ==
nullptr)
35 if (mTexture !=
nullptr)
48 if (node->
getName() ==
"Property")
54 else if (key ==
"DefaultHeight")
56 else if (key ==
"Shader")
63 if (mTexture !=
nullptr)
66 mTexture->setShader(mShader);
67 int textureWidth = mTexture->getWidth();
68 int textureHeight = mTexture->getHeight();
76 while (element.
next(
"Code"))
83 if (value ==
"cursor")
85 else if (value ==
"selected")
87 else if (value ==
"selected_back")
89 else if (value ==
"substitute")
100 std::string sizeString;
108 float advance = size.
width;
109 if (!advanceAttribute.empty())
122 coord.
left / textureWidth,
123 coord.
top / textureHeight,
124 coord.
right() / textureWidth,
125 coord.
bottom() / textureHeight}});
143 return mDefaultHeight;
156 if (mTexture !=
nullptr)
157 mTexture->setShader(mShader);
168 mDefaultHeight = value;
173 GlyphInfo& inserted = mCharMap.insert(CharMap::value_type(
id, info)).first->second;
176 mSubstituteGlyphInfo = &inserted;
virtual void loadFromFile(const std::string &_filename)=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 addGlyphInfo(Char id, const GlyphInfo &info)
void setSource(std::string_view value)
void setDefaultHeight(int value)
void setShader(std::string_view 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
bool findAttribute(std::string_view _name, std::string &_value)
ElementEnumerator getElementEnumerator()
const std::string & getName() const
unsigned int parseUInt(std::string_view _value)
T parseValue(std::string_view _value)
int parseInt(std::string_view _value)
types::TCoord< float > FloatCoord
types::TRect< float > FloatRect
types::TPoint< float > FloatPoint
types::TSize< float > FloatSize