1 /**
2 * A most basic test for fontconfig support.
3 *
4 * Without actually using fontconfig, passing an empty fontlist to
5 * gdImageStringFT() would return an error ("Could not find/open font").
6 * We're checking that it returns NULL.
7 */
8
9
10 #include "gd.h"
11 #include "gdtest.h"
12
13
main()14 int main()
15 {
16 gdImagePtr im;
17 int black;
18 char *error;
19
20 im = gdImageCreate(100, 100);
21 gdTestAssert(im != NULL);
22 gdImageColorAllocate(im, 255, 255, 255);
23 black = gdImageColorAllocate(im, 0, 0, 0);
24
25 gdTestAssert(gdFTUseFontConfig(1));
26 error = gdImageStringFT(im, NULL, black, "", 14.0, 0.0, 10, 20, "foo");
27 gdTestAssertMsg(error == NULL, "%s", error);
28
29 gdImageDestroy(im);
30 gdFontCacheShutdown();
31
32 return gdNumFailures();
33 }
34