Skip to content

Commit

Permalink
Port "merged and expanded settings from gd.h and gdft.c" (GH-17367)
Browse files Browse the repository at this point in the history
This commit[1] and the related part of the Netware removal[2] move the
related definitions out of gd.h, and bring some updates.

[1] <libgd/libgd@2a921c8>
[2] <libgd/libgd@e6bb110>
  • Loading branch information
cmb69 authored Jan 6, 2025
1 parent cc84d27 commit f5aa69a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
14 changes: 0 additions & 14 deletions ext/gd/libgd/gd.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,6 @@ extern "C" {
#define GD_EXTRA_VERSION ""
#define GD_VERSION_STRING "2.0.35"

#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.
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
Expand Down
22 changes: 16 additions & 6 deletions ext/gd/libgd/gdft.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,27 @@ gdImageStringFT (gdImage * im, int *brect, int fg, char *fontlist,
* some last resort values that might match some Un*x system
* if building this version of gd separate from graphviz.
*/

#ifndef DEFAULT_FONTPATH
#if defined(__APPLE__) || (defined(__MWERKS__) && defined(macintosh))
#define DEFAULT_FONTPATH "/usr/share/fonts/truetype:/System/Library/Fonts:/Library/Fonts"
#else
#define DEFAULT_FONTPATH "/usr/share/fonts/truetype"
#endif
# if defined(_WIN32)
# define DEFAULT_FONTPATH "C:\\WINDOWS\\FONTS;C:\\WINNT\\FONTS"
# elif defined(__APPLE__) || (defined(__MWERKS__) && defined(macintosh))
# define DEFAULT_FONTPATH "/usr/share/fonts/truetype:/System/Library/Fonts:/Library/Fonts"
# else
/* default fontpath for unix systems - whatever happened to standards ! */
# 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:/usr/lib/X11/fonts/Type1:/usr/openwin/lib/X11/fonts/Type1"
# endif
#endif

#ifndef PATHSEPARATOR
#define PATHSEPARATOR ":"
# if defined(_WIN32)
# define PATHSEPARATOR ";"
# else
# define PATHSEPARATOR ":"
# endif
#endif


#ifndef TRUE
#define FALSE 0
#define TRUE !FALSE
Expand Down

0 comments on commit f5aa69a

Please sign in to comment.