Allow CJK override for zh_CN/zh_TW/ja
authornemo
Sun, 24 May 2009 13:01:39 +0000
changeset 2105 580f7610d661
parent 2104 b2c50a7480ea
child 2106 be9b5b868dbf
Allow CJK override for zh_CN/zh_TW/ja
hedgewars/hwengine.dpr
hedgewars/uConsts.pas
share/hedgewars/Data/Fonts/CMakeLists.txt
share/hedgewars/Data/Fonts/DroidSansFallback.ttf
--- a/hedgewars/hwengine.dpr	Sun May 24 13:01:33 2009 +0000
+++ b/hedgewars/hwengine.dpr	Sun May 24 13:01:39 2009 +0000
@@ -416,6 +416,10 @@
 begin
 WriteLnToConsole('Hedgewars ' + cVersionString + ' engine');
 GetParams;
+// hack in font with support for CJK
+if (cLocaleFName = 'zh_CN.txt') or (cLocaleFName = 'zh_TW.txt') or (cLocaleFName = 'ja.txt') then
+    Fontz:= FontzCJK;
+
 Randomize;
 
 if GameType = gmtLandPreview then GenLandPreview
--- a/hedgewars/uConsts.pas	Sun May 24 13:01:33 2009 +0000
+++ b/hedgewars/uConsts.pas	Sun May 24 13:01:39 2009 +0000
@@ -113,7 +113,7 @@
 			Handle: PTTF_Font;
 			Height: LongInt;
 			style: LongInt;
-			Name: string[19];
+			Name: string[21];
 			end;
 
 	PAmmo = ^TAmmo;
@@ -297,6 +297,21 @@
 			Name: 'DejaVuSans-Bold.ttf')
 			);
 
+	FontzCJK: array[THWFont] of THHFont = (
+			(Handle: nil;
+			Height: 12;
+			style: TTF_STYLE_NORMAL;
+			Name: 'DroidSansFallback.ttf'),
+			(Handle: nil;
+			Height: 24;
+			style: TTF_STYLE_NORMAL;
+			Name: 'DroidSansFallback.ttf'),
+			(Handle: nil;
+			Height: 10;
+			style: TTF_STYLE_NORMAL;
+			Name: 'DroidSansFallback.ttf')
+			);
+
 	FontBorder = 2;
 
 	PathPrefix: string = './';
--- a/share/hedgewars/Data/Fonts/CMakeLists.txt	Sun May 24 13:01:33 2009 +0000
+++ b/share/hedgewars/Data/Fonts/CMakeLists.txt	Sun May 24 13:01:39 2009 +0000
@@ -1,3 +1,4 @@
 install(FILES
 	DejaVuSans-Bold.ttf
+	DroidSansFallback.ttf
 	DESTINATION ${SHAREPATH}Data/Fonts)
Binary file share/hedgewars/Data/Fonts/DroidSansFallback.ttf has changed