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

index 226edd16a782454dc5b4df2de47ffa6da595160d..58ca9424c09eb01d32d7bdf6d0119da0050e41f3 100644 (file)
@@ -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.
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++;