aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nx-X11/programs/Xserver/dix/dixfonts.c4
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c47
-rw-r--r--nx-X11/programs/Xserver/include/dixfont.h5
3 files changed, 45 insertions, 11 deletions
diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c
index f7d047c2d..bbce105e3 100644
--- a/nx-X11/programs/Xserver/dix/dixfonts.c
+++ b/nx-X11/programs/Xserver/dix/dixfonts.c
@@ -1925,7 +1925,11 @@ InitFonts ()
{
patternCache = MakeFontPatternCache();
+#if defined(BUILTIN_FONTS) || defined(NXAGENT_SERVER)
+ BuiltinRegisterFpeFunctions();
+#else
register_fpe_functions();
+#endif
}
int
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c
index 294a5727d..b3d7cc9d7 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c
@@ -926,6 +926,9 @@ bail:
int
SetDefaultFontPath(char *path)
{
+ char *temp_path,
+ *start,
+ *end;
unsigned char *cp,
*pp,
*nump,
@@ -936,20 +939,41 @@ SetDefaultFontPath(char *path)
size = 0,
bad;
- /* get enough for string, plus values -- use up commas */
#ifdef NX_TRANS_SOCKET
- len = strlen(_NXGetFontPath(path)) + 1;
-#else
- len = strlen(path) + 1;
-#endif
+ path = (char *) _NXGetFontPath(path);
+#endif /* NX_TRANS_SOCKET */
+
+ start = path;
+
+ /* ensure temp_path contains "built-ins" */
+ while (1) {
+ start = strstr(start, "built-ins");
+ if (start == NULL)
+ break;
+ end = start + strlen("built-ins");
+ if ((start == path || start[-1] == ',') && (!*end || *end == ','))
+ break;
+ start = end;
+ }
+ if (!start) {
+ if (asprintf(&temp_path, "%s%sbuilt-ins", path, *path ? "," : "")
+ == -1)
+ temp_path = NULL;
+ }
+ else {
+ temp_path = strdup(path);
+ }
+ if (!temp_path)
+ return BadAlloc;
+
+ /* get enough for string, plus values -- use up commas */
+ len = strlen(temp_path) + 1;
nump = cp = newpath = (unsigned char *) ALLOCATE_LOCAL(len);
- if (!newpath)
+ if (!newpath) {
+ free(temp_path);
return BadAlloc;
-#ifdef NX_TRANS_SOCKET
- pp = (unsigned char *) _NXGetFontPath(path);
-#else
- pp = (unsigned char *) path;
-#endif
+ }
+ pp = (unsigned char *) temp_path;
cp++;
while (*pp) {
if (*pp == ',') {
@@ -968,6 +992,7 @@ SetDefaultFontPath(char *path)
err = SetFontPathElements(num, newpath, &bad, TRUE);
DEALLOCATE_LOCAL(newpath);
+ free(temp_path);
return err;
}
diff --git a/nx-X11/programs/Xserver/include/dixfont.h b/nx-X11/programs/Xserver/include/dixfont.h
index 6582be24c..1303d0e0f 100644
--- a/nx-X11/programs/Xserver/include/dixfont.h
+++ b/nx-X11/programs/Xserver/include/dixfont.h
@@ -150,4 +150,9 @@ extern void InitGlyphCaching(void);
extern void SetGlyphCachingMode(int /*newmode*/);
+/*
+ * libXfont/src/builtins/builtin.h
+ */
+extern _X_EXPORT void BuiltinRegisterFpeFunctions(void);
+
#endif /* DIXFONT_H */