Handle all numeric characters as fixed width, even in variable spaced fonts
authorIngo Ruhnke <grumbel@gmail.com>
Tue, 26 Aug 2014 10:54:08 +0000 (12:54 +0200)
committerIngo Ruhnke <grumbel@gmail.com>
Tue, 26 Aug 2014 22:57:45 +0000 (00:57 +0200)
This reduces jitter when numeric values change, such as in the
download status dialog.

src/video/font.cpp

index 4185445..aeb2e20 100644 (file)
@@ -202,7 +202,7 @@ Font::loadFontSurface(
       Glyph glyph;
       glyph.surface_idx   = surface_idx;
 
-      if( glyph_width_ == FIXED )
+      if( glyph_width_ == FIXED || isdigit(*chr) )
       {
         glyph.rect    = Rectf(x, y, x + char_width, y + char_height);
         glyph.offset  = Vector(0, 0);