This commit is contained in:
Ilia Alshanetsky 2003-01-06 00:47:40 +00:00
parent 7dae400063
commit b52eb8f14a
2 changed files with 7 additions and 2 deletions

View File

@ -7,11 +7,11 @@ extern "C" {
#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 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
/* default fontpath for windows systems */
#define DEFAULT_FONTPATH "c:\\winnt\\fonts"
#define DEFAULT_FONTPATH "c:\\winnt\\fonts;."
#define PATHSEPARATOR ";"
#endif

View File

@ -398,6 +398,11 @@ static void *fontFetch (char **error, void *key)
}
}
for (dir = strtok (path, PATHSEPARATOR); dir; dir = strtok (0, PATHSEPARATOR)) {
sprintf(fullname, "%s/%s", dir, name);
if (access (fullname, R_OK) == 0) {
font_found++;
break;
}
sprintf(fullname, "%s/%s.ttf", dir, name);
if (access (fullname, R_OK) == 0) {
font_found++;