hedgewars/uStore.pas
changeset 2843 75f18393d70a
parent 2841 2c9013664ea3
child 2844 cea15ef417ea
--- a/hedgewars/uStore.pas	Mon Feb 22 05:41:25 2010 +0000
+++ b/hedgewars/uStore.pas	Mon Feb 22 05:50:29 2010 +0000
@@ -807,7 +807,7 @@
     u: WideChar;
     tmpstr: array[0..256] of WideChar;
 begin
-if font >= CJKfntSmall then exit(font);
+if (font >= CJKfnt16) or (length(s) = 0)  then exit(font);
 
 l:= Utf8ToUnicode(@tmpstr, Str2PChar(s), length(s))-1;
 i:= 0;
@@ -1360,15 +1360,15 @@
 	wa, ha: LongInt;
 	tmpline, tmpline2, tmpdesc: shortstring;
 begin
+// make sure there is a caption as well as a sub caption - description is optional
+if caption = '' then caption:= '???';
+if subcaption = '' then subcaption:= ' ';
+
 font:= CheckCJKFont(caption,fnt16);
 font:= CheckCJKFont(subcaption,font);
 font:= CheckCJKFont(description,font);
 font:= CheckCJKFont(extra,font);
 
-// make sure there is a caption as well as a sub caption - description is optional
-if caption = '' then caption:= '???';
-if subcaption = '' then subcaption:= ' ';
-
 w:= 0;
 h:= 0;
 wa:= FontBorder * 2 + 4;