From: Ingo Ruhnke Date: Mon, 29 Jan 2007 11:10:40 +0000 (+0000) Subject: - added new console font X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=a99e13623a367ffcd0a4f125d16f90b928237f34;p=supertux.git - added new console font SVN-Revision: 4725 --- diff --git a/data/images/engine/fonts/console2-shadow.png b/data/images/engine/fonts/console2-shadow.png new file mode 100644 index 000000000..5ccc89fda 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 index 000000000..0937e99b1 Binary files /dev/null and b/data/images/engine/fonts/console2.png differ diff --git a/src/console.cpp b/src/console.cpp index a605702d3..6d60bd6b1 100644 --- a/src/console.cpp +++ b/src/console.cpp @@ -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::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(); diff --git a/src/video/font.cpp b/src/video/font.cpp index 92eb42a23..db0633eed 100644 --- a/src/video/font.cpp +++ b/src/video/font.cpp @@ -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);