cvs: gd /libgd/tests/freetype bug00132.c bug00132_exp.png

From: Date: Fri, 18 Apr 2008 16:10:53 +0000
Subject: cvs: gd /libgd/tests/freetype bug00132.c bug00132_exp.png
Groups: php.gd.cvs 
Request: Send a blank email to php-gd-cvs+get-465@lists.php.net to get a copy of this message
pajoye Fri Apr 18 16:10:53 2008 UTC Modified files: /gd/libgd/tests/freetype bug00132.c bug00132_exp.png Log: - fix test, display the error msg if gdImageFt failed - don't use antialiasing, freetype can be built with various algorithms and it is nearly impossible to get a nice way to compare the results http://cvs.php.net/viewvc.cgi/gd/libgd/tests/freetype/bug00132.c?r1=1.4&r2=1.5&diff_format=u Index: gd/libgd/tests/freetype/bug00132.c diff -u gd/libgd/tests/freetype/bug00132.c:1.4 gd/libgd/tests/freetype/bug00132.c:1.5 --- gd/libgd/tests/freetype/bug00132.c:1.4 Fri Apr 18 14:32:09 2008 +++ gd/libgd/tests/freetype/bug00132.c Fri Apr 18 16:10:53 2008 @@ -1,4 +1,4 @@ -/* $Id: bug00132.c,v 1.4 2008/04/18 14:32:09 pajoye Exp $ */ +/* $Id: bug00132.c,v 1.5 2008/04/18 16:10:53 pajoye Exp $ */ #include "gd.h" #include <stdio.h> @@ -12,6 +12,7 @@ int error = 0; char path[2048]; const char *file_exp = "bug00132_exp.png"; + char *ret = NULL; im = gdImageCreateTrueColor(50, 30); @@ -24,16 +25,18 @@ gdImageFilledRectangle(im, 0, 0, 200, 200, gdTrueColorAlpha(0, 0, 0, 127)); sprintf(path, "%s/freetype/DejaVuSans.ttf", GDTEST_TOP_DIR); - gdImageStringFT(im, NULL, 0xFFFFFF, path, 14.0, 0.0, 20, 20, "AAA&thetasym; &theta;"); - sprintf(path, "%s/freetype/%s", GDTEST_TOP_DIR, file_exp); - if (!gdAssertImageEqualsToFile(path, im)) { + ret = gdImageStringFT(im, NULL, - 0xFFFFFF, path, 14.0, 0.0, 10, 20, "&thetasym; &theta;"); + if (ret) { error = 1; - printf("Reference image and destination differ\n"); + printf(ret); } else { - + sprintf(path, "%s/freetype/%s", GDTEST_TOP_DIR, file_exp); + if (!gdAssertImageEqualsToFile(path, im)) { + error = 1; + printf("Reference image and destination differ\n"); + } } - gdImageDestroy(im); return error; } http://cvs.php.net/viewvc.cgi/gd/libgd/tests/freetype/bug00132_exp.png?r1=1.1&r2=1.2&diff_format=u Index: gd/libgd/tests/freetype/bug00132_exp.png

« previous php.gd.cvs (#465) next »