Check the right midpoint font
authornemo
Mon, 22 Feb 2010 05:50:29 +0000
changeset 2843 75f18393d70a
parent 2842 03d6a304a8e0
child 2844 cea15ef417ea
Check the right midpoint font
hedgewars/uStore.pas
--- 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;