MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / HGEFont

Method HGEFont

LuaSTGPlus/ResourceMgr.cpp:276–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

274}
275
276ResFont::HGEFont::HGEFont(std::unordered_map<wchar_t, f2dGlyphInfo>&& org, fcyRefPointer<f2dTexture2D> pTex)
277 : m_Charset(std::move(org)), m_pTex(pTex)
278{
279 // �����������ΪLineHeight
280 m_fLineHeight = 0;
281 for (auto i = m_Charset.begin(); i != m_Charset.end(); ++i)
282 m_fLineHeight = ::max(m_fLineHeight, i->second.GlyphSize.y);
283
284 // ������������
285 for (auto& i : m_Charset)
286 {
287 i.second.GlyphPos.a.x /= pTex->GetWidth();
288 i.second.GlyphPos.b.x /= pTex->GetWidth();
289 i.second.GlyphPos.a.y /= pTex->GetHeight();
290 i.second.GlyphPos.b.y /= pTex->GetHeight();
291 }
292}
293
294fFloat ResFont::HGEFont::GetLineHeight()
295{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected