[nexuiz-commits] r7611 - in trunk/data: . qcsrc/client qcsrc/common qcsrc/menu qcsrc/menu/item qcsrc/menu/nexuiz qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Sep 3 12:05:05 EDT 2009


Author: blub0
Date: 2009-09-03 12:05:02 -0400 (Thu, 03 Sep 2009)
New Revision: 7611

Modified:
   trunk/data/defaultNexuiz.cfg
   trunk/data/qcsrc/client/Main.qc
   trunk/data/qcsrc/client/csqc_builtins.qc
   trunk/data/qcsrc/client/mapvoting.qc
   trunk/data/qcsrc/client/miscfunctions.qc
   trunk/data/qcsrc/client/sbar.qc
   trunk/data/qcsrc/common/util.qc
   trunk/data/qcsrc/common/util.qh
   trunk/data/qcsrc/menu/draw.qc
   trunk/data/qcsrc/menu/draw.qh
   trunk/data/qcsrc/menu/item/inputbox.c
   trunk/data/qcsrc/menu/item/label.c
   trunk/data/qcsrc/menu/mbuiltin.qh
   trunk/data/qcsrc/menu/menu.qc
   trunk/data/qcsrc/menu/nexuiz/campaign.c
   trunk/data/qcsrc/menu/nexuiz/cvarlist.c
   trunk/data/qcsrc/menu/nexuiz/demolist.c
   trunk/data/qcsrc/menu/nexuiz/keybinder.c
   trunk/data/qcsrc/menu/nexuiz/maplist.c
   trunk/data/qcsrc/menu/nexuiz/playerlist.c
   trunk/data/qcsrc/menu/nexuiz/serverlist.c
   trunk/data/qcsrc/menu/nexuiz/skinlist.c
   trunk/data/qcsrc/menu/nexuiz/util.qc
   trunk/data/qcsrc/server/cl_player.qc
   trunk/data/qcsrc/server/constants.qh
   trunk/data/weapons.cfg
   trunk/data/weaponsHavoc.cfg
Log:
Okay, this is preparation for the freetype support, this shouldn't cause any obvious changes, if it does, tell me.
Basically, this replaces all stringwidth()*size calls to pass the size parameter to stringwidth() directly.
Also, it adds some default parameters to the loadfont command... not sure why I'm adding this so early though... but it won't error out anyway so it shouldn't be harmful.


Modified: trunk/data/defaultNexuiz.cfg
===================================================================
--- trunk/data/defaultNexuiz.cfg	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/defaultNexuiz.cfg	2009-09-03 16:05:02 UTC (rev 7611)
@@ -26,7 +26,7 @@
 seta g_configversion 0	"Configuration file version (used to upgrade settings) 0: first run, or previous start was <2.4.1  Later, it's overridden by config.cfg, version ranges are defined in config_update.cfg"
 
 // default.cfg versioning (update using update-cvarcount.sh, run that every time after adding a new cvar)
-set cvar_check_default ba4f55ed0f5a00a082bfb12c80dd3f8e
+set cvar_check_default ee37fa837dd0730d3eef10e5a51a4a96
 
 // Nexuiz version (formatted for machines)
 // used to determine if a client version is compatible
@@ -1291,11 +1291,11 @@
 
 // loadfont console     gfx/vera-mono
 // loadfont sbar        gfx/vera-mono
-loadfont notify      gfx/vera-sans
-loadfont chat        gfx/vera-sans
+loadfont notify      gfx/vera-sans 0 10 12 18 24 32
+loadfont chat        gfx/vera-sans 0 10 12 18 24 32
 // loadfont centerprint gfx/vera-mono
 // loadfont infobar     gfx/vera-mono
-loadfont user0       gfx/vera-sans
+loadfont user0       gfx/vera-sans 0 10 12 18 24 32
 r_textbrightness 0.2
 r_textcontrast 0.8
 r_textshadow 1
@@ -1425,7 +1425,7 @@
 seta sbar_width 560
 alias sbar_font "loadfont user1 $*; loadfont user2 ${*}-big; sbar_columns_set"
 seta sbar_columns default
-sbar_font gfx/vera-sans
+sbar_font gfx/vera-sans 0 10 12 18 24 32
 seta sbar_showbinds 1	"display actions / bound keys in the strings shown during the game. 0 displays only actions, 1 displays only bound keys, 2 displays both"
 seta sbar_showbinds_limit 2	"maximum number of bound keys to show for an action. 0 for unlimited"
 

Modified: trunk/data/qcsrc/client/Main.qc
===================================================================
--- trunk/data/qcsrc/client/Main.qc	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/client/Main.qc	2009-09-03 16:05:02 UTC (rev 7611)
@@ -411,7 +411,7 @@
 	coord2d_topleft = project_3d_to_2d(self.origin + view_up * 4 - view_right * 4);
 	coord2d_topright = project_3d_to_2d(self.origin + view_up * 4 + view_right * 4);
 
-	fs = '1 1 0' * ((coord2d_topright_x - coord2d_topleft_x) / stringwidth(s, FALSE));
+	fs = '1 1 0' * ((coord2d_topright_x - coord2d_topleft_x) / stringwidth(s, FALSE, '8 8 0'));
 
 	coord2d = coord2d_topleft;
 	if(fs_x < 8)

Modified: trunk/data/qcsrc/client/csqc_builtins.qc
===================================================================
--- trunk/data/qcsrc/client/csqc_builtins.qc	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/client/csqc_builtins.qc	2009-09-03 16:05:02 UTC (rev 7611)
@@ -98,7 +98,7 @@
 void	drawsetcliparea(float x, float y, float width, float height) = #324;
 void	drawresetcliparea(void) = #325;
 float	drawcolorcodedstring(vector position, string text, vector scale, float alpha, float flag) = #326;
-float	stringwidth(string text, float handleColors) = #327;
+float	stringwidth(string text, float handleColors, vector fontSize) = #327;
 float	drawsubpic(vector position, vector size, string pic, vector srcPosition, vector srcSize, vector rgb, float alpha, float flag) = #328;
 
 

Modified: trunk/data/qcsrc/client/mapvoting.qc
===================================================================
--- trunk/data/qcsrc/client/mapvoting.qc	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/client/mapvoting.qc	2009-09-03 16:05:02 UTC (rev 7611)
@@ -13,7 +13,7 @@
 float mv_timeout;
 float mv_maps_mask;
 
-string MapVote_FormatMapItem(float id, string map, float count, float maxwidth)
+string MapVote_FormatMapItem(float id, string map, float count, float maxwidth, vector fontsize)
 {
 	string pre, post;
 	pre = strcat(ftos(id+1), ". ");
@@ -26,8 +26,8 @@
 	}
 	else
 		post = "";
-	maxwidth -= stringwidth(pre, FALSE) + stringwidth(post, FALSE);
-	map = textShortenToWidth(map, maxwidth, stringwidth_nocolors);
+	maxwidth -= stringwidth(pre, FALSE, fontsize) + stringwidth(post, FALSE, fontsize);
+	map = textShortenToWidth(map, maxwidth, fontsize, stringwidth_nocolors);
 	return strcat(pre, map, post);
 }
 
@@ -56,9 +56,9 @@
 	drawfont = sbar_font;
 	pos_y = pos_y + img_size_y;
 	
-	label = MapVote_FormatMapItem(id, map, count, tsize / sbar_fontsize_x);
+	label = MapVote_FormatMapItem(id, map, count, tsize, sbar_fontsize);
 
-	text_size = stringwidth(label, false) * sbar_fontsize_x;
+	text_size = stringwidth(label, false, sbar_fontsize);
 	
 	pos_x -= text_size*0.5;
 	drawstring(pos, label, sbar_fontsize, rgb, 1, DRAWFLAG_NORMAL);
@@ -102,9 +102,9 @@
 	drawfont = sbar_font;
 	pos_y = pos_y + sbar_fontsize_y;
 	
-	label = MapVote_FormatMapItem(id, "Don't care", count, tsize / sbar_fontsize_x);
+	label = MapVote_FormatMapItem(id, "Don't care", count, tsize, sbar_fontsize);
 
-	text_size = stringwidth(label, false) * sbar_fontsize_x;
+	text_size = stringwidth(label, false, sbar_fontsize);
 	
 	pos_x -= text_size*0.5;
 	drawstring(pos, label, sbar_fontsize, rgb, 1, DRAWFLAG_NORMAL);
@@ -149,13 +149,15 @@
 
 	pos_y = ymin;
 	pos_z = 0;
-	pos_x = center - stringwidth("Vote for a map", false) * 0.5 * 24;
+	//pos_x = center - stringwidth("Vote for a map", false) * 0.5 * 24;
+	pos_x = center - stringwidth("Vote for a map", false, '12 0 0');
 	drawstring(pos, "Vote for a map", '24 24 0', '1 1 1', 1, DRAWFLAG_NORMAL);
 	pos_y += 26;
 
 	i = ceil(max(0, mv_timeout - time));
 	map = strcat(ftos(i), " seconds left");
