Enforce that numbers are all the same exact width when loading fonts.

This commit is contained in:
Aaron Giles 2010-01-12 07:03:11 +00:00
parent 470f843262
commit 1f1672d6cc

View File

@ -600,6 +600,18 @@ static int render_font_load_bdf(render_font *font)
mame_printf_warning("Loading BDF font... (%d characters loaded)\n", charcount);
}
}
/* make sure all the numbers are the same width */
if (font->chars[0] != NULL)
{
int maxwidth = 0;
for (int ch = '0'; ch <= '9'; ch++)
if (font->chars[0][ch].bmwidth > maxwidth)
maxwidth = font->chars[0][ch].width;
for (int ch = '0'; ch <= '9'; ch++)
font->chars[0][ch].width = maxwidth;
}
return 0;
}