- 论坛徽章:
- 0
|
使用
patch -p1 -i webalizer-2.01-10.zh_CN_utf8.patch
- diff -Nur webalizer-2.01-10/graphs.c webalizer-2.01-10.zh_CN_utf8/graphs.c
- --- webalizer-2.01-10/graphs.c 2001-06-15 16:34:24.000000000 +0800
- +++ webalizer-2.01-10.zh_CN_utf8/graphs.c 2006-11-22 16:00:31.000000000 +0800
- @@ -750,3 +750,14 @@
-
- return;
- }
- +
- +/*
- + * @follow functions is added by redor at Wed Nov 22 14:07:46 CST 2006
- + */
- + void gdImageString(gdImagePtr im, gdFontPtr font, int x, int y, unsigned char *s, int color){
- + gdImageStringFT(im, 0 , color, font_path, 9 , 0.0, x, y+9, s); //font size is 9
- + }
- +
- + void gdImageStringUp(gdImagePtr im, gdFontPtr font, int x, int y, unsigned char *s, int color){
- + gdImageStringFT(im, 0 , color, font_path, 9 , -PI/2, x, y-9 , s);
- + }
- +
- diff -Nur webalizer-2.01-10/sample.conf webalizer-2.01-10.zh_CN_utf8/sample.conf
- --- webalizer-2.01-10/sample.conf 2000-09-29 11:51:42.000000000 +0800
- +++ webalizer-2.01-10.zh_CN_utf8/sample.conf 2006-11-22 16:00:31.000000000 +0800
- @@ -153,6 +153,7 @@
- # is 80 characters, so use multiple lines if needed.
-
- #HTMLHead <META NAME="author" CONTENT="The Webalizer">
- +HTMLHead <meta http-equiv="content-type" content="text/html; charset=UTF-8">
-
- # HTMLBody defined the HTML code to be inserted, starting with the
- # <BODY> tag. If not specified, the default is shown below. If
- @@ -569,3 +570,5 @@
- #DumpSearchStr no
-
- # End of configuration file... Have a nice day!
- +
- +FontPath /usr/share/fonts/chinese/TrueType/ukai.ttf
- diff -Nur webalizer-2.01-10/webalizer.c webalizer-2.01-10.zh_CN_utf8/webalizer.c
- --- webalizer-2.01-10/webalizer.c 2002-04-17 06:11:31.000000000 +0800
- +++ webalizer-2.01-10.zh_CN_utf8/webalizer.c 2006-11-22 16:00:31.000000000 +0800
- @@ -166,6 +166,8 @@
- int dump_search = 0; /* Search strings */
- int dump_header = 0; /* Dump header as first rec */
- char *dump_path = NULL; /* Path for dump files */
- +char *font_path = "/usr/share/fonts/chinese/TrueType/ukai.ttf";
- + /*default font path */
-
- int cur_year=0, cur_month=0, /* year/month/day/hour */
- cur_day=0, cur_hour=0, /* tracking variables */
- @@ -1449,7 +1451,8 @@
- "DNSCache", /* DNS Cache file name 84 */
- "DNSChildren", /* DNS Children (0=no DNS) 85 */
- "DailyGraph", /* Daily Graph (0=no) 86 */
- - "DailyStats" /* Daily Stats (0=no) 87 */
- + "DailyStats", /* Daily Stats (0=no) 87 */
- + "FontPath" /* Font Path 88 */
- };
-
- FILE *fp;
- @@ -1593,6 +1596,7 @@
- #endif /* USE_DNS */
- case 86: daily_graph=(value[0]=='n')?0:1; break; /* HourlyGraph */
- case 87: daily_stats=(value[0]=='n')?0:1; break; /* HourlyStats */
- + case 88: font_path=save_opt(value); break; /* Font Path */
- }
- }
- fclose(fp);
- diff -Nur webalizer-2.01-10/webalizer.h webalizer-2.01-10.zh_CN_utf8/webalizer.h
- --- webalizer-2.01-10/webalizer.h 2001-02-10 08:58:18.000000000 +0800
- +++ webalizer-2.01-10.zh_CN_utf8/webalizer.h 2006-11-22 16:00:31.000000000 +0800
- @@ -219,6 +219,8 @@
- extern int dump_header ; /* Dump header as first rec */
- extern char *dump_path ; /* Path for dump files */
-
- +extern char *font_path ; /* Chinese font for gragh */
- +
- extern u_long cur_tstamp; /* Current timestamp */
- extern u_long epoch; /* used for timestamp adj. */
- extern int check_dup; /* check for dups flag */
复制代码 |
|