From 49f37ee8b309076ef151ce2f7d8f8429eeb0c7fb Mon Sep 17 00:00:00 2001
From: Laurent Gomila <laurent.gom@gmail.com>
Date: Fri, 26 Oct 2012 16:49:46 +0200
Subject: [PATCH] Fixed the sf::Font texture corruption bug for big character
 sizes

---
 src/SFML/Graphics/Font.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/SFML/Graphics/Font.cpp b/src/SFML/Graphics/Font.cpp
index 02f36c42..a091196f 100644
--- a/src/SFML/Graphics/Font.cpp
+++ b/src/SFML/Graphics/Font.cpp
@@ -521,9 +521,10 @@ IntRect Font::findGlyphRect(Page& page, unsigned int width, unsigned int height)
             if ((textureWidth * 2 <= Texture::getMaximumSize()) && (textureHeight * 2 <= Texture::getMaximumSize()))
             {
                 // Make the texture 2 times bigger
-                sf::Image pixels = page.texture.copyToImage();
-                page.texture.create(textureWidth * 2, textureHeight * 2);
-                page.texture.update(pixels);
+                Image newImage;
+                newImage.create(textureWidth * 2, textureHeight * 2, Color(255, 255, 255, 0));
+                newImage.copy(page.texture.copyToImage(), 0, 0);
+                page.texture.loadFromImage(newImage);
             }
             else
             {