Commit 898f04e4 authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

Font.c: Loop over font paths

drop defines and use an array instead. This way adding further paths can be done much easier.
parent dfb5602a
...@@ -71,10 +71,13 @@ is" without express or implied warranty. ...@@ -71,10 +71,13 @@ is" without express or implied warranty.
#undef TEST #undef TEST
#undef DEBUG #undef DEBUG
#define NXAGENT_DEFAULT_FONT_DIR "/usr/share/nx/fonts" const char * nxagentFontDirs[] = {
#define NXAGENT_ALTERNATE_FONT_DIR "/usr/share/X11/fonts" "/usr/share/nx/fonts",
#define NXAGENT_ALTERNATE_FONT_DIR_2 "/usr/share/fonts/X11" "/usr/share/X11/fonts",
#define NXAGENT_ALTERNATE_FONT_DIR_3 "/usr/X11R6/lib/X11/fonts" "/usr/share/fonts/X11",
"/usr/X11R6/lib/X11/fonts",
NULL
};
const char * nxagentFontSubdirs[] = { const char * nxagentFontSubdirs[] = {
"Type1", "Type1",
...@@ -1491,10 +1494,15 @@ void nxagentVerifyDefaultFontPath(void) ...@@ -1491,10 +1494,15 @@ void nxagentVerifyDefaultFontPath(void)
return; return;
} }
nxagentVerifySingleFontPath(&fontPath, NXAGENT_DEFAULT_FONT_DIR); for (int i = 0; ; i++)
nxagentVerifySingleFontPath(&fontPath, NXAGENT_ALTERNATE_FONT_DIR); {
nxagentVerifySingleFontPath(&fontPath, NXAGENT_ALTERNATE_FONT_DIR_2); char *dir = nxagentFontDirs[i];
nxagentVerifySingleFontPath(&fontPath, NXAGENT_ALTERNATE_FONT_DIR_3);
if (dir == NULL)
break;
else
nxagentVerifySingleFontPath(&fontPath, dir);
}
if (*fontPath == '\0') if (*fontPath == '\0')
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment