MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / getFontWidth

Method getFontWidth

framework/font.cpp:44–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44int BitmapFont::getFontWidth(const UString &Text)
45{
46 int textlen = 0;
47
48 auto u32Text = to_u32string(Text);
49
50 for (const auto &c : u32Text)
51 {
52 auto glyph = this->getGlyph(c);
53 textlen += glyph->size.x;
54 }
55 return textlen;
56}
57
58int BitmapFont::getFontHeight() const { return fontheight; }
59

Callers 4

getStringMethod · 0.95
onRenderMethod · 0.80
onRenderMethod · 0.80
onRenderMethod · 0.80

Calls 2

getGlyphMethod · 0.95
to_u32stringFunction · 0.85

Tested by

no test coverage detected