--- gdft_orig.c	2004-11-02 16:00:48.000000000 -0500
+++ gdft.c	2005-05-06 10:47:55.000000000 -0400
@@ -109,10 +109,12 @@
 #include FT_FREETYPE_H
 #include FT_GLYPH_H
 #include FT_SIZES_H
+#include FT_STROKER_H
 #else
 #include <freetype/freetype.h>
 #include <freetype/ftglyph.h>
 #include <freetype/ftsizes.h>
+#include <freetype/ftstroker.h>
 #endif
 
 /* number of fonts cached before least recently used is replaced */
@@ -1285,6 +1287,49 @@
           /* load and transform glyph image */
           FT_Get_Glyph (slot, &image);
 
+          /* Draw an outline for the character if requested 
+             and if we have a valid outline color to draw with. */
+          if (strex && 
+              (strex->flags & gdFTEX_DRAWOUTLINE) == gdFTEX_DRAWOUTLINE && 
+              (im && (im->trueColor || (strex->outlinecolor <= 255 && 
+                                        strex->outlinecolor >= -255))))
+            {
+              FT_Glyph borderimg;
+              FT_Stroker stroker;
+
+              /* Copy the image to work the outline */
+              FT_Glyph_Copy(image, &borderimg);
+
+              /* Extract the character stroker */
+              FT_Stroker_New (face->memory, &stroker);
+              FT_Stroker_Set (stroker,
+                              80,
+                              FT_STROKER_LINECAP_ROUND,
+                              FT_STROKER_LINEJOIN_ROUND,
+                              1);
+              FT_Glyph_Stroke (&borderimg, stroker, 1);
+
+              /* Draw the stroker on the image */
+              if (borderimg->format != ft_glyph_format_bitmap)
+              {
+                  err = FT_Glyph_To_Bitmap (&borderimg, ft_render_mode_normal, 0, 1);
+                  if (err)
+                  {
+                      gdCacheDelete (tc_cache);
+                      gdMutexUnlock (gdFontCacheMutex);
+                      return "Problem rendering glyph";
+                  }
+              }
+              bm = (FT_BitmapGlyph) borderimg;
+
+              /* Draw the actual character outline */
+              gdft_draw_bitmap (tc_cache, im, strex->outlinecolor, bm->bitmap,
+                                x + (penf.x * cos_a + penf.y * sin_a)*hdpi/(METRIC_RES*64) + bm->left,
+                                y - (penf.x * sin_a - penf.y * cos_a)*vdpi/(METRIC_RES*64) - bm->top);
+
+              FT_Done_Glyph (borderimg);
+            }
+
 	  if (image->format != ft_glyph_format_bitmap)
 	    {
 	      err = FT_Glyph_To_Bitmap (&image, ft_render_mode_normal, 0, 1);

