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

Method getAscent

src/SFML/Graphics/Font.cpp:328–341  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

326
327////////////////////////////////////////////////////////////
328float Font::getAscent(unsigned int characterSize) const
329{
330 FT_Face face = m_fontHandles ? m_fontHandles->face : nullptr;
331
332 if (face && setCurrentSize(characterSize))
333 {
334 if (!FT_IS_SCALABLE(face))
335 return static_cast<float>(face->size->metrics.ascender) / float{1 << 6};
336
337 return static_cast<float>(FT_MulFix(face->ascender, face->size->metrics.y_scale)) / float{1 << 6};
338 }
339
340 return 0.f;
341}
342
343
344////////////////////////////////////////////////////////////

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected