[X2Go-Commits] [nx-libs] 09/219: Font.c: Loop over font paths

git-admin at x2go.org git-admin at x2go.org
Sat Sep 28 12:10:11 CEST 2019


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit 898f04e4293ce9cf7fcab810e8b27404cf0b6fde
Author: Ulrich Sibiller <uli42 at gmx.de>
Date:   Tue Apr 23 19:34:57 2019 +0200

    Font.c: Loop over font paths
    
    drop defines and use an array instead. This way adding further paths
    can be done much easier.
---
 nx-X11/programs/Xserver/hw/nxagent/Font.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c
index 6fb6c8f35..d5c9f8982 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Font.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c
@@ -71,10 +71,13 @@ is" without express or implied warranty.
 #undef  TEST
 #undef  DEBUG
 
-#define NXAGENT_DEFAULT_FONT_DIR      "/usr/share/nx/fonts"
-#define NXAGENT_ALTERNATE_FONT_DIR    "/usr/share/X11/fonts"
-#define NXAGENT_ALTERNATE_FONT_DIR_2  "/usr/share/fonts/X11"
-#define NXAGENT_ALTERNATE_FONT_DIR_3  "/usr/X11R6/lib/X11/fonts"
+const char * nxagentFontDirs[] = {
+  "/usr/share/nx/fonts",
+  "/usr/share/X11/fonts",
+  "/usr/share/fonts/X11",
+  "/usr/X11R6/lib/X11/fonts",
+  NULL
+};
 
 const char * nxagentFontSubdirs[] = {
   "Type1",
@@ -1491,10 +1494,15 @@ void nxagentVerifyDefaultFontPath(void)
     return;
   }
 
-  nxagentVerifySingleFontPath(&fontPath, NXAGENT_DEFAULT_FONT_DIR);
-  nxagentVerifySingleFontPath(&fontPath, NXAGENT_ALTERNATE_FONT_DIR);
-  nxagentVerifySingleFontPath(&fontPath, NXAGENT_ALTERNATE_FONT_DIR_2);
-  nxagentVerifySingleFontPath(&fontPath, NXAGENT_ALTERNATE_FONT_DIR_3);
+  for (int i = 0; ; i++)
+  {
+    char *dir = nxagentFontDirs[i];
+
+    if (dir == NULL)
+      break;
+    else
+      nxagentVerifySingleFontPath(&fontPath, dir);
+  }
 
   if (*fontPath == '\0') 
   {

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list