-	pos_x = center - stringwidth(map, false) * 0.5 * 16;
+	//pos_x = center - stringwidth(map, false) * 0.5 * 16;
+	pos_x = center - stringwidth(map, false, '8 0 0');
 	drawstring(pos, map, '16 16 0', '0 1 0', 1, DRAWFLAG_NORMAL);
 	pos_y += 22;
 	pos_x = xmin;

Modified: trunk/data/qcsrc/client/miscfunctions.qc
===================================================================
--- trunk/data/qcsrc/client/miscfunctions.qc	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/client/miscfunctions.qc	2009-09-03 16:05:02 UTC (rev 7611)
@@ -1,4 +1,4 @@
-var float(string text, float handleColors) stringwidth;
+var float(string text, float handleColors, vector fontSize) stringwidth;
 
 entity players;
 entity teams;
@@ -384,7 +384,7 @@
 	sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
 
 	dummyfunction(0, 0, 0, 0, 0, 0, 0, 0);
-	drawstring(position + expandingbox_resize_centered_box_offset(sz, scale, stringwidth(text, FALSE)), text, scale * sz, rgb, alpha * (1 - fadelerp), flag);
+	drawstring(position + expandingbox_resize_centered_box_offset(sz, scale, stringwidth(text, FALSE, '1 0 0')), text, scale * sz, rgb, alpha * (1 - fadelerp), flag);
 }
 
 void drawcolorcodedstring_expanding(vector position, string text, vector scale, float alpha, float flag, float fadelerp)
@@ -393,5 +393,5 @@
 	sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
 
 	dummyfunction(0, 0, 0, 0, 0, 0, 0, 0);
-	drawcolorcodedstring(position + expandingbox_resize_centered_box_offset(sz, scale, stringwidth(text, TRUE)), text, scale * sz, alpha * (1 - fadelerp), flag);
+	drawcolorcodedstring(position + expandingbox_resize_centered_box_offset(sz, scale, stringwidth(text, TRUE, '1 0 0')), text, scale * sz, alpha * (1 - fadelerp), flag);
 }

Modified: trunk/data/qcsrc/client/sbar.qc
===================================================================
--- trunk/data/qcsrc/client/sbar.qc	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/client/sbar.qc	2009-09-03 16:05:02 UTC (rev 7611)
@@ -434,7 +434,6 @@
 {
 	float i, j, slash;
 	string str, pattern;
-	float digit;
 	float have_name, have_primary, have_secondary, have_separator;
 	float missing;
 
@@ -471,7 +470,6 @@
 	sbar_num_fields = 0;
 
 	drawfont = sbar_font;
-	digit = stringwidth("0123456789", FALSE) / 10;
 
 	for(i = 0; i < argc - 1; ++i)
 	{
@@ -497,7 +495,7 @@
 
 		strunzone(sbar_title[sbar_num_fields]);
 		sbar_title[sbar_num_fields] = strzone(str);
-		sbar_size[sbar_num_fields] = stringwidth(str, FALSE);
+		sbar_size[sbar_num_fields] = stringwidth(str, FALSE, sbar_fontsize);
 		str = strtolower(str);
 
 		if(str == "ping") {
@@ -574,7 +572,7 @@
 				}
 				sbar_title[1] = strzone("|");
 				sbar_field[1] = SP_SEPARATOR;
-				sbar_size[1] = stringwidth("|", FALSE);
+				sbar_size[1] = stringwidth("|", FALSE, sbar_fontsize);
 				++sbar_num_fields;
 				print("fixed missing field '|'\n");
 			}
@@ -583,7 +581,7 @@
 		{
 			strunzone(sbar_title[sbar_num_fields]);
 			sbar_title[sbar_num_fields] = strzone("|");
-			sbar_size[sbar_num_fields] = stringwidth("|", FALSE);
+			sbar_size[sbar_num_fields] = stringwidth("|", FALSE, sbar_fontsize);
 			sbar_field[sbar_num_fields] = SP_SEPARATOR;
 			++sbar_num_fields;
 			print("fixed missing field '|'\n");
@@ -592,7 +590,7 @@
 		{
 			strunzone(sbar_title[sbar_num_fields]);
 			sbar_title[sbar_num_fields] = strzone(scores_label[ps_secondary]);
-			sbar_size[sbar_num_fields] = stringwidth(sbar_title[sbar_num_fields], FALSE);
+			sbar_size[sbar_num_fields] = stringwidth(sbar_title[sbar_num_fields], FALSE, sbar_fontsize);
 			sbar_field[sbar_num_fields] = ps_secondary;
 			++sbar_num_fields;
 			print("fixed missing field '", scores_label[ps_secondary], "'\n");
@@ -601,7 +599,7 @@
 		{
 			strunzone(sbar_title[sbar_num_fields]);
 			sbar_title[sbar_num_fields] = strzone(scores_label[ps_primary]);
-			sbar_size[sbar_num_fields] = stringwidth(sbar_title[sbar_num_fields], FALSE);
+			sbar_size[sbar_num_fields] = stringwidth(sbar_title[sbar_num_fields], FALSE, sbar_fontsize);
 			sbar_field[sbar_num_fields] = ps_primary;
 			++sbar_num_fields;
 			print("fixed missing field '", scores_label[ps_primary], "'\n");
@@ -718,14 +716,14 @@
 float sbar_fixscoreboardcolumnwidth_iconlen;
 float sbar_fixscoreboardcolumnwidth_marginlen;
 
-float stringwidth_colors(string s)
+float stringwidth_colors(string s, vector theSize)
 {
-	return stringwidth(s, TRUE);
+	return stringwidth(s, TRUE, theSize);
 }
 
-float stringwidth_nocolors(string s)
+float stringwidth_nocolors(string s, vector theSize)
 {
-	return stringwidth(s, FALSE);
+	return stringwidth(s, FALSE, theSize);
 }
 
 string Sbar_FixScoreboardColumnWidth(float i, string str)
@@ -763,14 +761,14 @@
 	sbar_fixscoreboardcolumnwidth_iconlen *= sbar_fontsize_y / sbar_fontsize_x; // fix icon aspect
 
 	if(sbar_fixscoreboardcolumnwidth_iconlen != 0)
-		sbar_fixscoreboardcolumnwidth_marginlen = stringwidth(" ", FALSE);
+		sbar_fixscoreboardcolumnwidth_marginlen = stringwidth(" ", FALSE, sbar_fontsize);
 	else
 		sbar_fixscoreboardcolumnwidth_marginlen = 0;
 
 	if(field == SP_NAME) // name gets all remaining space
 	{
 		float namesize, j;
-		namesize = sbwidth / sbar_fontsize_x;
+		namesize = sbwidth;// / sbar_fontsize_x;
 		for(j = 0; j < sbar_num_fields; ++j)
 			if(j != i)
 				if (sbar_field[i] != SP_SEPARATOR)
@@ -780,11 +778,11 @@
 		
 		if (sbar_fixscoreboardcolumnwidth_iconlen != 0)
 			namesize -= sbar_fixscoreboardcolumnwidth_marginlen + sbar_fixscoreboardcolumnwidth_iconlen;
-		str = textShortenToWidth(str, namesize, stringwidth_colors);
-		sbar_fixscoreboardcolumnwidth_len = stringwidth(str, TRUE);
+		str = textShortenToWidth(str, namesize, sbar_fontsize, stringwidth_colors);
+		sbar_fixscoreboardcolumnwidth_len = stringwidth(str, TRUE, sbar_fontsize);
 	}
 	else
-		sbar_fixscoreboardcolumnwidth_len = stringwidth(str, FALSE);
+		sbar_fixscoreboardcolumnwidth_len = stringwidth(str, FALSE, sbar_fontsize);
 	
 	f = sbar_fixscoreboardcolumnwidth_len + sbar_fixscoreboardcolumnwidth_marginlen + sbar_fixscoreboardcolumnwidth_iconlen;
 	if(sbar_size[i] < f)
@@ -825,23 +823,23 @@
 			break;
 
 		if(is_spec && field != SP_NAME && field != SP_PING) {
-			pos_x += sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
+			pos_x += sbar_size[i] + sbar_fontsize_x;
 			continue;
 		}
 		str = Sbar_GetField(pl, field);
 		str = Sbar_FixScoreboardColumnWidth(i, str);
 
-		pos_x += sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
+		pos_x += sbar_size[i] + sbar_fontsize_x;
 
 		if(field == SP_NAME) {
-			tmp_x = sbar_fontsize_x*(sbar_size[i] - sbar_fixscoreboardcolumnwidth_iconlen - sbar_fixscoreboardcolumnwidth_marginlen) + sbar_fontsize_x;
+			tmp_x = (sbar_size[i] - sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen - sbar_fixscoreboardcolumnwidth_marginlen) + sbar_fontsize_x;
 			drawcolorcodedstring(pos - tmp, str, sbar_fontsize, 1, DRAWFLAG_NORMAL);
 		} else {
-			tmp_x = sbar_fixscoreboardcolumnwidth_len*sbar_fontsize_x + sbar_fontsize_x;
+			tmp_x = sbar_fixscoreboardcolumnwidth_len + sbar_fontsize_x;
 			drawstring(pos - tmp, str, sbar_fontsize, sbar_field_rgb, 1, DRAWFLAG_NORMAL);
 		}
 
-		tmp_x = sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
+		tmp_x = sbar_size[i] + sbar_fontsize_x;
 		if(sbar_field_icon0 != "")
 			drawpic(pos - tmp, sbar_field_icon0, '0 1 0' * sbar_fontsize_y + '1 0 0' * sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen, sbar_field_icon1_rgb, sbar_field_icon0_alpha, DRAWFLAG_NORMAL);
 		if(sbar_field_icon1 != "")
@@ -860,7 +858,7 @@
 				break;
 
 			if(is_spec && field != SP_NAME && field != SP_PING) {
-				pos_x -= sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
+				pos_x -= sbar_size[i] + sbar_fontsize_x;
 				continue;
 			}
 
@@ -868,14 +866,14 @@
 			str = Sbar_FixScoreboardColumnWidth(i, str);
 
 			if(field == SP_NAME) {
-				tmp_x = sbar_fontsize_x*sbar_fixscoreboardcolumnwidth_len; // left or right aligned? let's put it right...
+				tmp_x = sbar_fixscoreboardcolumnwidth_len; // left or right aligned? let's put it right...
 				drawcolorcodedstring(pos - tmp, str, sbar_fontsize, 1, DRAWFLAG_NORMAL);
 			} else {
-				tmp_x = sbar_fontsize_x*sbar_fixscoreboardcolumnwidth_len;
+				tmp_x = sbar_fixscoreboardcolumnwidth_len;
 				drawstring(pos - tmp, str, sbar_fontsize, sbar_field_rgb, 1, DRAWFLAG_NORMAL);
 			}
 
-			tmp_x = sbar_fontsize_x*sbar_size[i];
+			tmp_x = sbar_size[i];
 			if(sbar_field_icon0 != "")
 				drawpic(pos - tmp, sbar_field_icon0, '0 1 0' * sbar_fontsize_y + '1 0 0' * sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen, sbar_field_icon1_rgb, sbar_field_icon0_alpha, DRAWFLAG_NORMAL);
 			if(sbar_field_icon1 != "")
@@ -883,7 +881,7 @@
 			if(sbar_field_icon2 != "")
 				drawpic(pos - tmp, sbar_field_icon2, '0 1 0' * sbar_fontsize_y + '1 0 0' * sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen, sbar_field_icon2_rgb, sbar_field_icon2_alpha, DRAWFLAG_NORMAL);
 
-			pos_x -= sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
+			pos_x -= sbar_size[i] + sbar_fontsize_x;
 		}
 	}
 }
@@ -947,7 +945,7 @@
 	{
 		if(sbar_field[i] == SP_SEPARATOR)
 			break;
-		column_dim_x = sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
+		column_dim_x = sbar_size[i] + sbar_fontsize_x;
 		if (sbar_scoreboard_highlight)
 		{
 			if (mod(i,2))
@@ -965,21 +963,21 @@
 			if(sbar_field[i] == SP_SEPARATOR)
 				break;
 
-			pos_x -= sbar_size[i]*sbar_fontsize_x;
+			pos_x -= sbar_size[i];
 
 			if (sbar_scoreboard_highlight)
 			{
 				if (!mod(i,2))
 				{
 					if (i == sbar_num_fields-1)
-						column_dim_x = sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x / 2 + 1;
+						column_dim_x = sbar_size[i] + sbar_fontsize_x / 2 + 1;
 					else
-						column_dim_x = sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
+						column_dim_x = sbar_size[i] + sbar_fontsize_x;
 					drawfill(pos - '0 1 0' - sbar_fontsize_x / 2 * '1 0 0', column_dim, '0 0 0', sbar_scoreboard_alpha_bg * 0.2, DRAWFLAG_NORMAL);
 				}
 			}
 
-			tmp_x = stringwidth(sbar_title[i], FALSE);
+			tmp_x = stringwidth(sbar_title[i], FALSE, sbar_fontsize);
 			tmp_x = (sbar_size[i] - tmp_x) * sbar_fontsize_x;
 			drawstring(pos + tmp, sbar_title[i], sbar_fontsize, rgb, 1, DRAWFLAG_NORMAL);
 			pos_x -= sbar_fontsize_x;
@@ -1182,7 +1180,7 @@
 
 
 	pos_y += 1.2 * sbar_fontsize_y;
-	drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - sbar_fontsize_x * stringwidth(str, TRUE)), str, sbar_fontsize, 0.8, DRAWFLAG_NORMAL);
+	drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, TRUE, sbar_fontsize)), str, sbar_fontsize, 0.8, DRAWFLAG_NORMAL);
 
 	sbar = sbar_save;
 	scoreboard_bottom = pos_y + 2 * sbar_fontsize_y;
