From: Scott MacVicar Date: Mon, 23 Apr 2007 15:17:47 +0000 (+0000) Subject: MFH: Fixed bug #40130 (TTF usage doesn't work properly under Netware). X-Git-Tag: php-5.2.2RC2~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=65408b1520838da87822d2d472fad7aa479d2d29;p=php MFH: Fixed bug #40130 (TTF usage doesn't work properly under Netware). --- diff --git a/ext/gd/libgd/gd.h b/ext/gd/libgd/gd.h index 09accd78b3..98362f0e1e 100644 --- a/ext/gd/libgd/gd.h +++ b/ext/gd/libgd/gd.h @@ -11,14 +11,18 @@ extern "C" { #include "php_compat.h" -#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 PATHSEPARATOR ":" -#else +#ifdef NETWARE +/* default fontpath for netware systems */ +#define DEFAULT_FONTPATH "sys:/java/nwgfx/lib/x11/fonts/ttf;." +#define PATHSEPARATOR ";" +#elif defined(WIN32) /* default fontpath for windows systems */ #define DEFAULT_FONTPATH "c:\\winnt\\fonts;c:\\windows\\fonts;." #define PATHSEPARATOR ";" +#else +/* 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 PATHSEPARATOR ":" #endif /* gd.h: declarations file for the graphic-draw module. diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c index 5ddddcea5e..49a540c421 100644 --- a/ext/gd/libgd/gdft.c +++ b/ext/gd/libgd/gdft.c @@ -377,7 +377,11 @@ static void *fontFetch (char **error, void *key) path = gdEstrdup (fontsearchpath); /* if name is an absolute filename then test directly */ +#ifdef NETWARE + if (*name == '/' || (name[0] != 0 && strstr(name, ":/"))) { +#else if (*name == '/' || (name[0] != 0 && name[1] == ':' && (name[2] == '/' || name[2] == '\\'))) { +#endif snprintf(fullname, sizeof(fullname) - 1, "%s", name); if (access(fullname, R_OK) == 0) { font_found++;