Improved the quality of sf::Text::Bold and made it more efficient

Made sf::Text::Underlined style more robust

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1310 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
LaurentGom 2009-12-14 21:26:30 +00:00
parent 3a34f81561
commit c72312f9a4
9 changed files with 98 additions and 127 deletions

View file

@ -67,11 +67,12 @@ CSFML_API void sfFont_Destroy(sfFont* font);
/// \param font : Source font
/// \param codePoint : Unicode code point of the character to get
/// \param characterSize : Character size, in pixels
/// \param bold Retrieve the bold version or the regular one?
///
/// \return The corresponding glyph
///
////////////////////////////////////////////////////////////
CSFML_API sfGlyph sfFont_GetGlyph(sfFont* font, sfUint32 codePoint, unsigned int characterSize);
CSFML_API sfGlyph sfFont_GetGlyph(sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold);
////////////////////////////////////////////////////////////
/// Get the kerning value corresponding to a given pair of characters in a font

View file

@ -74,12 +74,12 @@ void sfFont_Destroy(sfFont* font)
////////////////////////////////////////////////////////////
/// Get a glyph in a font
////////////////////////////////////////////////////////////
sfGlyph sfFont_GetGlyph(sfFont* font, sfUint32 codePoint, unsigned int characterSize)
sfGlyph sfFont_GetGlyph(sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold)
{
sfGlyph glyph = {0, {0, 0, 0, 0}, {0, 0, 0, 0}};
CSFML_CHECK_RETURN(font, glyph);
sf::Glyph SFMLGlyph = font->This.GetGlyph(codePoint, characterSize);
sf::Glyph SFMLGlyph = font->This.GetGlyph(codePoint, characterSize, bold);
glyph.Advance = SFMLGlyph.Advance;
glyph.Rectangle.Left = SFMLGlyph.Rectangle.Left;