From 1f1672d6cc7edf296402956132703245f1fe51b8 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Tue, 12 Jan 2010 07:03:11 +0000 Subject: [PATCH] Enforce that numbers are all the same exact width when loading fonts. --- src/emu/rendfont.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/emu/rendfont.c b/src/emu/rendfont.c index 1383734adee..c4b6719fa09 100644 --- a/src/emu/rendfont.c +++ b/src/emu/rendfont.c @@ -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; }