wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src actions.cpp font.hpp game_events.cp...


From: Yann Dirson
Subject: [Wesnoth-cvs-commits] wesnoth/src actions.cpp font.hpp game_events.cp...
Date: Sun, 26 Sep 2004 20:31:13 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Yann Dirson <address@hidden>    04/09/27 00:24:42

Modified files:
        src            : actions.cpp font.hpp game_events.cpp help.cpp 
                         map_label.cpp multiplayer_client.cpp 
                         multiplayer_connect.cpp playturn.cpp 
                         preferences.cpp show_dialog.cpp theme.cpp 
                         tooltips.cpp 
        src/widgets    : combo.cpp file_chooser.cpp textbox.cpp 

Log message:
        more source files converted to use font::SIZE_* - hopefully all 
hardcoded text heights are done now

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/actions.cpp.diff?tr1=1.156&tr2=1.157&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/font.hpp.diff?tr1=1.42&tr2=1.43&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/game_events.cpp.diff?tr1=1.106&tr2=1.107&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/help.cpp.diff?tr1=1.32&tr2=1.33&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/map_label.cpp.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_client.cpp.diff?tr1=1.67&tr2=1.68&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_connect.cpp.diff?tr1=1.73&tr2=1.74&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/playturn.cpp.diff?tr1=1.272&tr2=1.273&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/preferences.cpp.diff?tr1=1.112&tr2=1.113&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/show_dialog.cpp.diff?tr1=1.94&tr2=1.95&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/theme.cpp.diff?tr1=1.16&tr2=1.17&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/tooltips.cpp.diff?tr1=1.16&tr2=1.17&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/combo.cpp.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/file_chooser.cpp.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/textbox.cpp.diff?tr1=1.55&tr2=1.56&r1=text&r2=text

