mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-29 05:56:13 +01:00
PR 1690 Add font enable / disable smoothing
Also added a check for whether the font is smoothing
This commit is contained in:
1 parent
7cbcd8f9fa
commit
e606b52c39
2 files changed
+49
No files matched your search
@@ -161,6 +161,35 @@ CSFML_GRAPHICS_API float sfFont_getUnderlineThickness(const sfFont* font, unsign
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API const sfTexture* sfFont_getTexture(sfFont* font, unsigned int characterSize);
|
CSFML_GRAPHICS_API const sfTexture* sfFont_getTexture(sfFont* font, unsigned int characterSize);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Enable or disable the smooth filter
|
||||||
|
///
|
||||||
|
/// When the filter is activated, the font appears smoother
|
||||||
|
/// so that pixels are less noticeable. However if you want
|
||||||
|
/// the font to look exactly the same as its source file,
|
||||||
|
/// you should disable it.
|
||||||
|
/// The smooth filter is enabled by default.
|
||||||
|
///
|
||||||
|
/// \param font Source font
|
||||||
|
/// \param smooth sfTrue to enable smoothing, sfFalse to disable it
|
||||||
|
///
|
||||||
|
/// \see isSmooth
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API void sfFont_setSmooth(sfFont* font, sfBool smooth);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Tell whether the smooth filter is enabled or disabled
|
||||||
|
///
|
||||||
|
/// \param font Source font
|
||||||
|
///
|
||||||
|
/// \return sfTrue if smoothing is enabled, sfFalse if it is disabled
|
||||||
|
///
|
||||||
|
/// \see setSmooth
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API const sfBool sfFont_isSmooth(const sfFont* font);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the font information
|
/// \brief Get the font information
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -152,6 +152,26 @@ const sfTexture* sfFont_getTexture(sfFont* font, unsigned int characterSize)
|
|||||||
return &font->Textures[characterSize];
|
return &font->Textures[characterSize];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
void sfFont_setSmooth(sfFont* font, sfBool smooth)
|
||||||
|
{
|
||||||
|
font->This.setSmooth(smooth == sfTrue);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
const sfBool sfFont_isSmooth(const sfFont *font)
|
||||||
|
{
|
||||||
|
if (font->This.isSmooth())
|
||||||
|
{
|
||||||
|
return sfTrue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return sfFalse;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
sfFontInfo sfFont_getInfo(const sfFont* font)
|
sfFontInfo sfFont_getInfo(const sfFont* font)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user