MCPcopy Create free account
hub / github.com/SFML/SFML / getUnderlineThickness

Method getUnderlineThickness

src/SFML/Graphics/Font.cpp:394–408  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

392
393////////////////////////////////////////////////////////////
394float Font::getUnderlineThickness(unsigned int characterSize) const
395{
396 FT_Face face = m_fontHandles ? m_fontHandles->face : nullptr;
397
398 if (face && setCurrentSize(characterSize))
399 {
400 // Return a fixed thickness if font is a bitmap font
401 if (!FT_IS_SCALABLE(face))
402 return static_cast<float>(characterSize) / 14.f;
403
404 return static_cast<float>(FT_MulFix(face->underline_thickness, face->size->metrics.y_scale)) / float{1 << 6};
405 }
406
407 return 0.f;
408}
409
410
411////////////////////////////////////////////////////////////

Callers 2

Font.test.cppFile · 0.80
ensureGeometryUpdateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected