MCPcopy Create free account
hub / github.com/Aloshi/EmulationStation / sizeText

Method sizeText

src/Font.cpp:307–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

305}
306
307Eigen::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
322int Font::getHeight() const
323{

Callers 4

renderMethod · 0.80
calculateExtentMethod · 0.80
SwitchComponentMethod · 0.80
updateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected