- added new console font
authorIngo Ruhnke <grumbel@gmx.de>
Mon, 29 Jan 2007 11:10:40 +0000 (11:10 +0000)
committerIngo Ruhnke <grumbel@gmx.de>
Mon, 29 Jan 2007 11:10:40 +0000 (11:10 +0000)
SVN-Revision: 4725

data/images/engine/fonts/console2-shadow.png [new file with mode: 0644]
data/images/engine/fonts/console2.png [new file with mode: 0644]
src/console.cpp
src/video/font.cpp

diff --git a/data/images/engine/fonts/console2-shadow.png b/data/images/engine/fonts/console2-shadow.png
new file mode 100644 (file)
index 0000000..5ccc89f
Binary files /dev/null and b/data/images/engine/fonts/console2-shadow.png differ
diff --git a/data/images/engine/fonts/console2.png b/data/images/engine/fonts/console2.png
new file mode 100644 (file)
index 0000000..0937e99
Binary files /dev/null and b/data/images/engine/fonts/console2.png differ
index a605702..6d60bd6 100644 (file)
@@ -51,8 +51,8 @@ void
 Console::init_graphics()
 {
   font.reset(new Font(Font::FIXED,
-                      "images/engine/fonts/white-small.png",
-                      "images/engine/fonts/shadow-small.png", 8, 9, 1));
+                      "images/engine/fonts/console2.png",
+                      "images/engine/fonts/console2-shadow.png", 8, 14, 1));
   fontheight = font->get_height();
   background.reset(new Surface("images/engine/console.png"));
   background2.reset(new Surface("images/engine/console2.png"));
@@ -457,7 +457,7 @@ Console::draw(DrawingContext& context)
 
   if (focused) {
     lineNo++;
-    float py = height-4-1*9;
+    float py = height-4-1 * font->get_height();
     context.draw_text(font.get(), "> "+inputBuffer.str()+"_", Vector(4, py), ALIGN_LEFT, layer);
   }
 
@@ -465,8 +465,8 @@ Console::draw(DrawingContext& context)
   for (std::list<std::string>::iterator i = lines.begin(); i != lines.end(); i++) {
     if (skipLines-- > 0) continue;
     lineNo++;
-    float py = height-4-lineNo*9;
-    if (py < -9) break;
+    float py = height - 4 - lineNo*font->get_height();
+    if (py < -font->get_height()) break;
     context.draw_text(font.get(), *i, Vector(4, py), ALIGN_LEFT, layer);
   }
   context.pop_transform();
index 92eb42a..db0633e 100644 (file)
@@ -156,7 +156,7 @@ Font::Font(GlyphWidth glyph_width_,
           else // glyph is completly transparent
             glyph.rect = Rect(x,  y, x + char_width, y + char_height);
 
-          glyph.advance = glyph.rect.get_width();
+          glyph.advance = glyph.rect.get_width() + 1; // FIXME: might be usefull to make spacing configurable
 
           glyphs.push_back(glyph);
           shadow_glyphs.push_back(glyph);