@@ -1536,7 +1534,8 @@
 			if(s != "" && a > 0)
 			{
 				dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
-				drawcolorcodedstring(m - '0 16 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
+				//drawcolorcodedstring(m - '0 16 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
+				drawcolorcodedstring(m - '0 16 0' - '0.5 0 0' * stringwidth(s, TRUE, '16 16 0'), s, '16 16 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
 			}
 
 			if(race_penaltytime)
@@ -1546,14 +1545,16 @@
 				{
 					s = strcat("^1PENALTY: ", ftos_decimals(race_penaltytime * 0.1, 1), " (", race_penaltyreason, ")");
 					dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
-					drawcolorcodedstring(m - '0 32 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
+					//drawcolorcodedstring(m - '0 32 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
+					drawcolorcodedstring(m - '0 32 0' - '0.5 0 0' * stringwidth(s, TRUE, '16 16 0'), s, '16 16 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
 				}
 			}
 
 			if(forcetime != "")
 			{
 				a = bound(0, (time - race_checkpointtime) / 0.5, 1);
-				drawstring_expanding(m - '16 0 0' * stringwidth(forcetime, FALSE), forcetime, '32 32 0', '1 1 1', sbar_alpha_fg, 0, a);
+				//drawstring_expanding(m - '16 0 0' * stringwidth(forcetime, FALSE), forcetime, '32 32 0', '1 1 1', sbar_alpha_fg, 0, a);
+				drawstring_expanding(m - '1 0 0' * stringwidth(forcetime, FALSE, '16 0 0'), forcetime, '32 32 0', '1 1 1', sbar_alpha_fg, 0, a);
 			}
 			else
 				a = 1;
@@ -1561,7 +1562,8 @@
 			if(race_laptime && race_checkpoint != 255)
 			{
 				s = TIME_ENCODED_TOSTRING(TIME_ENCODE(time + TIME_DECODE(race_penaltyaccumulator) - race_laptime));
-				drawstring(m - '16 0 0' * stringwidth(s, FALSE), s, '32 32 0', '1 1 1', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
+				//drawstring(m - '16 0 0' * stringwidth(s, FALSE), s, '32 32 0', '1 1 1', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
+				drawstring(m - '0.5 0 0' * stringwidth(s, FALSE, '32 32 0'), s, '32 32 0', '1 1 1', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
 			}
 		}
 		else
@@ -1571,14 +1573,16 @@
 				a = bound(0, 2 - (time - race_mycheckpointtime), 1);
 				s = MakeRaceString(race_mycheckpoint, TIME_DECODE(race_mycheckpointdelta), -!race_mycheckpointenemy, race_mycheckpointlapsdelta, race_mycheckpointenemy);
 				dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
-				drawcolorcodedstring(m - '0 16 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
+				//drawcolorcodedstring(m - '0 16 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
+				drawcolorcodedstring(m - '0 16 0' - '0.5 0 0' * stringwidth(s, TRUE, '16 16 0'), s, '16 16 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
 			}
 			if(race_othercheckpointtime && race_othercheckpointenemy != "")
 			{
 				a = bound(0, 2 - (time - race_othercheckpointtime), 1);
 				s = MakeRaceString(race_othercheckpoint, -TIME_DECODE(race_othercheckpointdelta), -!race_othercheckpointenemy, race_othercheckpointlapsdelta, race_othercheckpointenemy);
 				dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
-				drawcolorcodedstring(m - '0 0 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
+				//drawcolorcodedstring(m - '0 0 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
+				drawcolorcodedstring(m - '0 0 0' - '0.5 0 0' * stringwidth(s, TRUE, '16 16 0'), s, '16 16 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
 			}
 
 			if(race_penaltytime && !race_penaltyaccumulator)
@@ -1592,7 +1596,8 @@
 					else
 						s = strcat("^2PENALTY: 0.0 (", race_penaltyreason, ")");
 					dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
-					drawcolorcodedstring(m - '0 32 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
+					//drawcolorcodedstring(m - '0 32 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
+					drawcolorcodedstring(m - '0 32 0' - '0.5 0 0' * stringwidth(s, TRUE, '16 16 0'), s, '16 16 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
 				}
 			}
 		}
@@ -1751,11 +1756,11 @@
 		getWrappedLine_remaining = argv(j);
 		while(getWrappedLine_remaining)
 		{
-			s = getWrappedLine(vid_conwidth * 0.75 / centerprint_fontsize_x, stringwidth_colors);
+			s = getWrappedLine(vid_conwidth * 0.75, centerprint_fontsize, stringwidth_colors);
 			if(centerprint_messages[i])
 				strunzone(centerprint_messages[i]);
 			centerprint_messages[i] = strzone(s);
-			centerprint_width[i] = stringwidth(s, TRUE);
+			centerprint_width[i] = stringwidth(s, TRUE, centerprint_fontsize);
 			++i;
 
 			// half height for empty lines looks better
@@ -1883,7 +1888,7 @@
 {
 	dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
 	drawcolorcodedstring(
-		offset - sbar_fontsize_x * '1 0 0' * stringwidth(s, TRUE),
+		offset - '1 0 0' * stringwidth(s, TRUE, sbar_fontsize),
 		s,
 		sbar_fontsize,
 		sbar_alpha_fg,
@@ -2217,7 +2222,7 @@
 		// spectated player name between HUD and chat area, aligned to the left
 		pos_x = bottomleft_x;
 		pos_y = bottom_y - 50 - sbar_fontsize_spec_y;
-		s = textShortenToWidth(s, vid_conwidth/2.5/sbar_fontsize_spec_x, stringwidth_colors);
+		s = textShortenToWidth(s, vid_conwidth/2.5, sbar_fontsize_spec, stringwidth_colors);
 		drawcolorcodedstring(pos, s, sbar_fontsize_spec, 1, DRAWFLAG_NORMAL);
 
 		// spectator text in the upper right corner

Modified: trunk/data/qcsrc/common/util.qc
===================================================================
--- trunk/data/qcsrc/common/util.qc	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/common/util.qc	2009-09-03 16:05:02 UTC (rev 7611)
@@ -1201,11 +1201,80 @@
 }
 #endif
 
-float textLengthUpToWidth(string theText, float maxWidth, textLengthUpToWidth_widthFunction_t w)
+float textLengthUpToWidth(string theText, float maxWidth, vector theSize, textLengthUpToWidth_widthFunction_t w)
 {
 	float ICanHasKallerz;
 
 	// detect color codes support in the width function
+	ICanHasKallerz = (w("^7", theSize) == 0);
+
+	// STOP.
+	// The following function is SLOW.
+	// For your safety and for the protection of those around you...
+	// DO NOT CALL THIS AT HOME.
+	// No really, don't.
+	if(w(theText, theSize) <= maxWidth)
+		return strlen(theText); // yeah!
+
+	// binary search for right place to cut string
+	float ch;
+	float left, right, middle; // this always works
+	left = 0;
+	right = strlen(theText); // this always fails
+	do
+	{
+		middle = floor((left + right) / 2);
+		if(w(substring(theText, 0, middle), theSize) <= maxWidth)
+			left = middle;
+		else
+			right = middle;
+	}
+	while(left < right - 1);
+
+	if(ICanHasKallerz)
+	{
+		// NOTE: when color codes are involved, this binary search is,
+		// mathematically, BROKEN. However, it is obviously guaranteed to
+		// terminate, as the range still halves each time - but nevertheless, it is
+		// guaranteed that it finds ONE valid cutoff place (where "left" is in
+		// range, and "right" is outside).
+		
+		// terencehill: the following code detects truncated ^xrgb tags (e.g. ^x or ^x4)
+		// and decrease left on the basis of the chars detected of the truncated tag
+		// Even if the ^xrgb tag is not complete/correct, left is decreased
+		// (sometimes too much but with a correct result)
+		// it fixes also ^[0-9]
+		while(left >= 1 && substring(theText, left-1, 1) == "^")
+			left-=1;
+
+		if (left >= 2 && substring(theText, left-2, 2) == "^x") // ^x/
+			left-=2;
+		else if (left >= 3 && substring(theText, left-3, 2) == "^x")
+			{
+				ch = str2chr(theText, left-1);
+				if( (ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F') ) // ^xr/
+					left-=3;
+			}
+		else if (left >= 4 && substring(theText, left-4, 2) == "^x")
+			{
+				ch = str2chr(theText, left-2);
+				if ( (ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F') )
+				{
+					ch = str2chr(theText, left-1);
+					if ( (ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F') ) // ^xrg/
+						left-=4;
+				}
+			}
+	}
+	
+	return left;
+}
+
+float textLengthUpToLength(string theText, float maxWidth, textLengthUpToLength_lenFunction_t w)
+{
+	float ICanHasKallerz;
+
+	// detect color codes support in the width function
 	ICanHasKallerz = (w("^7") == 0);
 
 	// STOP.
@@ -1270,7 +1339,7 @@
 	return left;
 }
 
-string getWrappedLine(float w, textLengthUpToWidth_widthFunction_t tw)
+string getWrappedLine(float w, vector theFontSize, textLengthUpToWidth_widthFunction_t tw)
 {
 	float cantake;
 	float take;
@@ -1278,7 +1347,7 @@
 
 	s = getWrappedLine_remaining;
 
-	cantake = textLengthUpToWidth(s, w, tw);
+	cantake = textLengthUpToWidth(s, w, theFontSize, tw);
 	if(cantake > 0 && cantake < strlen(s))
 	{
 		take = cantake - 1;
@@ -1306,12 +1375,56 @@
 	}
 }
 
-string textShortenToWidth(string theText, float maxWidth, textLengthUpToWidth_widthFunction_t tw)
+string getWrappedLineLen(float w, textLengthUpToLength_lenFunction_t tw)
 {
+	float cantake;
+	float take;
+	string s;
+
+	s = getWrappedLine_remaining;
+
+	cantake = textLengthUpToLength(s, w, tw);
+	if(cantake > 0 && cantake < strlen(s))
+	{
+		take = cantake - 1;
+		while(take > 0 && substring(s, take, 1) != " ")
+			--take;
+		if(take == 0)
+		{
+			getWrappedLine_remaining = substring(s, cantake, strlen(s) - cantake);
+			if(getWrappedLine_remaining == "")
+				getWrappedLine_remaining = string_null;
+			return substring(s, 0, cantake);
+		}
+		else
+		{
+			getWrappedLine_remaining = substring(s, take + 1, strlen(s) - take);
+			if(getWrappedLine_remaining == "")
+				getWrappedLine_remaining = string_null;
+			return substring(s, 0, take);
+		}
+	}
+	else
+	{
+		getWrappedLine_remaining = string_null;
+		return s;
+	}
+}
+
+string textShortenToWidth(string theText, float maxWidth, vector theFontSize, textLengthUpToWidth_widthFunction_t tw)
+{
+	if(tw(theText, theFontSize) <= maxWidth)
+		return theText;
+	else
+		return strcat(substring(theText, 0, textLengthUpToWidth(theText, maxWidth - tw("...", theFontSize), theFontSize, tw)), "...");
+}
+
+string textShortenToLength(string theText, float maxWidth, textLengthUpToLength_lenFunction_t tw)
+{
 	if(tw(theText) <= maxWidth)
 		return theText;
 	else
-		return strcat(substring(theText, 0, textLengthUpToWidth(theText, maxWidth - tw("..."), tw)), "...");
+		return strcat(substring(theText, 0, textLengthUpToLength(theText, maxWidth - tw("..."), tw)), "...");
 }
 
 float isGametypeInFilter(float gt, float tp, string pattern)

Modified: trunk/data/qcsrc/common/util.qh
===================================================================
--- trunk/data/qcsrc/common/util.qh	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/common/util.qh	2009-09-03 16:05:02 UTC (rev 7611)
@@ -150,12 +150,16 @@
 vector AnglesTransform_Divide(vector to_transform, vector from_transform);
 #endif
 
-typedef float(string s) textLengthUpToWidth_widthFunction_t;
-float textLengthUpToWidth(string theText, float maxWidth, textLengthUpToWidth_widthFunction_t tw);
-string textShortenToWidth(string theText, float maxWidth, textLengthUpToWidth_widthFunction_t tw);
+typedef float(string s, vector size) textLengthUpToWidth_widthFunction_t;
+typedef float(string s) textLengthUpToLength_lenFunction_t;
+float textLengthUpToWidth(string theText, float maxWidth, vector size, textLengthUpToWidth_widthFunction_t tw);
+string textShortenToWidth(string theText, float maxWidth, vector size, textLengthUpToWidth_widthFunction_t tw);
+float textLengthUpToLength(string theText, float maxWidth, textLengthUpToLength_lenFunction_t tw);
+string textShortenToLength(string theText, float maxWidth, textLengthUpToLength_lenFunction_t tw);
 
 string getWrappedLine_remaining;
-string getWrappedLine(float w, textLengthUpToWidth_widthFunction_t tw);
+string getWrappedLine(float w, vector size, textLengthUpToWidth_widthFunction_t tw);
+string getWrappedLineLen(float w, textLengthUpToLength_lenFunction_t tw);
 
 float isGametypeInFilter(float gt, float tp, string pattern);
 

Modified: trunk/data/qcsrc/menu/draw.qc
===================================================================
--- trunk/data/qcsrc/menu/draw.qc	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/menu/draw.qc	2009-09-03 16:05:02 UTC (rev 7611)
@@ -238,14 +238,14 @@
 }
 void draw_CenterText(vector theOrigin, string theText, vector theSize, vector theColor, float theAlpha, float ICanHasKallerz)
 {
-	draw_Text(theOrigin - eX * theSize_x * 0.5 * draw_TextWidth(theText, ICanHasKallerz), theText, theSize, theColor, theAlpha, ICanHasKallerz);
+	draw_Text(theOrigin - eX * 0.5 * draw_TextWidth(theText, ICanHasKallerz, theSize), theText, theSize, theColor, theAlpha, ICanHasKallerz);
 }
 
-float draw_TextWidth(string theText, float ICanHasKallerz)
+float draw_TextWidth(string theText, float ICanHasKallerz, vector SizeThxBye)
 {
 	//return strlen(theText);
 	//print("draw_TextWidth \"", theText, "\"\n");
-	return stringwidth(theText, ICanHasKallerz);
+	return stringwidth(theText, ICanHasKallerz, SizeThxBye);
 }
 
 float draw_clipSet;
@@ -276,28 +276,28 @@
 	draw_clipSet = 0;
 }
 
-string draw_TextShortenToWidth(string theText, float maxWidth, float ICanHasKallerz)
+string draw_TextShortenToWidth(string theText, float maxWidth, float ICanHasKallerz, vector SizeThxBye)
 {
-	if(draw_TextWidth(theText, ICanHasKallerz) <= maxWidth)
+	if(draw_TextWidth(theText, ICanHasKallerz, SizeThxBye) <= maxWidth)
 		return theText;
 	else
-		return strcat(substring(theText, 0, draw_TextLengthUpToWidth(theText, maxWidth - draw_TextWidth("...", ICanHasKallerz), ICanHasKallerz)), "...");
+		return strcat(substring(theText, 0, draw_TextLengthUpToWidth(theText, maxWidth - draw_TextWidth("...", ICanHasKallerz, SizeThxBye), ICanHasKallerz, SizeThxBye)), "...");
 }
 
-float draw_TextWidth_WithColors(string s)
+float draw_TextWidth_WithColors(string s, vector theFontSize)
 {
-	return draw_TextWidth(s, TRUE);
+	return draw_TextWidth(s, TRUE, theFontSize);
 }
 
-float draw_TextWidth_WithoutColors(string s)
+float draw_TextWidth_WithoutColors(string s, vector theFontSize)
 {
-	return draw_TextWidth(s, FALSE);
+	return draw_TextWidth(s, FALSE, theFontSize);
 }
 
-float draw_TextLengthUpToWidth(string theText, float maxWidth, float allowColorCodes)
+float draw_TextLengthUpToWidth(string theText, float maxWidth, float allowColorCodes, vector theFontSize)
 {
 	if(allowColorCodes)
-		return textLengthUpToWidth(theText, maxWidth, draw_TextWidth_WithColors);
+		return textLengthUpToWidth(theText, maxWidth, theFontSize, draw_TextWidth_WithColors);
 	else
-		return textLengthUpToWidth(theText, maxWidth, draw_TextWidth_WithoutColors);
+		return textLengthUpToWidth(theText, maxWidth, theFontSize, draw_TextWidth_WithoutColors);
 }

Modified: trunk/data/qcsrc/menu/draw.qh
===================================================================
--- trunk/data/qcsrc/menu/draw.qh	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/menu/draw.qh	2009-09-03 16:05:02 UTC (rev 7611)
@@ -15,9 +15,9 @@
 void draw_Fill(vector theOrigin, vector theSize, vector theColor, float theAlpha);
 void draw_Text(vector origin, string text, vector size, vector color, float alpha, float allowColorCodes);
 void draw_CenterText(vector origin, string text, vector size, vector color, float alpha, float allowColorCodes);
-float draw_TextWidth(string text, float allowColorCodes);
-string draw_TextShortenToWidth(string text, float maxWidth, float allowColorCodes);
-float draw_TextLengthUpToWidth(string text, float maxWidth, float allowColorCodes);
+float draw_TextWidth(string text, float allowColorCodes, vector size);
+string draw_TextShortenToWidth(string text, float maxWidth, float allowColorCodes, vector size);
+float draw_TextLengthUpToWidth(string text, float maxWidth, float allowColorCodes, vector size);
 
 void draw_SetClip();
 void draw_SetClipRect(vector theOrigin, vector theScale);
@@ -32,5 +32,5 @@
 
 string draw_currentSkin;
 
-float draw_TextWidth_WithColors(string s);
-float draw_TextWidth_WithoutColors(string s);
+float draw_TextWidth_WithColors(string s, vector size);
+float draw_TextWidth_WithoutColors(string s, vector size);

Modified: trunk/data/qcsrc/menu/item/inputbox.c
===================================================================
--- trunk/data/qcsrc/menu/item/inputbox.c	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/menu/item/inputbox.c	2009-09-03 16:05:02 UTC (rev 7611)
@@ -55,7 +55,7 @@
 	float p;
 	me.dragScrollPos = pos;
 	p = me.scrollPos + pos_x - me.keepspaceLeft;
-	me.cursorPos = draw_TextLengthUpToWidth(me.text, p / me.realFontSize_x, 0);
+	me.cursorPos = draw_TextLengthUpToWidth(me.text, p, 0, me.realFontSize);
 	me.lastChangeTime = time;
 	return 1;
 }
@@ -146,8 +146,8 @@
 	}
 
 	me.cursorPos = bound(0, me.cursorPos, strlen(me.text));
-	cursorPosInWidths = draw_TextWidth(substring(me.text, 0, me.cursorPos), 0) * me.realFontSize_x;
-	totalSizeInWidths = draw_TextWidth(strcat(me.text, CURSOR), 0) * me.realFontSize_x;
+	cursorPosInWidths = draw_TextWidth(substring(me.text, 0, me.cursorPos), 0, me.realFontSize);
+	totalSizeInWidths = draw_TextWidth(strcat(me.text, CURSOR), 0, me.realFontSize);
 
 	if(me.dragScrollTimer < time)
 	{
@@ -183,7 +183,7 @@
 			{
 				float w;
 				ch2 = substring(me.text, i+1, 1);
-				w = draw_TextWidth(strcat(ch, ch2), 0) * me.realFontSize_x;
+				w = draw_TextWidth(strcat(ch, ch2), 0, me.realFontSize);
 				if(ch2 == "^")
 				{
 					draw_Fill(p, eX * w + eY * me.realFontSize_y, '1 1 1', 0.5);
@@ -227,7 +227,7 @@
 							{
 								theTempColor_z = component/15;
 								theColor = theTempColor;
-								w = draw_TextWidth(substring(me.text, i, 5), 0) * me.realFontSize_x;
+								w = draw_TextWidth(substring(me.text, i, 5), 0, me.realFontSize);
 								
 								draw_Fill(p, eX * w + eY * me.realFontSize_y, '1 1 1', 0.5);
 								draw_Text(p, substring(me.text, i, 5), me.realFontSize, theColor, 1, 0);    // theVariableAlpha instead of 1 using alpha tags ^ax
@@ -236,7 +236,7 @@
 							else
 							{
 								// blue missing
-								w = draw_TextWidth(substring(me.text, i, 4), 0) * me.realFontSize_x;
+								w = draw_TextWidth(substring(me.text, i, 4), 0, me.realFontSize);
 								draw_Fill(p, eX * w + eY * me.realFontSize_y, eZ, 0.5);
 								draw_Text(p, substring(me.text, i, 4), me.realFontSize, '1 1 1', theAlpha, 0);
 								i += 2;
@@ -245,7 +245,7 @@
 						else
 						{
 							// green missing
-							w = draw_TextWidth(substring(me.text, i, 3), 0) * me.realFontSize_x;
+							w = draw_TextWidth(substring(me.text, i, 3), 0, me.realFontSize);
 							draw_Fill(p, eX * w + eY * me.realFontSize_y, eY, 0.5);
 							draw_Text(p, substring(me.text, i, 3), me.realFontSize, '1 1 1', theAlpha, 0);
 							i += 1;
@@ -284,7 +284,7 @@
 						else
 							theVariableAlpha = component*0.0625;
 						
-						draw_Fill(p, eX * draw_TextWidth(substring(me.text, i, 3), 0) * me.realFontSize_x + eY * me.realFontSize_y, '0.8 0.8 0.8', 0.5);
+						draw_Fill(p, eX * draw_TextWidth(substring(me.text, i, 3), 0, me.realFontSize) + eY * me.realFontSize_y, '0.8 0.8 0.8', 0.5);
 						draw_Text(p, strcat(ch, ch2), me.realFontSize, theColor, 0.8, 0);
 					}
 				}*/
@@ -298,7 +298,7 @@
 				continue;
 			}
 			draw_Text(p, ch, me.realFontSize, theColor, theAlpha, 0); // TODO theVariableAlpha
-			p += eX * draw_TextWidth(ch, 0) * me.realFontSize_x;
+			p += eX * draw_TextWidth(ch, 0, me.realFontSize);
 		}
 	}
 	else

Modified: trunk/data/qcsrc/menu/item/label.c
===================================================================
--- trunk/data/qcsrc/menu/item/label.c	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/menu/item/label.c	2009-09-03 16:05:02 UTC (rev 7611)
@@ -33,7 +33,7 @@
 void setTextLabel(entity me, string txt)
 {
 	me.text = txt;
-	me.realOrigin_x = me.align * (1 - me.keepspaceLeft - me.keepspaceRight - min(me.realFontSize_x * draw_TextWidth(me.text, me.allowColors), (1 - me.keepspaceLeft - me.keepspaceRight))) + me.keepspaceLeft;
+	me.realOrigin_x = me.align * (1 - me.keepspaceLeft - me.keepspaceRight - min(draw_TextWidth(me.text, me.allowColors, me.realFontSize), (1 - me.keepspaceLeft - me.keepspaceRight))) + me.keepspaceLeft;
 }
 void resizeNotifyLabel(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
 {
@@ -45,7 +45,7 @@
 		me.keepspaceLeft = me.marginLeft * me.realFontSize_x;
 	if(me.marginRight)
 		me.keepspaceRight = me.marginRight * me.realFontSize_x;
-	me.realOrigin_x = me.align * (1 - me.keepspaceLeft - me.keepspaceRight - min(me.realFontSize_x * draw_TextWidth(me.text, me.allowColors), (1 - me.keepspaceLeft - me.keepspaceRight))) + me.keepspaceLeft;
+	me.realOrigin_x = me.align * (1 - me.keepspaceLeft - me.keepspaceRight - min(draw_TextWidth(me.text, me.allowColors, me.realFontSize), (1 - me.keepspaceLeft - me.keepspaceRight))) + me.keepspaceLeft;
 	me.realOrigin_y = 0.5 * (1 - me.realFontSize_y);
 }
 void configureLabelLabel(entity me, string txt, float sz, float algn)
@@ -64,7 +64,7 @@
 	if(me.textEntity)
 	{
 		t = me.textEntity.toString(me.textEntity);
-		me.realOrigin_x = me.align * (1 - me.keepspaceLeft - me.keepspaceRight - min(me.realFontSize_x * draw_TextWidth(t, 0), (1 - me.keepspaceLeft - me.keepspaceRight))) + me.keepspaceLeft;
+		me.realOrigin_x = me.align * (1 - me.keepspaceLeft - me.keepspaceRight - min(draw_TextWidth(t, 0, me.realFontSize), (1 - me.keepspaceLeft - me.keepspaceRight))) + me.keepspaceLeft;
 	}
 	else
 		t = me.text;
@@ -73,7 +73,7 @@
 		if(t)
 		{
 			if(me.allowCut) // FIXME allowCut incompatible with align != 0
-				draw_Text(me.realOrigin, draw_TextShortenToWidth(t, (1 - me.keepspaceLeft - me.keepspaceRight) / me.realFontSize_x, me.allowColors), me.realFontSize, me.colorL, me.alpha, me.allowColors);
+				draw_Text(me.realOrigin, draw_TextShortenToWidth(t, (1 - me.keepspaceLeft - me.keepspaceRight), me.allowColors, me.realFontSize), me.realFontSize, me.colorL, me.alpha, me.allowColors);
 			else if(me.allowWrap) // FIXME allowWrap incompatible with align != 0
 			{
 				getWrappedLine_remaining = t;
@@ -81,9 +81,9 @@
 				while(getWrappedLine_remaining)
 				{
 					if (me.allowColors)
-						t = getWrappedLine((1 - me.keepspaceLeft - me.keepspaceRight) / me.realFontSize_x, draw_TextWidth_WithColors);
+						t = getWrappedLine((1 - me.keepspaceLeft - me.keepspaceRight), me.realFontSize, draw_TextWidth_WithColors);
 					else
-						t = getWrappedLine((1 - me.keepspaceLeft - me.keepspaceRight) / me.realFontSize_x, draw_TextWidth_WithoutColors);
+						t = getWrappedLine((1 - me.keepspaceLeft - me.keepspaceRight), me.realFontSize, draw_TextWidth_WithoutColors);
 					draw_Text(o, t, me.realFontSize, me.colorL, me.alpha, me.allowColors);
 					o_y += me.realFontSize_y;
 				}

Modified: trunk/data/qcsrc/menu/mbuiltin.qh
===================================================================
--- trunk/data/qcsrc/menu/mbuiltin.qh	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/menu/mbuiltin.qh	2009-09-03 16:05:02 UTC (rev 7611)
@@ -195,7 +195,7 @@
 
 float	drawstring(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #455;
 float   drawcolorcodedstring(vector position, string text, vector scale, float alpha, float flag) = #467;
-float	stringwidth(string text, float handleColors) = #468;
+float	stringwidth(string text, float handleColors, vector size) = #468;
 
 float	drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #456;
 float	drawsubpic(vector position, vector size, string pic, vector srcPosition, vector srcSize, vector rgb, float alpha, float flag) = #469;

Modified: trunk/data/qcsrc/menu/menu.qc
===================================================================
--- trunk/data/qcsrc/menu/menu.qc	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/menu/menu.qc	2009-09-03 16:05:02 UTC (rev 7611)
@@ -377,13 +377,13 @@
 					getWrappedLine_remaining = it.tooltip;
 					while(getWrappedLine_remaining)
 					{
-						s = getWrappedLine(SKINWIDTH_TOOLTIP / fontsize_x, draw_TextWidth_WithoutColors);
+						s = getWrappedLine(SKINWIDTH_TOOLTIP, fontsize, draw_TextWidth_WithoutColors);
 						++i;
-						f = draw_TextWidth(s, FALSE);
+						f = draw_TextWidth(s, FALSE, fontsize);
 						if(f > w)
 							w = f;
 					}
-					menuTooltipSize_x = w * fontsize_x + 2 * (SKINMARGIN_TOOLTIP_x / conwidth);
+					menuTooltipSize_x = w + 2 * (SKINMARGIN_TOOLTIP_x / conwidth);
 					menuTooltipSize_y = i * fontsize_y + 2 * (SKINMARGIN_TOOLTIP_y / conheight);
 					menuTooltipSize_z = 0;
 				}
@@ -439,7 +439,7 @@
 			getWrappedLine_remaining = menuTooltipItem.tooltip;
 			while(getWrappedLine_remaining)
 			{
-				s = getWrappedLine(SKINWIDTH_TOOLTIP / fontsize_x, draw_TextWidth_WithoutColors);
+				s = getWrappedLine(SKINWIDTH_TOOLTIP, fontsize, draw_TextWidth_WithoutColors);
 				draw_Text(p, s, fontsize, '1 1 1', SKINALPHA_TOOLTIP * menuTooltipAlpha, FALSE);
 				p_y += fontsize_y;
 			}

Modified: trunk/data/qcsrc/menu/nexuiz/campaign.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/campaign.c	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/menu/nexuiz/campaign.c	2009-09-03 16:05:02 UTC (rev 7611)
@@ -49,7 +49,7 @@
 #ifdef IMPLEMENTATION
 string campaign_longdesc_wrapped[CAMPAIGN_MAX_ENTRIES];
 
-void rewrapCampaign(float w, float l0, float emptyheight)
+void rewrapCampaign(float w, float l0, float emptyheight, vector theFontSize)
 {
 	float i, j;
 	float n, l;
@@ -74,7 +74,7 @@
 			getWrappedLine_remaining = s;
 			while(getWrappedLine_remaining)
 			{
-				s = getWrappedLine(w, draw_TextWidth_WithoutColors);
+				s = getWrappedLine(w, theFontSize, draw_TextWidth_WithoutColors);
 				if(--l < 0) goto toolong;
 				r = strcat(r, s, "\n");
 			}
@@ -125,7 +125,7 @@
 	me.campaignIndex = bound(0, cvar(me.cvarName), campaign_entries);
 	cvar_set(me.cvarName, ftos(me.campaignIndex));
 	if(me.columnNameSize)
-		rewrapCampaign(me.columnNameSize / me.realFontSize_x, me.rowsPerItem - 3, me.emptyLineHeight);
+		rewrapCampaign(me.columnNameSize, me.rowsPerItem - 3, me.emptyLineHeight, me.realFontSize);
 	me.nItems = min(me.campaignIndex + 2, campaign_entries);
 	me.selectedItem = min(me.campaignIndex, me.nItems - 1);
 	me.scrollPos = me.nItems * me.itemHeight - 1;
@@ -222,7 +222,7 @@
 
 	me.checkMarkOrigin = eY + eX * (me.columnCheckMarkOrigin + me.columnCheckMarkSize) - me.checkMarkSize;
 
-	rewrapCampaign(me.columnNameSize / me.realFontSize_x, me.rowsPerItem - 3, me.emptyLineHeight);
+	rewrapCampaign(me.columnNameSize, me.rowsPerItem - 3, me.emptyLineHeight, me.realFontSize);
 }
 void clickListBoxItemNexuizCampaignList(entity me, float i, vector where)
 {
@@ -273,8 +273,8 @@
 		s = campaign_shortdesc[i]; // fteqcc sucks
 	else
 		s = "???";
-	s = draw_TextShortenToWidth(strcat("Level ", ftos(i + 1), ": ", s), me.columnNameSize / me.realFontSize_x, 0);
-	draw_Text(me.realUpperMargin1 * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0) * me.realFontSize_x)) * eX, s, me.realFontSize, theColor, theAlpha, 0);
+	s = draw_TextShortenToWidth(strcat("Level ", ftos(i + 1), ": ", s), me.columnNameSize, 0, me.realFontSize);
+	draw_Text(me.realUpperMargin1 * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, theColor, theAlpha, 0);
 
 	if(i <= me.campaignIndex)
 	{

Modified: trunk/data/qcsrc/menu/nexuiz/cvarlist.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/cvarlist.c	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/menu/nexuiz/cvarlist.c	2009-09-03 16:05:02 UTC (rev 7611)
@@ -143,9 +143,9 @@
 	else
 		theColor = SKINCOLOR_CVARLIST_CHANGED;
 
-	s = draw_TextShortenToWidth(k, me.columnNameSize / me.realFontSize_x, 0);
+	s = draw_TextShortenToWidth(k, me.columnNameSize, 0, me.realFontSize);
 	draw_Text(me.realUpperMargin * eY + me.columnNameOrigin * eX, s, me.realFontSize, theColor, theAlpha, 0);
-	s = draw_TextShortenToWidth(v, me.columnValueSize / me.realFontSize_x, 0);
+	s = draw_TextShortenToWidth(v, me.columnValueSize, 0, me.realFontSize);
 	draw_Text(me.realUpperMargin * eY + me.columnValueOrigin * eX, s, me.realFontSize, theColor, theAlpha, 0);
 }
 

Modified: trunk/data/qcsrc/menu/nexuiz/demolist.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/demolist.c	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/menu/nexuiz/demolist.c	2009-09-03 16:05:02 UTC (rev 7611)
@@ -99,8 +99,8 @@
     	draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
 		
     s = me.demoName(me,i);
-    s = draw_TextShortenToWidth(s, me.columnNameSize / me.realFontSize_x, 0);
-    draw_Text(me.realUpperMargin * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0) * me.realFontSize_x)) * eX, s, me.realFontSize, '1 1 1', SKINALPHA_TEXT, 0);		
+    s = draw_TextShortenToWidth(s, me.columnNameSize, 0, me.realFontSize);
+    draw_Text(me.realUpperMargin * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, '1 1 1', SKINALPHA_TEXT, 0);		
 }
 
 void showNotifyNexuizDemoList(entity me)

Modified: trunk/data/qcsrc/menu/nexuiz/keybinder.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/keybinder.c	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/menu/nexuiz/keybinder.c	2009-09-03 16:05:02 UTC (rev 7611)
@@ -312,7 +312,7 @@
 				s = strcat(s, keynumtostring(k));
 			}
 		}
-		s = draw_TextShortenToWidth(s, me.columnKeysSize / me.realFontSize_x, 0);
+		s = draw_TextShortenToWidth(s, me.columnKeysSize, 0, me.realFontSize);
 		draw_CenterText(me.realUpperMargin * eY + (me.columnKeysOrigin + 0.5 * me.columnKeysSize) * eX, s, me.realFontSize, theColor, theAlpha, 0);
 	}
 }

Modified: trunk/data/qcsrc/menu/nexuiz/maplist.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/maplist.c	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/menu/nexuiz/maplist.c	2009-09-03 16:05:02 UTC (rev 7611)
@@ -187,10 +187,10 @@
 	draw_Picture(me.columnPreviewOrigin * eX, strcat("/maps/", MapInfo_Map_bspname), me.columnPreviewSize * eX + eY, '1 1 1', theAlpha);
 	if(included)
 		draw_Picture(me.checkMarkOrigin, "checkmark", me.checkMarkSize, '1 1 1', 1);
-	s = draw_TextShortenToWidth(strcat(MapInfo_Map_bspname, ": ", MapInfo_Map_title), me.columnNameSize / me.realFontSize_x, 0);
-	draw_Text(me.realUpperMargin1 * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0) * me.realFontSize_x)) * eX, s, me.realFontSize, SKINCOLOR_MAPLIST_TITLE, theAlpha, 0);
-	s = draw_TextShortenToWidth(MapInfo_Map_author, me.columnNameSize / me.realFontSize_x, 0);
-	draw_Text(me.realUpperMargin2 * eY + (me.columnNameOrigin + 1.00 * (me.columnNameSize - draw_TextWidth(s, 0) * me.realFontSize_x)) * eX, s, me.realFontSize, SKINCOLOR_MAPLIST_AUTHOR, theAlpha, 0);
+	s = draw_TextShortenToWidth(strcat(MapInfo_Map_bspname, ": ", MapInfo_Map_title), me.columnNameSize, 0, me.realFontSize);
+	draw_Text(me.realUpperMargin1 * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, SKINCOLOR_MAPLIST_TITLE, theAlpha, 0);
+	s = draw_TextShortenToWidth(MapInfo_Map_author, me.columnNameSize, 0,  me.realFontSize);
+	draw_Text(me.realUpperMargin2 * eY + (me.columnNameOrigin + 1.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, SKINCOLOR_MAPLIST_AUTHOR, theAlpha, 0);
 
 	MapInfo_ClearTemps();
 }

Modified: trunk/data/qcsrc/menu/nexuiz/playerlist.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/playerlist.c	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/menu/nexuiz/playerlist.c	2009-09-03 16:05:02 UTC (rev 7611)
@@ -127,11 +127,11 @@
 			score = substring(score, 0, t);
 	}
 
