- 论坛徽章:
- 0
|
用webalizer分析web日志
原帖由 "sandaitanke" 发表:
我没有试验过,以下文字是我看webalizer2.01-10 GD 1.8.4 php 4.1.2
SourceCode 得出的结论,如果不正确,请指正。
首先要编译你的gd 支持TTF gdtestttf 可以测试。
然后应该是把webalizer中 pie_chart 等输出..........
我将graphs.c的最后几行修改了一下:
/*****************************************************************/
/* */
/* INIT_GRAPH - initalize graph and draw borders */
/* */
/*****************************************************************/
void init_graph(char *title, int xsize, int ysize)
{
int i;
im = gdImageCreate(xsize,ysize);
/* allocate color maps, background color first (grey) */
grey = gdImageColorAllocate(im, 192, 192, 192);
dkgrey = gdImageColorAllocate(im, 128, 128, 12;
black = gdImageColorAllocate(im, 0, 0, 0);
white = gdImageColorAllocate(im, 255, 255, 255);
green = gdImageColorAllocate(im, 0, 128, 92);
orange = gdImageColorAllocate(im, 255, 128, 0);
blue = gdImageColorAllocate(im, 0, 0, 255);
red = gdImageColorAllocate(im, 255, 0, 0);
cyan = gdImageColorAllocate(im, 0, 192, 255);
yellow = gdImageColorAllocate(im, 255, 255, 0);
char *myfont = " /usr/X11R6/lib/X11/fonts/Type1/simsun.ttf";
/* make borders */
for (i=0; i<5 ;i++) /* do shadow effect */
{
gdImageLine(im, i, i, xsize-i, i, white);
gdImageLine(im, i, i, i, ysize-i, white);
gdImageLine(im, i, ysize-i-1, xsize-i-1, ysize-i-1, dkgrey);
gdImageLine(im, xsize-i-1, i, xsize-i-1, ysize-i-1, dkgrey);
}
gdImageRectangle(im, 20, 25, xsize-21, ysize-21, black);
gdImageRectangle(im, 19, 24, xsize-22, ysize-22, white);
gdImageRectangle(im, 0, 0, xsize-1, ysize-1, black);
/* display the graph title */
gdImageStringFT(im,0,blue,myfont,12,0.0,20,20,"锘縲ww.sdcczz.net璁块棶璁板綍"
/* gdImageString(im, gdFontMediumBold, 20, 8, "title", blue); */
可以输出中文的图片.
readhat 8.0 gd2.0.11
就看那位大写一段程序,将*title这个字符串变成UTF-8的编码....... |
|