From: Ricardo Cruz Date: Fri, 7 May 2004 00:20:29 +0000 (+0000) Subject: Support for Benjamin's fonts. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=ad087715415c44dae336bfc753dccbb218b8a467;p=supertux.git Support for Benjamin's fonts. SVN-Revision: 1016 --- diff --git a/src/text.cpp b/src/text.cpp index 052608be3..6e66f3dc5 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -101,14 +101,18 @@ Text::draw_chars(Surface* pchars,const char* text, int x, int y, int update) { for( i = 0, j = 0; i < len; ++i,++j) { - if( text[i] >= 'A' && text[i] <= 'Z') - pchars->draw_part((int)(text[i] - 'A')*w, 0, x+(j*w), y, w, h, 255, update); - else if( text[i] >= 'a' && text[i] <= 'z') - pchars->draw_part((int)(text[i] - 'a')*w, h, x+(j*w), y, w, h, 255, update); - else if ( text[i] >= '!' && text[i] <= '9') - pchars->draw_part((int)(text[i] - '!')*w, h*2, x+(j*w), y, w, h, 255, update); - else if ( text[i] == '?') - pchars->draw_part(25*w, h*2, x+(j*w), y, w, h, 255, update); + if( text[i] >= ' ' && text[i] <= '/') + pchars->draw_part((int)(text[i] - ' ')*w, 0 , x+(j*w), y, w, h, 255, update); + else if( text[i] >= '0' && text[i] <= '?') + pchars->draw_part((int)(text[i] - '0')*w, h*1, x+(j*w), y, w, h, 255, update); + else if ( text[i] >= '@' && text[i] <= 'O') + pchars->draw_part((int)(text[i] - '@')*w, h*2, x+(j*w), y, w, h, 255, update); + else if ( text[i] >= 'P' && text[i] <= '_') + pchars->draw_part((int)(text[i] - 'P')*w, h*3, x+(j*w), y, w, h, 255, update); + else if ( text[i] >= '`' && text[i] <= 'o') + pchars->draw_part((int)(text[i] - '`')*w, h*4, x+(j*w), y, w, h, 255, update); + else if ( text[i] >= 'p' && text[i] <= '~') + pchars->draw_part((int)(text[i] - 'p')*w, h*5, x+(j*w), y, w, h, 255, update); else if ( text[i] == '\n') { y += h + 2;