-	s = draw_TextShortenToWidth(s, (me.columnNameSize / me.realFontSize_x), 1);
-	score = draw_TextShortenToWidth(score, me.columnScoreSize / me.realFontSize_x, 0);
+	s = draw_TextShortenToWidth(s, me.columnNameSize, 1, me.realFontSize);
+	score = draw_TextShortenToWidth(score, me.columnScoreSize, 0, me.realFontSize);
 
-	draw_Text(me.realUpperMargin2 * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 1) * me.realFontSize_x)) * eX, s, me.realFontSize, '1 1 1', 1, 1);
-	draw_Text(me.realUpperMargin2 * eY + (me.columnScoreOrigin + 1.00 * (me.columnScoreSize - draw_TextWidth(score, 1) * me.realFontSize_x)) * eX, score, me.realFontSize, rgb, 1, 0);
+	draw_Text(me.realUpperMargin2 * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 1, me.realFontSize))) * eX, s, me.realFontSize, '1 1 1', 1, 1);
+	draw_Text(me.realUpperMargin2 * eY + (me.columnScoreOrigin + 1.00 * (me.columnScoreSize - draw_TextWidth(score, 1, me.realFontSize))) * eX, score, me.realFontSize, rgb, 1, 0);
 }
 
 #endif

Modified: trunk/data/qcsrc/menu/nexuiz/serverlist.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/serverlist.c	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/menu/nexuiz/serverlist.c	2009-09-03 16:05:02 UTC (rev 7611)
@@ -557,21 +557,21 @@
 	}
 
 	s = ftos(p);
