| 294 | } |
| 295 | |
| 296 | int 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 | |
| 314 | int CFontsManager::GetWidthExA( |
| 315 | uint8_t font, const astr_t &str, int maxWidth, TEXT_ALIGN_TYPE align, uint16_t flags) |
no test coverage detected