diff --git a/include/SFML/Graphics/Font.h b/include/SFML/Graphics/Font.h index 2175294..88030af 100644 --- a/include/SFML/Graphics/Font.h +++ b/include/SFML/Graphics/Font.h @@ -121,6 +121,33 @@ CSFML_GRAPHICS_API float sfFont_getKerning(sfFont* font, sfUint32 first, sfUint3 //////////////////////////////////////////////////////////// CSFML_GRAPHICS_API float sfFont_getLineSpacing(sfFont* font, unsigned int characterSize); +//////////////////////////////////////////////////////////// +/// \brief Get the position of the underline +/// +/// Underline position is the vertical offset to apply between the +/// baseline and the underline. +/// +/// \param font Source font +/// \param characterSize Reference character size +/// +/// \return Underline position, in pixels +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API float sfFont_getUnderlinePosition(sfFont* font, unsigned int characterSize); + +//////////////////////////////////////////////////////////// +/// \brief Get the thickness of the underline +/// +/// Underline thickness is the vertical size of the underline. +/// +/// \param font Source font +/// \param characterSize Reference character size +/// +/// \return Underline thickness, in pixels +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API float sfFont_getUnderlineThickness(sfFont* font, unsigned int characterSize); + //////////////////////////////////////////////////////////// /// \brief Get the texture containing the glyphs of a given size in a font /// diff --git a/src/SFML/Graphics/Font.cpp b/src/SFML/Graphics/Font.cpp index 6f003e9..b456382 100644 --- a/src/SFML/Graphics/Font.cpp +++ b/src/SFML/Graphics/Font.cpp @@ -128,6 +128,20 @@ float sfFont_getLineSpacing(sfFont* font, unsigned int characterSize) } +//////////////////////////////////////////////////////////// +float sfFont_getUnderlinePosition(sfFont* font, unsigned int characterSize) +{ + CSFML_CALL_RETURN(font, getUnderlinePosition(characterSize), 0) +} + + +//////////////////////////////////////////////////////////// +float sfFont_getUnderlineThickness(sfFont* font, unsigned int characterSize) +{ + CSFML_CALL_RETURN(font, getUnderlineThickness(characterSize), 0) +} + + //////////////////////////////////////////////////////////// const sfTexture* sfFont_getTexture(sfFont* font, unsigned int characterSize) {