diff --git a/ext/gd/libgd/gd.h b/ext/gd/libgd/gd.h index 4cf70786353..b3a5045ac83 100644 --- a/ext/gd/libgd/gd.h +++ b/ext/gd/libgd/gd.h @@ -7,11 +7,11 @@ extern "C" { #ifndef WIN32 /* default fontpath for unix systems */ -#define DEFAULT_FONTPATH "/usr/X11R6/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/truetype:/usr/X11R6/lib/X11/fonts/TTF:/usr/share/fonts/TrueType:/usr/share/fonts/truetype:/usr/openwin/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/Type1" +#define DEFAULT_FONTPATH "/usr/X11R6/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/truetype:/usr/X11R6/lib/X11/fonts/TTF:/usr/share/fonts/TrueType:/usr/share/fonts/truetype:/usr/openwin/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/Type1:." #define PATHSEPARATOR ":" #else /* default fontpath for windows systems */ -#define DEFAULT_FONTPATH "c:\\winnt\\fonts" +#define DEFAULT_FONTPATH "c:\\winnt\\fonts;." #define PATHSEPARATOR ";" #endif diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c index 746613e438c..eb6832da0bf 100644 --- a/ext/gd/libgd/gdft.c +++ b/ext/gd/libgd/gdft.c @@ -398,6 +398,11 @@ static void *fontFetch (char **error, void *key) } } for (dir = strtok (path, PATHSEPARATOR); dir; dir = strtok (0, PATHSEPARATOR)) { + sprintf(fullname, "%s/%s", dir, name); + if (access (fullname, R_OK) == 0) { + font_found++; + break; + } sprintf(fullname, "%s/%s.ttf", dir, name); if (access (fullname, R_OK) == 0) { font_found++;