///////////////////////////////////////////////////////
| 374 | |
| 375 | //////////////////////////////////////////////////////////// |
| 376 | float 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 | //////////////////////////////////////////////////////////// |
no outgoing calls
no test coverage detected