MCPcopy Create free account
hub / github.com/crossuo/crossuo / GetWidthA

Method GetWidthA

src/Managers/FontsManager.cpp:296–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296int CFontsManager::GetWidthA(uint8_t font, const astr_t &str)
297{
298 if (font >= FontCount || str.empty())
299 {
300 return 0;
301 }
302
303 FONT_DATA &fd = Font[font];
304 int textLength = 0;
305
306 for (char c : str)
307 {
308 textLength += fd.Chars[m_FontIndex[(uint8_t)c]].Width;
309 }
310
311 return textLength;
312}
313
314int CFontsManager::GetWidthExA(
315 uint8_t font, const astr_t &str, int maxWidth, TEXT_ALIGN_TYPE align, uint16_t flags)

Callers 8

CreateTextMessageMethod · 0.80
OnTextInputMethod · 0.80
UpdateContentMethod · 0.80
DelayedClickMethod · 0.80
OnTextInputMethod · 0.80
CheckMaxWidthAMethod · 0.80
FixMaxWidthAMethod · 0.80
DrawMaskAMethod · 0.80

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected