| 305 | } |
| 306 | |
| 307 | Eigen::Vector2f Font::sizeText(std::string text) const |
| 308 | { |
| 309 | float cwidth = 0.0f; |
| 310 | for(unsigned int i = 0; i < text.length(); i++) |
| 311 | { |
| 312 | unsigned char letter = text[i]; |
| 313 | if(letter < 32 || letter >= 128) |
| 314 | letter = 127; |
| 315 | |
| 316 | cwidth += charData[letter].advX * fontScale; |
| 317 | } |
| 318 | |
| 319 | return Eigen::Vector2f(cwidth, getHeight()); |
| 320 | } |
| 321 | |
| 322 | int Font::getHeight() const |
| 323 | { |
no outgoing calls
no test coverage detected