]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #40130 (TTF usage doesn't work properly under Netware).
authorScott MacVicar <scottmac@php.net>
Mon, 23 Apr 2007 15:17:47 +0000 (15:17 +0000)
committerScott MacVicar <scottmac@php.net>
Mon, 23 Apr 2007 15:17:47 +0000 (15:17 +0000)
ext/gd/libgd/gd.h
ext/gd/libgd/gdft.c

index 09accd78b3ba2c899f5dd8df4e020c4dd9109e00..98362f0e1e8cefd717109d5852ac8be0c2ab2ca3 100644 (file)
@@ -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.
index 5ddddcea5e9c9873ce6b533c6ce646da36e6a4fe..49a540c421b0c6ae4802fea1b7e0717b2edf8a3c 100644 (file)
@@ -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++;