1 From c6753b750d76564bee02b317d10a496d0ced4274 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?R=C3=A9mi=20Cardona?= <remi@gentoo.org>
3 Date: Fri, 4 Sep 2009 23:05:29 +0200
4 Subject: [PATCH] dix: append "built-ins" to the font path in SetDefaultFontPath
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 49b93df8a3002db7196aa3fc1fd8dca1c12a55d6 made the hard dependency on
10 a "fixed" font go away but only Xorg could use the built-ins fonts by
13 With this commit, all DDXs get "built-ins" appended to their FontPath, not
16 Tested with Xorg, Xvfb and Xnest.
18 Signed-off-by: Rémi Cardona <remi@gentoo.org>
20 dix/dixfonts.c | 20 ++++++++++++++++++--
21 hw/xfree86/common/xf86Config.c | 16 ----------------
22 2 files changed, 18 insertions(+), 18 deletions(-)
24 diff --git a/dix/dixfonts.c b/dix/dixfonts.c
25 index 719bca4..4d69025 100644
28 @@ -1818,6 +1818,9 @@ SetDefaultFontPath(char *path)
38 @@ -1825,12 +1828,24 @@ SetDefaultFontPath(char *path)
42 + /* ensure temp_path contains "built-ins" */
43 + start = strstr(path, "built-ins");
44 + end = start + strlen("built-ins");
45 + if (start == NULL ||
46 + !((start == path || start[-1] == ',') && (!*end || *end == ','))) {
47 + temp_path = Xprintf("%s%sbuilt-ins", path, *path ? "," : "");
49 + temp_path = Xstrdup(path);
54 /* get enough for string, plus values -- use up commas */
55 - len = strlen(path) + 1;
56 + len = strlen(temp_path) + 1;
57 nump = cp = newpath = (unsigned char *) xalloc(len);
60 - pp = (unsigned char *) path;
61 + pp = (unsigned char *) temp_path;
65 @@ -1849,6 +1864,7 @@ SetDefaultFontPath(char *path)
66 err = SetFontPathElements(num, newpath, &bad, TRUE);
73 diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
74 index 9376119..ddf4745 100644
75 --- a/hw/xfree86/common/xf86Config.c
76 +++ b/hw/xfree86/common/xf86Config.c
77 @@ -612,22 +612,6 @@ configFiles(XF86ConfFilesPtr fileconf)
79 temp_path = defaultFontPath ? defaultFontPath : "";
81 - /* ensure defaultFontPath contains "built-ins" */
82 - start = strstr(temp_path, "built-ins");
83 - end = start + strlen("built-ins");
84 - if (start == NULL ||
85 - !((start == temp_path || start[-1] == ',') && (!*end || *end == ','))) {
86 - defaultFontPath = Xprintf("%s%sbuilt-ins",
87 - temp_path, *temp_path ? "," : "");
88 - if (must_copy == TRUE) {
89 - if (defaultFontPath != NULL) {
93 - /* already made a copy of the font path */
97 /* xf86ValidateFontPath modifies its argument, but returns a copy of it. */
98 temp_path = must_copy ? XNFstrdup(defaultFontPath) : defaultFontPath;
99 defaultFontPath = xf86ValidateFontPath(temp_path);