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

Method getUnderlinePosition

src/SFML/Graphics/Font.cpp:376–390  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

374
375////////////////////////////////////////////////////////////
376float Font::getUnderlinePosition(unsigned int characterSize) const
377{
378 FT_Face face = m_fontHandles ? m_fontHandles->face : nullptr;
379
380 if (face && setCurrentSize(characterSize))
381 {
382 // Return a fixed position if font is a bitmap font
383 if (!FT_IS_SCALABLE(face))
384 return static_cast<float>(characterSize) / 10.f;
385
386 return -static_cast<float>(FT_MulFix(face->underline_position, face->size->metrics.y_scale)) / float{1 << 6};
387 }
388
389 return 0.f;
390}
391
392
393////////////////////////////////////////////////////////////

Callers 2

Font.test.cppFile · 0.80
ensureGeometryUpdateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected