mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-14 02:33:51 +02:00
Workaround for the font issue.
This commit is contained in:
parent
e717f2fd05
commit
30ae49864a
@ -696,6 +696,15 @@ Font * Graphics::loadFont( const char * name )
|
|||||||
tlog1 << "Error: cannot load font: " << name << std::endl;
|
tlog1 << "Error: cannot load font: " << name << std::endl;
|
||||||
return NULL;
|
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);
|
Font *ret = new Font(hlp);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -707,6 +716,7 @@ void Graphics::loadFonts()
|
|||||||
|
|
||||||
assert(ARRAY_COUNT(fontnames) == FONTS_NUMBER);
|
assert(ARRAY_COUNT(fontnames) == FONTS_NUMBER);
|
||||||
for(int i = 0; i < FONTS_NUMBER; i++)
|
for(int i = 0; i < FONTS_NUMBER; i++)
|
||||||
|
if(i != 2) //TODO TODO TODO !!!
|
||||||
fonts[i] = loadFont(fontnames[i]);
|
fonts[i] = loadFont(fontnames[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user