Panagiotis Christopoulos Charitos 14 rokov pred
rodič
commit
bbece06190
2 zmenil súbory, kde vykonal 6 pridanie a 3 odobranie
  1. 1 1
      src/Main.cpp
  2. 5 2
      src/Ui/UiFtFontLoader.cpp

+ 1 - 1
src/Main.cpp

@@ -433,7 +433,7 @@ void mainLoop()
 int main(int argc, char* argv[])
 {
 	FT_Vector s = {100, 100};
-	Ui::FtFontLoader fnt("/users/panoscc/src/godlike-projects/libfreetype/Ruritania-Outline.ttf", s);
+	Ui::FtFontLoader fnt("/home/godlike/src/google-code-repo/libfreetype/Ruritania-Outline.ttf", s);
 	fnt.saveImage("/tmp/test.tga");
 
 	return 0;

+ 5 - 2
src/Ui/UiFtFontLoader.cpp

@@ -105,8 +105,6 @@ void FtFontLoader::computeImageSize()
 //======================================================================================================================
 void FtFontLoader::createImage(const char* filename, const FT_Vector& fontSize)
 {
-	FT_Library library;
-	FT_Face face;
 	FT_Error error;
 
 	// Create lib
@@ -118,6 +116,11 @@ void FtFontLoader::createImage(const char* filename, const FT_Vector& fontSize)
 
 	// Create face and set glyph size
 	error = FT_New_Face(library, filename, 0, &face);
+	if(error)
+	{
+		throw EXCEPTION("FT_New_Face failed with filename \"" + filename + "\"");
+	}
+
 	FT_Set_Pixel_Sizes(face, fontSize.x, fontSize.y);
 
 	// Get all glyphs