-	draw_Text(me.realUpperMargin * eY + (me.columnPingSize - draw_TextWidth(s, 0) * me.realFontSize_x) * eX, s, me.realFontSize, theColor, theAlpha, 0);
-	s = draw_TextShortenToWidth(gethostcachestring(SLIST_FIELD_NAME, i), me.columnNameSize / me.realFontSize_x, 0);
+	draw_Text(me.realUpperMargin * eY + (me.columnPingSize - draw_TextWidth(s, 0, me.realFontSize)) * eX, s, me.realFontSize, theColor, theAlpha, 0);
+	s = draw_TextShortenToWidth(gethostcachestring(SLIST_FIELD_NAME, i), me.columnNameSize, 0, me.realFontSize);
 	draw_Text(me.realUpperMargin * eY + me.columnNameOrigin * eX, s, me.realFontSize, theColor, theAlpha, 0);
-	s = draw_TextShortenToWidth(gethostcachestring(SLIST_FIELD_MAP, i), me.columnMapSize / me.realFontSize_x, 0);
-	draw_Text(me.realUpperMargin * eY + (me.columnMapOrigin + (me.columnMapSize - draw_TextWidth(s, 0) * me.realFontSize_x) * 0.5) * eX, s, me.realFontSize, theColor, theAlpha, 0);
+	s = draw_TextShortenToWidth(gethostcachestring(SLIST_FIELD_MAP, i), me.columnMapSize, 0, me.realFontSize);
+	draw_Text(me.realUpperMargin * eY + (me.columnMapOrigin + (me.columnMapSize - draw_TextWidth(s, 0, me.realFontSize)) * 0.5) * eX, s, me.realFontSize, theColor, theAlpha, 0);
 	s = gethostcachestring(SLIST_FIELD_QCSTATUS, i);
 	p = strstrofs(s, ":", 0);
 	if(p >= 0)
 		s = substring(s, 0, p);
 	else
 		s = "";
