(svn r23472) -Fix [FS#4877]: the monospace font broke the bootstrap GUI's ability to find a font

This commit is contained in:
rubidium
2011-12-10 12:56:37 +00:00
parent b9a1468fde
commit 30eee4db4e
3 changed files with 10 additions and 7 deletions

View File

@@ -1516,13 +1516,16 @@ void DoPaletteAnimations()
}
/** Initialize _stringwidth_table cache */
void LoadStringWidthTable()
/**
* Initialize _stringwidth_table cache
* @param monospace Whether to load the monospace cache or the normal fonts.
*/
void LoadStringWidthTable(bool monospace)
{
_max_char_height = 0;
_max_char_width = 0;
for (FontSize fs = FS_BEGIN; fs < FS_END; fs++) {
for (FontSize fs = monospace ? FS_MONO : FS_BEGIN; fs < (monospace ? FS_END : FS_MONO); fs++) {
_max_char_height = max<int>(_max_char_height, GetCharacterHeight(fs));
for (uint i = 0; i != 224; i++) {
_stringwidth_table[fs][i] = GetGlyphWidth(fs, i + 32);