[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r2944 - in branches/pingus_sdl: data/images/fonts src
From: |
grumbel at BerliOS |
Subject: |
[Pingus-CVS] r2944 - in branches/pingus_sdl: data/images/fonts src |
Date: |
Thu, 16 Aug 2007 00:44:35 +0200 |
Author: grumbel
Date: 2007-08-16 00:44:23 +0200 (Thu, 16 Aug 2007)
New Revision: 2944
Modified:
branches/pingus_sdl/data/images/fonts/pingus_small-iso-8859-1.font
branches/pingus_sdl/src/font.cpp
branches/pingus_sdl/src/font_description.cpp
branches/pingus_sdl/src/font_description.hpp
branches/pingus_sdl/src/pingus_menu.cpp
Log:
- some fine tuning of the start screen
Modified: branches/pingus_sdl/data/images/fonts/pingus_small-iso-8859-1.font
===================================================================
--- branches/pingus_sdl/data/images/fonts/pingus_small-iso-8859-1.font
2007-08-15 22:25:20 UTC (rev 2943)
+++ branches/pingus_sdl/data/images/fonts/pingus_small-iso-8859-1.font
2007-08-15 22:44:23 UTC (rev 2944)
@@ -2,6 +2,8 @@
(pingus-font
(name "Pingus Small")
(space-length 8)
+ (char-spacing 0)
+ (vertical-spacing 23)
(alpha-threshold 0)
(characters "!\"#$%&'()*+,-./0123456789:;<=>?@"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
Modified: branches/pingus_sdl/src/font.cpp
===================================================================
--- branches/pingus_sdl/src/font.cpp 2007-08-15 22:25:20 UTC (rev 2943)
+++ branches/pingus_sdl/src/font.cpp 2007-08-15 22:44:23 UTC (rev 2944)
@@ -57,6 +57,7 @@
SDL_Rect chrs[256];
int space_length;
int char_spacing;
+ int vertical_spacing;
FontImpl(const FontDescription& desc)
: surface(0),
@@ -74,6 +75,8 @@
//std::cout << "IMG: " << desc.image << std::endl;
assert(surface);
+ vertical_spacing = (desc.vertical_spacing == -1) ? surface->h :
desc.vertical_spacing;
+
if (surface->format->BitsPerPixel != 32)
{
std::cout << "Error: '" << desc.filename << "' invalid, fonts need to
be RGBA, but is "
@@ -173,7 +176,7 @@
LineIterator it(text);
while(it.next()) {
draw_line(origin, x, y, it.get(), target);
- y += surface->h;
+ y += vertical_spacing;
}
}
Modified: branches/pingus_sdl/src/font_description.cpp
===================================================================
--- branches/pingus_sdl/src/font_description.cpp 2007-08-15 22:25:20 UTC
(rev 2943)
+++ branches/pingus_sdl/src/font_description.cpp 2007-08-15 22:44:23 UTC
(rev 2944)
@@ -35,6 +35,7 @@
space_length = 20;
alpha_threshold = 0;
char_spacing = 1;
+ vertical_spacing = -1;
FileReader reader = FileReader::parse(filename);
@@ -44,13 +45,14 @@
}
else
{
- reader.read_string("name", name);
- reader.read_string("image", image);
- reader.read_string("characters", characters);
- reader.read_bool("monospace", monospace);
- reader.read_int("char-spacing", char_spacing);
- reader.read_int("space-length", space_length);
- reader.read_int("alpha-threshold", alpha_threshold);
+ reader.read_string("name", name);
+ reader.read_string("image", image);
+ reader.read_string("characters", characters);
+ reader.read_bool("monospace", monospace);
+ reader.read_int("char-spacing", char_spacing);
+ reader.read_int("vertical-spacing", vertical_spacing);
+ reader.read_int("space-length", space_length);
+ reader.read_int("alpha-threshold", alpha_threshold);
}
}
Modified: branches/pingus_sdl/src/font_description.hpp
===================================================================
--- branches/pingus_sdl/src/font_description.hpp 2007-08-15 22:25:20 UTC
(rev 2943)
+++ branches/pingus_sdl/src/font_description.hpp 2007-08-15 22:44:23 UTC
(rev 2944)
@@ -46,6 +46,8 @@
/** Space between two characters */
int char_spacing;
+ int vertical_spacing;
+
/** Minimum amount of alpha that is handled as character seperator */
int alpha_threshold;
Modified: branches/pingus_sdl/src/pingus_menu.cpp
===================================================================
--- branches/pingus_sdl/src/pingus_menu.cpp 2007-08-15 22:25:20 UTC (rev
2943)
+++ branches/pingus_sdl/src/pingus_menu.cpp 2007-08-15 22:44:23 UTC (rev
2944)
@@ -237,18 +237,18 @@
static_cast<float>(Display::get_height()/10)));
}
#ifdef OFFICIAL_PINGUS_BUILD
- gc.print_left(Fonts::courier_small, 20.0f,
- static_cast<float>(Display::get_height()-80),
+ gc.print_left(Fonts::pingus_small, 25.0f,
+ static_cast<float>(Display::get_height()-114),
"Pingus version "VERSION", Copyright (C) 2003 Ingo Ruhnke
<address@hidden>\n");
#else
- gc.print_left(Fonts::courier_small, 20.0f,
- static_cast<float>(Display::get_height()-80),
+ gc.print_left(Fonts::pingus_small, 25.0f,
+ static_cast<float>(Display::get_height()-114),
"Pingus version "VERSION" (unofficial build), Copyright (C)
2003 Ingo Ruhnke <address@hidden>\n");
#endif
- gc.print_left(Fonts::courier_small, 20.0f,
- static_cast<float>(Display::get_height()-60),
- "Pingus comes with ABSOLUTELY NO WARRANTY. This is free
software, and you are welcome\n"
- "to redistribute it under certain conditions; see the file
COPYING for details.\n");
+ gc.print_left(Fonts::pingus_small, 25.0f,
+ static_cast<float>(Display::get_height()-80),
+ "Pingus comes with ABSOLUTELY NO WARRANTY. This is free
software, and you are\n"
+ "welcome to redistribute it under certain conditions; see the
file COPYING for details.\n");
}
void
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r2944 - in branches/pingus_sdl: data/images/fonts src,
grumbel at BerliOS <=