-	s = draw_TextShortenToWidth(s, me.columnMapSize / me.realFontSize_x, 0);
-	draw_Text(me.realUpperMargin * eY + (me.columnTypeOrigin + (me.columnTypeSize - draw_TextWidth(s, 0) * me.realFontSize_x) * 0.5) * eX, s, me.realFontSize, theColor, theAlpha, 0);
+	s = draw_TextShortenToWidth(s, me.columnMapSize, 0, me.realFontSize);
+	draw_Text(me.realUpperMargin * eY + (me.columnTypeOrigin + (me.columnTypeSize - draw_TextWidth(s, 0, me.realFontSize)) * 0.5) * eX, s, me.realFontSize, theColor, theAlpha, 0);
 	s = strcat(ftos(gethostcachenumber(SLIST_FIELD_NUMHUMANS, i)), "/", ftos(gethostcachenumber(SLIST_FIELD_MAXPLAYERS, i)));
-	draw_Text(me.realUpperMargin * eY + (me.columnPlayersOrigin + (me.columnPlayersSize - draw_TextWidth(s, 0) * me.realFontSize_x) * 0.5) * eX, s, me.realFontSize, theColor, theAlpha, 0);
+	draw_Text(me.realUpperMargin * eY + (me.columnPlayersOrigin + (me.columnPlayersSize - draw_TextWidth(s, 0, me.realFontSize)) * 0.5) * eX, s, me.realFontSize, theColor, theAlpha, 0);
 }
 
 float keyDownNexuizServerList(entity me, float scan, float ascii, float shift)

