hedgewars/uStore.pas
changeset 2843 75f18393d70a
parent 2841 2c9013664ea3
child 2844 cea15ef417ea
equal deleted inserted replaced
2842:03d6a304a8e0 2843:75f18393d70a
   805 function CheckCJKFont(s: string; font: THWFont): THWFont;
   805 function CheckCJKFont(s: string; font: THWFont): THWFont;
   806 var l, i : LongInt;
   806 var l, i : LongInt;
   807     u: WideChar;
   807     u: WideChar;
   808     tmpstr: array[0..256] of WideChar;
   808     tmpstr: array[0..256] of WideChar;
   809 begin
   809 begin
   810 if font >= CJKfntSmall then exit(font);
   810 if (font >= CJKfnt16) or (length(s) = 0)  then exit(font);
   811 
   811 
   812 l:= Utf8ToUnicode(@tmpstr, Str2PChar(s), length(s))-1;
   812 l:= Utf8ToUnicode(@tmpstr, Str2PChar(s), length(s))-1;
   813 i:= 0;
   813 i:= 0;
   814 while i < l do
   814 while i < l do
   815     begin
   815     begin
  1358 	font: THWFont;
  1358 	font: THWFont;
  1359 	r, r2: TSDL_Rect;
  1359 	r, r2: TSDL_Rect;
  1360 	wa, ha: LongInt;
  1360 	wa, ha: LongInt;
  1361 	tmpline, tmpline2, tmpdesc: shortstring;
  1361 	tmpline, tmpline2, tmpdesc: shortstring;
  1362 begin
  1362 begin
       
  1363 // make sure there is a caption as well as a sub caption - description is optional
       
  1364 if caption = '' then caption:= '???';
       
  1365 if subcaption = '' then subcaption:= ' ';
       
  1366 
  1363 font:= CheckCJKFont(caption,fnt16);
  1367 font:= CheckCJKFont(caption,fnt16);
  1364 font:= CheckCJKFont(subcaption,font);
  1368 font:= CheckCJKFont(subcaption,font);
  1365 font:= CheckCJKFont(description,font);
  1369 font:= CheckCJKFont(description,font);
  1366 font:= CheckCJKFont(extra,font);
  1370 font:= CheckCJKFont(extra,font);
  1367 
       
  1368 // make sure there is a caption as well as a sub caption - description is optional
       
  1369 if caption = '' then caption:= '???';
       
  1370 if subcaption = '' then subcaption:= ' ';
       
  1371 
  1371 
  1372 w:= 0;
  1372 w:= 0;
  1373 h:= 0;
  1373 h:= 0;
  1374 wa:= FontBorder * 2 + 4;
  1374 wa:= FontBorder * 2 + 4;
  1375 ha:= FontBorder * 2;
  1375 ha:= FontBorder * 2;