Browse Source

Fixed love.graphics.newFont using the wrong texture format when creating its glyph texture

Alex Szpakowski 12 years ago
parent
commit
3fcb2201bc
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/modules/graphics/opengl/Font.cpp

+ 2 - 1
src/modules/graphics/opengl/Font.cpp

@@ -71,6 +71,8 @@ Font::Font(love::font::Rasterizer *r, const Image::Filter &filter)
 	try
 	{
 		gd = r->getGlyphData(32);
+		type = (gd->getFormat() == love::font::GlyphData::FORMAT_LUMINANCE_ALPHA) ? FONT_TRUETYPE : FONT_IMAGE;
+
 		loadVolatile();
 	}
 	catch (love::Exception &)
@@ -79,7 +81,6 @@ Font::Font(love::font::Rasterizer *r, const Image::Filter &filter)
 		throw;
 	}
 
-	type = (gd->getFormat() == love::font::GlyphData::FORMAT_LUMINANCE_ALPHA) ? FONT_TRUETYPE : FONT_IMAGE;
 	delete gd;
 
 	rasterizer->retain();