Modified: trunk/data/qcsrc/menu/nexuiz/skinlist.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/skinlist.c	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/menu/nexuiz/skinlist.c	2009-09-03 16:05:02 UTC (rev 7611)
@@ -160,12 +160,12 @@
 	
 	s = me.skinParameter(me, i, SKINPARM_NAME);
 	s = strcat(s, ": ", me.skinParameter(me, i, SKINPARM_TITLE));
-	s = draw_TextShortenToWidth(s, me.columnNameSize / me.realFontSize_x, 0);
-	draw_Text(me.realUpperMargin1 * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0) * me.realFontSize_x)) * eX, s, me.realFontSize, SKINCOLOR_SKINLIST_TITLE, SKINALPHA_TEXT, 0);
+	s = draw_TextShortenToWidth(s, me.columnNameSize, 0, me.realFontSize);
+	draw_Text(me.realUpperMargin1 * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, SKINCOLOR_SKINLIST_TITLE, SKINALPHA_TEXT, 0);
 
 	s = me.skinParameter(me, i, SKINPARM_AUTHOR);
-	s = draw_TextShortenToWidth(s, me.columnNameSize / me.realFontSize_x, 0);
-	draw_Text(me.realUpperMargin2 * eY + (me.columnNameOrigin + 1.00 * (me.columnNameSize - draw_TextWidth(s, 0) * me.realFontSize_x)) * eX, s, me.realFontSize, SKINCOLOR_SKINLIST_AUTHOR, SKINALPHA_TEXT, 0);
+	s = draw_TextShortenToWidth(s, me.columnNameSize, 0, me.realFontSize);
+	draw_Text(me.realUpperMargin2 * eY + (me.columnNameOrigin + 1.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, SKINCOLOR_SKINLIST_AUTHOR, SKINALPHA_TEXT, 0);
 }
 
 void setSkinNexuizSkinList(entity me)