Patches:
Index: wesnoth/src/actions.cpp
diff -u wesnoth/src/actions.cpp:1.156 wesnoth/src/actions.cpp:1.157
--- wesnoth/src/actions.cpp:1.156       Tue Sep 21 01:28:17 2004
+++ wesnoth/src/actions.cpp     Mon Sep 27 00:24:41 2004
@@ -1,4 +1,4 @@
-/* $Id: actions.cpp,v 1.156 2004/09/21 01:28:17 Sirp Exp $ */
+/* $Id: actions.cpp,v 1.157 2004/09/27 00:24:41 ydirson Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -1735,7 +1735,7 @@
                //show messages on the screen here
                if(discovered_unit) {
                        //we've been ambushed, so display an appropriate message
-                       
font::add_floating_label(_("Ambushed!"),24,font::BAD_COLOUR,
+                       
font::add_floating_label(_("Ambushed!"),font::SIZE_XLARGE,font::BAD_COLOUR,
                                                 
disp->map_area().w/2,disp->map_area().h/3,
                                                                         
0.0,0.0,100,disp->map_area(),font::CENTER_ALIGN);
                }
@@ -1802,7 +1802,7 @@
                        }
                        const std::string message = 
config::interpolate_variables_into_string(msg.str(),&symbols);
 
-                       font::add_floating_label(message,24,font::BAD_COLOUR,
+                       
font::add_floating_label(message,font::SIZE_XLARGE,font::BAD_COLOUR,
                                                 
disp->map_area().w/2,disp->map_area().h/3,
                                                                         
0.0,0.0,100,disp->map_area(),font::CENTER_ALIGN);
                }
Index: wesnoth/src/font.hpp
diff -u wesnoth/src/font.hpp:1.42 wesnoth/src/font.hpp:1.43
--- wesnoth/src/font.hpp:1.42   Sat Sep 25 19:46:33 2004
+++ wesnoth/src/font.hpp        Mon Sep 27 00:24:41 2004
@@ -1,4 +1,4 @@
-/* $Id: font.hpp,v 1.42 2004/09/25 19:46:33 ydirson Exp $ */
+/* $Id: font.hpp,v 1.43 2004/09/27 00:24:41 ydirson Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -48,6 +48,7 @@
   SIZE_TINY = 10,
   SIZE_SMALL = 12,
 
+  SIZE_15 = 15,
   SIZE_PLUS = 16,
   SIZE_LARGE = 18,
   SIZE_XLARGE = 24
@@ -57,6 +58,7 @@
   SIZE_TINY = 6,
   SIZE_SMALL = 8,
 
+  SIZE_15 = 11,
   SIZE_PLUS = 12,
   SIZE_LARGE = 14,
   SIZE_XLARGE = 20
Index: wesnoth/src/game_events.cpp
diff -u wesnoth/src/game_events.cpp:1.106 wesnoth/src/game_events.cpp:1.107
--- wesnoth/src/game_events.cpp:1.106   Sun Sep 19 15:41:22 2004
+++ wesnoth/src/game_events.cpp Mon Sep 27 00:24:41 2004
@@ -1,4 +1,4 @@
-/* $Id: game_events.cpp,v 1.106 2004/09/19 15:41:22 silene Exp $ */
+/* $Id: game_events.cpp,v 1.107 2004/09/27 00:24:41 ydirson Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -887,7 +887,7 @@
        //displaying a message on-screen
        else if(cmd == "print") {
                const std::string& text = cfg["text"];
-               const int size = lexical_cast_default<int>(cfg["size"],12);
+               const int size = 
lexical_cast_default<int>(cfg["size"],font::SIZE_SMALL);
                const int lifetime = 
lexical_cast_default<int>(cfg["duration"],20);
                const int red = lexical_cast_default<int>(cfg["red"],0);
                const int green = lexical_cast_default<int>(cfg["green"],0);
Index: wesnoth/src/help.cpp
diff -u wesnoth/src/help.cpp:1.32 wesnoth/src/help.cpp:1.33
--- wesnoth/src/help.cpp:1.32   Fri Sep  3 19:34:05 2004
+++ wesnoth/src/help.cpp        Mon Sep 27 00:24:41 2004
@@ -50,11 +50,11 @@
        config dummy_cfg;
        std::vector<std::string> empty_string_vector;
        const int max_section_level = 15;
-       const int menu_font_size = 14;
-       const int title_size = 18;
-       const int title2_size = 15;
+  const int menu_font_size = font::SIZE_NORMAL;
+       const int title_size = font::SIZE_LARGE;
+       const int title2_size = font::SIZE_15;
        const int box_width = 2;
-       const int normal_font_size = 12;
+       const int normal_font_size = font::SIZE_SMALL;
        const unsigned max_history = 100;
        const std::string topic_img = "help/topic.png";
        const std::string closed_section_img = "help/closed_section.png";
@@ -644,29 +644,29 @@
                                // Dummy element, icons are below.
                                first_row.push_back(item("", 0));
                                first_row.push_back(item(bold(_("Name")),
-                                                                               
                   font::line_width(cap(_("Name")),
-                                                                               
                                                        normal_font_size,
-                                                                               
                                                        TTF_STYLE_BOLD)));
+                                                        
font::line_width(cap(_("Name")),
+                                                                         
normal_font_size,
+                                                                         
TTF_STYLE_BOLD)));
                                first_row.push_back(item(bold(_("Type")),
-                                                                               
                   font::line_width(_("Type"),
-                                                                               
                                                        normal_font_size,
-                                                                               
                                                        TTF_STYLE_BOLD)));
+                                                        
font::line_width(_("Type"),
+                                                                         
normal_font_size,
+                                                                         
TTF_STYLE_BOLD)));
                                first_row.push_back(item(bold(_("Dmg")),
-                                                                               
                   font::line_width(_("Dmg"),
-                                                                               
                                                        normal_font_size,
-                                                                               
                                                        TTF_STYLE_BOLD)));
+                                                        
font::line_width(_("Dmg"),
+                                                                         
normal_font_size,
+                                                                         
TTF_STYLE_BOLD)));
                                first_row.push_back(item(bold(_("Strikes")),
-                                                                               
                   font::line_width(_("Strikes"),
-                                                                               
                                                        normal_font_size,
-                                                                               
                                                        TTF_STYLE_BOLD)));
+                                                        
font::line_width(_("Strikes"),
+                                                                         
normal_font_size,
+                                                                         
TTF_STYLE_BOLD)));
                                first_row.push_back(item(bold(_("Range")),
-                                                                               
                   font::line_width(_("Range"),
-                                                                               
                                                        normal_font_size,
-                                                                               
                                                        TTF_STYLE_BOLD)));
+                                                        
font::line_width(_("Range"),
+                                                                         
normal_font_size,
+                                                                         
TTF_STYLE_BOLD)));
                                first_row.push_back(item(bold(_("Special")),
-                                                                               
                   font::line_width(_("Special"),
-                                                                               
                                                        normal_font_size,
-                                                                               
                                                        TTF_STYLE_BOLD)));
+                                                        
font::line_width(_("Special"),
+                                                                         
normal_font_size,
+                                                                         
TTF_STYLE_BOLD)));
                                table.push_back(first_row);
                                // Print information about every attack.
                                for (std::vector<attack_type>::const_iterator 
attack_it =attacks.begin();
@@ -685,7 +685,7 @@
                                        std::stringstream attack_ss;
                                        attack_ss << "<img>src='" << 
(*attack_it).icon() << "'</img>";
                                        
row.push_back(std::make_pair(attack_ss.str(),
-                                                                               
                 image_width(attack_it->icon())));
+                                                                    
image_width(attack_it->icon())));
                                        attack_ss.str("");
                                        push_tab_pair(row, lang_weapon);
                                        push_tab_pair(row, lang_type);
@@ -711,8 +711,9 @@
                                                attack_ss << "<ref>dst='" << 
escape(ref_id) << "' text='"
                                                                  << 
escape(lang_special) << "'</ref>";
                                                
row.push_back(std::make_pair(attack_ss.str(),
-                                                                               
                         font::line_width(lang_special, normal_font_size)));
-                                                                               
                                                          
+                                                                            
font::line_width(lang_special,
+                                                                               
              normal_font_size)));
+                                               
                                        }
                                        table.push_back(row);
                                }
@@ -725,13 +726,13 @@
                        table_spec resistance_table;
                        std::vector<std::pair<std::string, unsigned> > 
first_res_row;
                        first_res_row.push_back(std::make_pair(bold(_("Attack 
Type")),
-                                                                               
                   font::line_width(_("Attack Type"),
-                                                                               
                                                        normal_font_size,
-                                                                               
                                                        TTF_STYLE_BOLD)));
+                                                              
font::line_width(_("Attack Type"),
+                                                                               
normal_font_size,
+                                                                               
TTF_STYLE_BOLD)));
                        
first_res_row.push_back(std::make_pair(bold(_("Resistance")),
-                                                                               
                   font::line_width(_("Resistance"),
-                                                                               
                                                        normal_font_size,
-                                                                               
                                                        TTF_STYLE_BOLD)));
+                                                              
font::line_width(_("Resistance"),
+                                                                               
normal_font_size,
+                                                                               
TTF_STYLE_BOLD)));
                        resistance_table.push_back(first_res_row);
                        const unit_movement_type &movement_type = 
type.movement_type();
                        string_map dam_tab = movement_type.damage_table();
@@ -754,7 +755,7 @@
                                str.str("");
                                str << resistance << "%";
                                row.push_back(std::make_pair(markup,
-                                                                               
         font::line_width(str.str(), normal_font_size)));
+                                                            
font::line_width(str.str(), normal_font_size)));
                                resistance_table.push_back(row);
                        }
                        ss << generate_table(resistance_table);
@@ -765,17 +766,17 @@
                                std::vector<std::pair<std::string, unsigned> > 
first_row;
                                table_spec table;
                                
first_row.push_back(std::make_pair(bold(_("Terrain")),
-                                                                               
                   font::line_width(_("Terrain"),
-                                                                               
                                                        normal_font_size,
-                                                                               
                                                        TTF_STYLE_BOLD)));
+                                                                  
font::line_width(_("Terrain"),
+                                                                               
    normal_font_size,
+                                                                               
    TTF_STYLE_BOLD)));
                                
first_row.push_back(std::make_pair(bold(_("Movement")),
-                                                                               
                   font::line_width(_("Movement"),
-                                                                               
                                                        normal_font_size,
-                                                                               
                                                        TTF_STYLE_BOLD)));
+                                                                  
font::line_width(_("Movement"),
+                                                                               
    normal_font_size,
+                                                                               
    TTF_STYLE_BOLD)));
                                
first_row.push_back(std::make_pair(bold(_("Defense")),
-                                                                               
                   font::line_width(_("Defense"),
-                                                                               
                                                        normal_font_size,
-                                                                               
                                                        TTF_STYLE_BOLD)));
+                                                                  
font::line_width(_("Defense"),
+                                                                               
    normal_font_size,
+                                                                               
    TTF_STYLE_BOLD)));
                                table.push_back(first_row);
                                for (std::set<std::string>::const_iterator 
terrain_it =
                                                 
preferences::encountered_terrains().begin();
@@ -795,8 +796,8 @@
                                                str << "<ref>text='" << 
escape(name) << "' dst='"
                                                        << 
escape(std::string("terrain_") + terrain) << "'</ref>";
                                                
row.push_back(std::make_pair(str.str(), 
-                                                                               
                         font::line_width(name,
-                                                                               
                                                          normal_font_size)));
+                                                                            
font::line_width(name,
+                                                                               
              normal_font_size)));
                                                str.str("");
                                                if(moves < 100)
                                                        str << moves;
@@ -1279,7 +1280,7 @@
        const std::string show_title =
                font::make_text_ellipsis(shown_topic_->title, title_size, 
text_width());
        surface surf(font::get_rendered_text(show_title, title_size,
-                                                                               
                        font::NORMAL_COLOUR, TTF_STYLE_BOLD));
+                                            font::NORMAL_COLOUR, 
TTF_STYLE_BOLD));
        if (surf != NULL) {
                add_item(item(surf, 0, 0, show_title));
                curr_loc_.second = title_spacing_;
Index: wesnoth/src/map_label.cpp
diff -u wesnoth/src/map_label.cpp:1.11 wesnoth/src/map_label.cpp:1.12
--- wesnoth/src/map_label.cpp:1.11      Sun Aug 29 11:12:20 2004
+++ wesnoth/src/map_label.cpp   Mon Sep 27 00:24:41 2004
@@ -82,8 +82,8 @@
        const gamemap::location loc_nextx(loc.x+1,loc.y);
        const gamemap::location loc_nexty(loc.x,loc.y+1);
        const int xloc = (disp_.get_location_x(loc) + 
disp_.get_location_x(loc_nextx)*2)/3;
-       const int yloc = disp_.get_location_y(loc_nexty) - 14;
-       const int handle = 
font::add_floating_label(text,14,colour,xloc,yloc,0,0,-1,disp_.map_area());
+       const int yloc = disp_.get_location_y(loc_nexty) - font::SIZE_NORMAL;
+       const int handle = 
font::add_floating_label(text,font::SIZE_NORMAL,colour,xloc,yloc,0,0,-1,disp_.map_area());
 
        labels_.insert(std::pair<gamemap::location,int>(loc,handle));
 
Index: wesnoth/src/multiplayer_client.cpp
diff -u wesnoth/src/multiplayer_client.cpp:1.67 
wesnoth/src/multiplayer_client.cpp:1.68
--- wesnoth/src/multiplayer_client.cpp:1.67     Tue Sep 21 20:35:48 2004
+++ wesnoth/src/multiplayer_client.cpp  Mon Sep 27 00:24:41 2004
@@ -137,10 +137,10 @@
                generate_menu(true);
 
                const std::string text = _("Waiting for game to start...");
-               SDL_Rect rect = 
font::draw_text(NULL,disp_.screen_area(),14,font::NORMAL_COLOUR,text,0,0);
+               SDL_Rect rect = 
font::draw_text(NULL,disp_.screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOUR,text,0,0);
                rect.x = area.x + area.w/2 - rect.w/2;
                rect.y = area.y + (area.h*3)/4 - rect.h/2;
-               
font::draw_text(&disp_,rect,14,font::NORMAL_COLOUR,text,rect.x,rect.y);
+               
font::draw_text(&disp_,rect,font::SIZE_NORMAL,font::NORMAL_COLOUR,text,rect.x,rect.y);
 
                cancel_button_.assign(new gui::button(disp_,_("Cancel")));
                cancel_button_->set_location(area.x+area.w - 
cancel_button_->width() - gui::ButtonHPadding,
@@ -775,10 +775,10 @@
                        SDL_BlitSurface(unit_image,NULL,screen,&image_rect);
                }
 
-               
font::draw_text(&disp(),area,16,font::NORMAL_COLOUR,faction,area.x + 80, area.y 
+ 30);
-               const SDL_Rect leader_rect = 
font::draw_text(&disp(),area,12,font::NORMAL_COLOUR,
+               
font::draw_text(&disp(),area,font::SIZE_PLUS,font::NORMAL_COLOUR,faction,area.x 
+ 80, area.y + 30);
+               const SDL_Rect leader_rect = 
font::draw_text(&disp(),area,font::SIZE_SMALL,font::NORMAL_COLOUR,
                                _("Leader: "),area.x, area.y + 80);
-               font::draw_wrapped_text(&disp(),area,12,font::NORMAL_COLOUR,
+               
font::draw_wrapped_text(&disp(),area,font::SIZE_SMALL,font::NORMAL_COLOUR,
                                _("Recruits: ") + recruit_string.str(),area.x, 
area.y + 102,
                                area.w);
 
Index: wesnoth/src/multiplayer_connect.cpp
diff -u wesnoth/src/multiplayer_connect.cpp:1.73 
wesnoth/src/multiplayer_connect.cpp:1.74
--- wesnoth/src/multiplayer_connect.cpp:1.73    Thu Sep 23 18:26:49 2004
+++ wesnoth/src/multiplayer_connect.cpp Mon Sep 27 00:24:41 2004
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_connect.cpp,v 1.73 2004/09/23 18:26:49 gruikya Exp $ */
+/* $Id: multiplayer_connect.cpp,v 1.74 2004/09/27 00:24:41 ydirson Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -367,27 +367,27 @@
        //Title and labels
        gui::draw_dialog_title(left,top,disp_,_("Game Lobby"));
 
-       SDL_Rect labelr = font::draw_text(NULL,rect,14,font::GOOD_COLOUR,
+       SDL_Rect labelr = 
font::draw_text(NULL,rect,font::SIZE_NORMAL,font::GOOD_COLOUR,
                                                  _("Player/Type"),0,0);
-       font::draw_text(disp_,rect,14,font::GOOD_COLOUR,
+       font::draw_text(disp_,rect,font::SIZE_NORMAL,font::GOOD_COLOUR,
                        
_("Player/Type"),(left+30)+(launch_.width()/2)-(labelr.w/2),top+35);
-       labelr = 
font::draw_text(NULL,rect,14,font::GOOD_COLOUR,_("Faction"),0,0);
+       labelr = 
font::draw_text(NULL,rect,font::SIZE_NORMAL,font::GOOD_COLOUR,_("Faction"),0,0);
 
-       font::draw_text(disp_,rect,14,font::GOOD_COLOUR,
+       font::draw_text(disp_,rect,font::SIZE_NORMAL,font::GOOD_COLOUR,
                        
_("Faction"),(left+145)+(launch_.width()/2)-(labelr.w/2),top+35);
        
-       labelr = font::draw_text(NULL,rect,14,font::GOOD_COLOUR,_("Team"),0,0);
+       labelr = 
font::draw_text(NULL,rect,font::SIZE_NORMAL,font::GOOD_COLOUR,_("Team"),0,0);
 
-       font::draw_text(disp_,disp_->screen_area(),14,font::GOOD_COLOUR,
+       
font::draw_text(disp_,disp_->screen_area(),font::SIZE_NORMAL,font::GOOD_COLOUR,
                        
_("Team"),(left+260)+(launch_.width()/2)-(labelr.w/2),top+35);
        
-       labelr = font::draw_text(NULL,rect,14,font::GOOD_COLOUR,_("Color"),0,0);
+       labelr = 
font::draw_text(NULL,rect,font::SIZE_NORMAL,font::GOOD_COLOUR,_("Color"),0,0);
 
-       font::draw_text(disp_,disp_->screen_area(),14,font::GOOD_COLOUR,
+       
font::draw_text(disp_,disp_->screen_area(),font::SIZE_NORMAL,font::GOOD_COLOUR,
                        
_("Color"),(left+375)+(launch_.width()/2)-(labelr.w/2),top+35);
        
-       labelr = font::draw_text(NULL,rect,14,font::GOOD_COLOUR,_("Gold"),0,0);
-       font::draw_text(disp_,rect,14,font::GOOD_COLOUR,
+       labelr = 
font::draw_text(NULL,rect,font::SIZE_NORMAL,font::GOOD_COLOUR,_("Gold"),0,0);
+       font::draw_text(disp_,rect,font::SIZE_NORMAL,font::GOOD_COLOUR,
                        
_("Gold"),(left+480)+(launch_.width()/2)-(labelr.w/2),top+35);
 
        //Per player settings
@@ -411,7 +411,7 @@
                const int side_num = sd - sides.first;
 
                //Player number
-               font::draw_text(disp_,rect, 24, font::GOOD_COLOUR,
+               font::draw_text(disp_,rect, font::SIZE_XLARGE, 
font::GOOD_COLOUR,
                                (*sd)->values["side"], left+10, 
top+53+(60*side_num));
 
                //Player type
@@ -451,7 +451,7 @@
                r.w = 30;
                r.x = left+603;
                gold_bg_.push_back(surface_restorer(&disp_->video(),r));
-               font::draw_text(disp_, disp_->screen_area(), 12, 
font::GOOD_COLOUR,
+               font::draw_text(disp_, disp_->screen_area(), font::SIZE_SMALL, 
font::GOOD_COLOUR,
                                "100", r.x, r.y);
        }
 
@@ -543,7 +543,7 @@
                rect.w = 30;
                rect.h = launch_.height();
                gold_bg_[n].restore();
-               font::draw_text(disp_, disp_->screen_area(), 12,
+               font::draw_text(disp_, disp_->screen_area(), font::SIZE_SMALL,
                                font::GOOD_COLOUR,
                                side["gold"],
                                rect.x, rect.y);
@@ -557,11 +557,11 @@
                        message_bg_.restore();
                        message_bg_ = surface_restorer();
                } else {
-                       SDL_Rect rect = 
font::draw_text(NULL,rect_,12,font::NORMAL_COLOUR,_("Waiting for network 
players to join"),0,0);
+                       SDL_Rect rect = 
font::draw_text(NULL,rect_,font::SIZE_SMALL,font::NORMAL_COLOUR,_("Waiting for 
network players to join"),0,0);
                        rect.x = ai_.location().x + ai_.location().w + 10;
                        rect.y = ai_.location().y;
                        message_bg_ = surface_restorer(&disp_->video(),rect);
-                       
font::draw_text(disp_,rect,12,font::NORMAL_COLOUR,_("Waiting for network 
players to join"),rect.x,rect.y);
+                       
font::draw_text(disp_,rect,font::SIZE_SMALL,font::NORMAL_COLOUR,_("Waiting for 
network players to join"),rect.x,rect.y);
                }
        }
 }
@@ -695,7 +695,7 @@
                                rect.w = 30;
                                rect.h = launch_.height();
                                gold_bg_[n].restore();
-                               font::draw_text(disp_, rect_, 
12,font::GOOD_COLOUR,(*sides.first[n])["gold"],
+                               font::draw_text(disp_, rect_, 
font::SIZE_SMALL,font::GOOD_COLOUR,(*sides.first[n])["gold"],
                                                        rect.x, rect.y);
                                update_rect(rect);
                                level_changed = true;
Index: wesnoth/src/playturn.cpp
diff -u wesnoth/src/playturn.cpp:1.272 wesnoth/src/playturn.cpp:1.273
--- wesnoth/src/playturn.cpp:1.272      Sun Sep 26 22:14:52 2004
+++ wesnoth/src/playturn.cpp    Mon Sep 27 00:24:41 2004
@@ -1,4 +1,4 @@
-/* $Id: playturn.cpp,v 1.272 2004/09/26 22:14:52 silene Exp $ */
+/* $Id: playturn.cpp,v 1.273 2004/09/27 00:24:41 ydirson Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -2520,7 +2520,7 @@
        const int border_size = 10;
 
        const int ypos = area.y+area.h-30 - (textbox_.check != NULL ? 
textbox_.check->height() + border_size : 0);
-       textbox_.label = 
font::add_floating_label(label,14,font::YELLOW_COLOUR,area.x+border_size,ypos,0,0,-1,
+       textbox_.label = 
font::add_floating_label(label,font::SIZE_NORMAL,font::YELLOW_COLOUR,area.x+border_size,ypos,0,0,-1,
                                                  area,font::LEFT_ALIGN);
        if(textbox_.label == 0) {
                return;
Index: wesnoth/src/preferences.cpp
diff -u wesnoth/src/preferences.cpp:1.112 wesnoth/src/preferences.cpp:1.113
--- wesnoth/src/preferences.cpp:1.112   Fri Sep  3 09:57:08 2004
+++ wesnoth/src/preferences.cpp Mon Sep 27 00:24:41 2004
@@ -1,4 +1,4 @@
-/* $Id: preferences.cpp,v 1.112 2004/09/03 09:57:08 ydirson Exp $ */
+/* $Id: preferences.cpp,v 1.113 2004/09/27 00:24:41 ydirson Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -655,9 +655,9 @@
 {
        set_location(preferences_dialog_area);
 
-       slider_label_width_ = 
maximum<size_t>(font::text_area(music_label_,14).w,
-                             
maximum<size_t>(font::text_area(sound_label_,14).w,
-                                                 
maximum<size_t>(font::text_area(scroll_label_,14).w,font::text_area(gamma_label_,14).w)));
+       slider_label_width_ = 
maximum<size_t>(font::text_area(music_label_,font::SIZE_NORMAL).w,
+                             
maximum<size_t>(font::text_area(sound_label_,font::SIZE_NORMAL).w,
+                                                 
maximum<size_t>(font::text_area(scroll_label_,font::SIZE_NORMAL).w,font::text_area(gamma_label_,font::SIZE_NORMAL).w)));
 
        sound_slider_.set_min(1);
        sound_slider_.set_max(100);
@@ -809,7 +809,7 @@
 
        int ypos = location().y;
        if(tab_ == GENERAL_TAB) {
-               
font::draw_text(&disp(),location(),14,font::NORMAL_COLOUR,scroll_label_,location().x,ypos);
+               
font::draw_text(&disp(),location(),font::SIZE_NORMAL,font::NORMAL_COLOUR,scroll_label_,location().x,ypos);
                const SDL_Rect scroll_rect = {location().x + 
slider_label_width_,ypos,location().w - slider_label_width_ - 
border,scroll_slider_.location().h};
                scroll_slider_.set_location(scroll_rect);
 
@@ -840,7 +840,7 @@
                ypos += 50;
 
                if(adjust_gamma()) {
-                       
font::draw_text(&disp(),location(),14,font::NORMAL_COLOUR,gamma_label_,location().x,ypos);
+                       
font::draw_text(&disp(),location(),font::SIZE_NORMAL,font::NORMAL_COLOUR,gamma_label_,location().x,ypos);
                }
 
                const SDL_Rect gamma_rect = {location().x + 
slider_label_width_,ypos,location().w - slider_label_width_ - 
border,gamma_slider_.location().h};
@@ -862,13 +862,13 @@
                video_mode_button_.set_location(location().x,ypos);
 
        } else if(tab_ == SOUND_TAB) {
-               
font::draw_text(&disp(),location(),14,font::NORMAL_COLOUR,music_label_,location().x,ypos);
+               
font::draw_text(&disp(),location(),font::SIZE_NORMAL,font::NORMAL_COLOUR,music_label_,location().x,ypos);
                const SDL_Rect music_rect = {location().x + 
slider_label_width_,ypos,location().w - slider_label_width_ - 
border,music_slider_.location().h};
                music_slider_.set_location(music_rect);
 
                ypos += 50;
 
-               
font::draw_text(&disp(),location(),14,font::NORMAL_COLOUR,sound_label_,location().x,ypos);
+               
font::draw_text(&disp(),location(),font::SIZE_NORMAL,font::NORMAL_COLOUR,sound_label_,location().x,ypos);
                const SDL_Rect sound_rect = {location().x + 
slider_label_width_,ypos,location().w - slider_label_width_ - 
border,sound_slider_.location().h};
                sound_slider_.set_location(sound_rect);
        }
@@ -1026,7 +1026,7 @@
        gui::draw_dialog(xpos,ypos,width,height,disp,_("Hotkey 
Settings"),NULL,&buttons,&restorer);
        
        SDL_Rect clip_rect = { 0, 0, disp.x (), disp.y () };
-       SDL_Rect text_size = font::draw_text(NULL, clip_rect, 16,
+       SDL_Rect text_size = font::draw_text(NULL, clip_rect, font::SIZE_PLUS,
                                   font::NORMAL_COLOUR,_("Press desired 
HotKey"),
                                                0, 0);
 
@@ -1084,7 +1084,7 @@
                                                                        
centery-text_size.h/2 - 6,
                                                                        
text_size.w+40,
                                                                        
text_size.h+12,disp);
-                       font::draw_text (&disp, clip_rect, 
18,font::NORMAL_COLOUR,
+                       font::draw_text (&disp, clip_rect, 
font::SIZE_LARGE,font::NORMAL_COLOUR,
                                 _("Press desired 
HotKey"),centerx-text_size.w/2-10,
                                 centery-text_size.h/2-3);
                        disp.update_display();
Index: wesnoth/src/show_dialog.cpp
diff -u wesnoth/src/show_dialog.cpp:1.94 wesnoth/src/show_dialog.cpp:1.95
--- wesnoth/src/show_dialog.cpp:1.94    Sun Sep 19 12:17:48 2004
+++ wesnoth/src/show_dialog.cpp Mon Sep 27 00:24:41 2004
@@ -1,4 +1,4 @@
-/* $Id: show_dialog.cpp,v 1.94 2004/09/19 12:17:48 ettin Exp $ */
+/* $Id: show_dialog.cpp,v 1.95 2004/09/27 00:24:41 ydirson Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -180,7 +180,7 @@
                rect = disp->screen_area();
        }
 
-       return 
font::draw_text(disp,rect,18,font::TITLE_COLOUR,text,x,y+5,NULL,false,font::USE_MARKUP,TTF_STYLE_BOLD);
+       return 
font::draw_text(disp,rect,font::SIZE_LARGE,font::TITLE_COLOUR,text,x,y+5,NULL,false,font::USE_MARKUP,TTF_STYLE_BOLD);
 }
 
 void draw_dialog(int x, int y, int w, int h, display& disp, const std::string& 
title,
@@ -384,8 +384,8 @@
        const std::vector<std::string>& menu_items =
                (menu_items_ptr == NULL) ? std::vector<std::string>() : 
*menu_items_ptr;
 
-       static const int message_font_size = 16;
-       static const int caption_font_size = 18;
+       static const int message_font_size = font::SIZE_PLUS;
+       static const int caption_font_size = font::SIZE_LARGE;
 
        CVideo& screen = disp.video();
        surface const scr = screen.getSurface();
@@ -410,7 +410,7 @@
                
text_widget.set_width(minimum<size_t>(disp.x()/2,maximum<size_t>(area.w,text_widget.location().w)));
                
text_widget.set_height(minimum<size_t>(disp.y()/2,maximum<size_t>(area.h,text_widget.location().h)));
                text_widget_width = 
font::text_area(text_widget_label,message_font_size).w + 
text_widget.location().w;;
-               text_widget_height = text_widget.location().h + 16;
+               text_widget_height = text_widget.location().h + 
message_font_size;
        }
 
        menu menu_(disp,menu_items,type == MESSAGE);
Index: wesnoth/src/theme.cpp
diff -u wesnoth/src/theme.cpp:1.16 wesnoth/src/theme.cpp:1.17
--- wesnoth/src/theme.cpp:1.16  Sat Sep 11 08:55:13 2004
+++ wesnoth/src/theme.cpp       Mon Sep 27 00:24:41 2004
@@ -1,3 +1,4 @@
+#include "font.hpp"
 #include "language.hpp"
 #include "sdl_utils.hpp"
 #include "theme.hpp"
@@ -10,7 +11,7 @@
        const int XDim = 1024;
        const int YDim = 768;
 
-       const size_t DefaultFontSize = 14;
+       const size_t DefaultFontSize = font::SIZE_NORMAL;
 
        SDL_Rect read_rect(const config& cfg) {
                SDL_Rect rect;
Index: wesnoth/src/tooltips.cpp
diff -u wesnoth/src/tooltips.cpp:1.16 wesnoth/src/tooltips.cpp:1.17
--- wesnoth/src/tooltips.cpp:1.16       Tue Jul 20 11:56:58 2004
+++ wesnoth/src/tooltips.cpp    Mon Sep 27 00:24:41 2004
@@ -30,7 +30,7 @@
        std::string message;
 };
 
-static const int font_size = 12;
+static const int font_size = font::SIZE_SMALL;
 
 std::vector<tooltip> tips;
 std::vector<tooltip>::const_iterator current_tooltip = tips.end();
Index: wesnoth/src/widgets/combo.cpp
diff -u wesnoth/src/widgets/combo.cpp:1.19 wesnoth/src/widgets/combo.cpp:1.20
--- wesnoth/src/widgets/combo.cpp:1.19  Sat Sep 18 18:52:20 2004
+++ wesnoth/src/widgets/combo.cpp       Mon Sep 27 00:24:41 2004
@@ -1,4 +1,4 @@
-/* $Id: combo.cpp,v 1.19 2004/09/18 18:52:20 gruikya Exp $ */
+/* $Id: combo.cpp,v 1.20 2004/09/27 00:24:41 ydirson Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -18,7 +18,7 @@
 
 namespace gui {
 
-const int font_size = 12;
+const int font_size = font::SIZE_SMALL;
 const int horizontal_padding = 10;
 const int vertical_padding = 10;
 
Index: wesnoth/src/widgets/file_chooser.cpp
diff -u wesnoth/src/widgets/file_chooser.cpp:1.6 
wesnoth/src/widgets/file_chooser.cpp:1.7
--- wesnoth/src/widgets/file_chooser.cpp:1.6    Fri Sep 24 23:25:09 2004
+++ wesnoth/src/widgets/file_chooser.cpp        Mon Sep 27 00:24:42 2004
@@ -90,7 +90,7 @@
                const std::string display_string = std::string(" ,") + *it;
                to_show.push_back(display_string);
        }
-       const int menu_font_size = 14; // Known from menu.cpp.
+       const int menu_font_size = font::SIZE_NORMAL; // Known from menu.cpp.
        for (it = to_show.begin(); it != to_show.end(); it++) {
                // Make sure that all lines fit.
                // Guess the width of the scrollbar to be 30 since it is not 
accessible from here.
Index: wesnoth/src/widgets/textbox.cpp
diff -u wesnoth/src/widgets/textbox.cpp:1.55 
wesnoth/src/widgets/textbox.cpp:1.56
--- wesnoth/src/widgets/textbox.cpp:1.55        Sun Sep 19 11:14:19 2004
+++ wesnoth/src/widgets/textbox.cpp     Mon Sep 27 00:24:42 2004
@@ -1,4 +1,4 @@
-/* $Id: textbox.cpp,v 1.55 2004/09/19 11:14:19 silene Exp $ */
+/* $Id: textbox.cpp,v 1.56 2004/09/27 00:24:42 ydirson Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -26,7 +26,7 @@
 
 namespace gui {
 
-const int font_size = 16;
+const int font_size = font::SIZE_PLUS;
 
 textbox::textbox(display& d, int width, const std::string& text, bool 
editable, size_t max_size)
           : widget(d), max_size_(max_size), text_(string_to_wstring(text)),




reply via email to

[Prev in Thread] Current Thread [Next in Thread]