6#define DEG2RAD(x) ((x)*PI/180.)
8#define MAX(x,y) ((x) > (y) ? (x) : (y))
9#define MIN(x,y) ((x) < (y) ? (x) : (y))
11#define MAX4(x,y,z,w) \
12 ((MAX((x),(y))) > (MAX((z),(w))) ? (MAX((x),(y))) : (MAX((z),(w))))
13#define MIN4(x,y,z,w) \
14 ((MIN((x),(y))) < (MIN((z),(w))) ? (MIN((x),(y))) : (MIN((z),(w))))
16#define MAXX(x) MAX4(x[0],x[2],x[4],x[6])
17#define MINX(x) MIN4(x[0],x[2],x[4],x[6])
18#define MAXY(x) MAX4(x[1],x[3],x[5],x[7])
19#define MINY(x) MIN4(x[1],x[3],x[5],x[7])
22main (
int argc,
char *argv[])
24#ifndef HAVE_LIBFREETYPE
25 fprintf (stderr,
"gd was not compiled with HAVE_LIBFREETYPE defined.\n");
26 fprintf (stderr,
"Install the FreeType library, including the\n");
27 fprintf (stderr,
"header files. Then edit the gd Makefile, type\n");
28 fprintf (stderr,
"make clean, and type make again.\n");
39 char *
s =
"Hello. こんにちは Qyjpqg,";
41 char *
s =
"Hello. Qyjpqg,";
53 char *f =
"/usr/openwin/lib/locale/ja/X11/fonts/TT/HG-MinchoL.ttf";
84 x = 0 -
MINX (brect) + 3;
85 y = 0 -
MINY (brect) + 3;
94 out =
fopen (
"test/fttest.png",
"wb");
97 fprintf (stderr,
"Can't create test/fttest.png\n");
102 fprintf (stderr,
"Test image written to test/fttest.png\n");
fprintf($stream, string $format, mixed ... $values)
fopen(string $filename, string $mode, bool $use_include_path=false, $context=null)
void gdImagePng(gdImagePtr im, FILE *out)
char * gdImageStringFT(gdImage *im, int *brect, int fg, char *fontlist, double ptsize, double angle, int x, int y, char *string)
gdImagePtr gdImageCreate(int sx, int sy)
void gdImageFilledRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color)
void gdImageDestroy(gdImagePtr im)
int gdImageColorResolve(gdImagePtr im, int r, int g, int b)
gdImagePtr gdImageCreateTrueColor(int sx, int sy)
exit(string|int $status=0)