From 30ae49864a6cbfbeabe5d6bfe6d04cf42ea5985d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20W=2E=20Urba=C5=84czyk?= Date: Fri, 5 Nov 2010 20:48:54 +0000 Subject: [PATCH] Workaround for the font issue. --- client/Graphics.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/client/Graphics.cpp b/client/Graphics.cpp index 6528f6168..307fef68f 100644 --- a/client/Graphics.cpp +++ b/client/Graphics.cpp @@ -696,6 +696,15 @@ Font * Graphics::loadFont( const char * name ) tlog1 << "Error: cannot load font: " << name << std::endl; return NULL; } + + int magic = *(const int*)hlp; + if(len < 10000 || magic != 589598 && magic != 589599) + { + tlog1 << "Suspicious font file (length " << len <<", fname " << name << "), logging to suspicious_" << name << ".fnt\n"; + std::ofstream o("suspicious_" + std::string(name) + ".fnt"); + o.write((const char*)hlp, len); + } + Font *ret = new Font(hlp); return ret; } @@ -707,7 +716,8 @@ void Graphics::loadFonts() assert(ARRAY_COUNT(fontnames) == FONTS_NUMBER); for(int i = 0; i < FONTS_NUMBER; i++) - fonts[i] = loadFont(fontnames[i]); + if(i != 2) //TODO TODO TODO !!! + fonts[i] = loadFont(fontnames[i]); } Font::Font(unsigned char *Data)