From fef929f04437203c98e99e90b0a3c7bf5a6d0c07 Mon Sep 17 00:00:00 2001 From: Scott MacVicar Date: Mon, 23 Apr 2007 15:06:13 +0000 Subject: [PATCH] Fixed bug #40130 (TTF usage doesn't work properly under Netware) --- ext/gd/libgd/gd.h | 14 +++++++++----- ext/gd/libgd/gdft.c | 4 ++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ext/gd/libgd/gd.h b/ext/gd/libgd/gd.h index 226edd16a7..58ca9424c0 100644 --- a/ext/gd/libgd/gd.h +++ b/ext/gd/libgd/gd.h @@ -7,14 +7,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 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++; -- 2.50.1