Modified: trunk/data/qcsrc/menu/nexuiz/util.qc
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/util.qc	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/menu/nexuiz/util.qc	2009-09-03 16:05:02 UTC (rev 7611)
@@ -324,7 +324,7 @@
 	{
 		fs = ((1/draw_scale_x) * eX + (1/draw_scale_y) * eY) * 12;
 		line = eY * fs_y;
-		sz_x = draw_TextWidth("  http://www.nexuiz.com/  ", 0) * fs_x;
+		sz_x = draw_TextWidth("  http://www.nexuiz.com/  ", 0, fs);
 		sz_y = 3 * fs_y;
 
 		draw_alpha = sin(time * 0.112 - 0.3) * 0.7;

Modified: trunk/data/qcsrc/server/cl_player.qc
===================================================================
--- trunk/data/qcsrc/server/cl_player.qc	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/server/cl_player.qc	2009-09-03 16:05:02 UTC (rev 7611)
@@ -888,7 +888,7 @@
 		lines = 0;
 		while(getWrappedLine_remaining && (!flood_lmax || lines <= flood_lmax))
 		{
-			msgstr = strcat(msgstr, " ", getWrappedLine(82.4289758859709, strlennocol)); // perl averagewidth.pl < gfx/vera-sans.width
+			msgstr = strcat(msgstr, " ", getWrappedLineLen(82.4289758859709, strlennocol)); // perl averagewidth.pl < gfx/vera-sans.width
 			++lines;
 		}
 		msgstr = substring(msgstr, 1, strlen(msgstr) - 1);

Modified: trunk/data/qcsrc/server/constants.qh
===================================================================
--- trunk/data/qcsrc/server/constants.qh	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/qcsrc/server/constants.qh	2009-09-03 16:05:02 UTC (rev 7611)
@@ -1,5 +1,5 @@
-string CVAR_CHECK_DEFAULT = "ba4f55ed0f5a00a082bfb12c80dd3f8e";
-string CVAR_CHECK_WEAPONS = "d8c27ad261a5506934d70968b6a47244";
+string CVAR_CHECK_DEFAULT = "ee37fa837dd0730d3eef10e5a51a4a96";
+string CVAR_CHECK_WEAPONS = "8271730261e4587fe8af3ac306d38fd0";
 
 float	FALSE					= 0;
 float	TRUE					= 1;

Modified: trunk/data/weapons.cfg
===================================================================
--- trunk/data/weapons.cfg	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/weapons.cfg	2009-09-03 16:05:02 UTC (rev 7611)
@@ -3,7 +3,7 @@
 //
 // And... don't forget to edit weaponsHavoc.cfg too.
 
-set cvar_check_weapons d8c27ad261a5506934d70968b6a47244
+set cvar_check_weapons 8271730261e4587fe8af3ac306d38fd0
 
 // NOTE: this only replaces weapons on the map
 // use g_start_weapon_* to also replace the on-startup weapons!

Modified: trunk/data/weaponsHavoc.cfg
===================================================================
--- trunk/data/weaponsHavoc.cfg	2009-09-03 15:37:11 UTC (rev 7610)
+++ trunk/data/weaponsHavoc.cfg	2009-09-03 16:05:02 UTC (rev 7611)
@@ -1,4 +1,4 @@
-set cvar_check_weapons d8c27ad261a5506934d70968b6a47244
+set cvar_check_weapons 8271730261e4587fe8af3ac306d38fd0
 
 // NOTE: this only replaces weapons on the map
 // use g_start_weapon_* to also replace the on-startup weapons!



More information about the nexuiz-commits mailing list