]> granicus.if.org Git - php/commitdiff
adding patch from http://www.coupin.net/gd-freetype/ which makes images anti aliased...
authorJames Cox <imajes@php.net>
Thu, 11 Jul 2002 04:36:22 +0000 (04:36 +0000)
committerJames Cox <imajes@php.net>
Thu, 11 Jul 2002 04:36:22 +0000 (04:36 +0000)
#this does actually work.

ext/gd/libgd/gdft.c

index f2937b45d73c48400f3ae590ac8455f422463c33..536b76672aea7e9cb441f2d162890ce70a027558 100644 (file)
@@ -509,12 +509,12 @@ tweenColorFetch (char **error, void *key)
             is incorporate our knowledge of the percentage of this
             pixel that is really "lit" by pushing the alpha value
             up toward transparency in edge regions. */
-         a->tweencolor = gdTrueColorAlpha (
+         a->tweencolor = gdAlphaBlend(bg, gdTrueColorAlpha (
                                             gdTrueColorGetRed (fg),
                                             gdTrueColorGetGreen (fg),
                                             gdTrueColorGetBlue (fg),
-                                       gdAlphaMax - ((gdAlphaMax - gdTrueColorGetAlpha (fg)) * pixel / NUMCOLORS)
-                       );
+                                            gdAlphaMax - ((gdAlphaMax - gdTrueColorGetAlpha (fg)) * pixel / NUMCOLORS))
+                                      );
        }
       else
        {
@@ -604,7 +604,7 @@ gdft_draw_bitmap (gdImage * im, int fg, FT_Bitmap bitmap, int pen_x, int pen_y)
                }
                                else    {
                  pixel = &im->pixels[y][x];
-             if (tc_key.pixel == NUMCOLORS)
+             if (tc_key.pixel == NUMCOLORS && gdTrueColorGetAlpha(fg) ==0)
                      *pixel = fg;
                                        else    {
                      tc_key.bgcolor = *pixel;