diff --git a/src/SFML/Graphics/Font.cpp b/src/SFML/Graphics/Font.cpp index b6f5c604c..cafba5ba7 100644 --- a/src/SFML/Graphics/Font.cpp +++ b/src/SFML/Graphics/Font.cpp @@ -727,6 +727,7 @@ IntRect Font::findGlyphRect(Page& page, unsigned int width, unsigned int height) // Make the texture 2 times bigger Texture newTexture; newTexture.create(textureWidth * 2, textureHeight * 2); + newTexture.setSmooth(true); newTexture.update(page.texture); page.texture.swap(newTexture); } diff --git a/src/SFML/Graphics/Text.cpp b/src/SFML/Graphics/Text.cpp index fae7d9ac0..66875513c 100644 --- a/src/SFML/Graphics/Text.cpp +++ b/src/SFML/Graphics/Text.cpp @@ -50,15 +50,17 @@ namespace // Add a glyph quad to the vertex array void addGlyphQuad(sf::VertexArray& vertices, sf::Vector2f position, const sf::Color& color, const sf::Glyph& glyph, float italicShear, float outlineThickness = 0) { - float left = glyph.bounds.left; - float top = glyph.bounds.top; - float right = glyph.bounds.left + glyph.bounds.width; - float bottom = glyph.bounds.top + glyph.bounds.height; + float padding = 1.0; - float u1 = static_cast(glyph.textureRect.left); - float v1 = static_cast(glyph.textureRect.top); - float u2 = static_cast(glyph.textureRect.left + glyph.textureRect.width); - float v2 = static_cast(glyph.textureRect.top + glyph.textureRect.height); + float left = glyph.bounds.left - padding; + float top = glyph.bounds.top - padding; + float right = glyph.bounds.left + glyph.bounds.width + padding; + float bottom = glyph.bounds.top + glyph.bounds.height + padding; + + float u1 = static_cast(glyph.textureRect.left) - padding; + float v1 = static_cast(glyph.textureRect.top) - padding; + float u2 = static_cast(glyph.textureRect.left + glyph.textureRect.width) + padding; + float v2 = static_cast(glyph.textureRect.top + glyph.textureRect.height) + padding; vertices.append(sf::Vertex(sf::Vector2f(position.x + left - italicShear * top - outlineThickness, position.y + top - outlineThickness), color, sf::Vector2f(u1, v1))); vertices.append(sf::Vertex(sf::Vector2f(position.x + right - italicShear * top - outlineThickness, position.y + top - outlineThickness), color, sf::Vector2f(u2, v1)));