XT_FONTPATH has to be a valid font path.

Also trim at least one remote path from XT_FONTPATH_GOOD, so it
isn't the same as XT_FONTPATH.

Signed-off-by: Peter Harris <phar...@opentext.com>
---

This works well in my setup. Is anyone relying on xtest font directories
being
in the same location on separate machines?

 xts5/bin/xts-config.in |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/xts5/bin/xts-config.in b/xts5/bin/xts-config.in
index 3d10c13..9e30b5f 100755
--- a/xts5/bin/xts-config.in
+++ b/xts5/bin/xts-config.in
@@ -97,6 +97,24 @@ BEGIN
                        $::vars{"XT_DISPLAYHOST"} = "";
                }
        }
+       else
+       {
+               # Not a local display; admin is responsible for placing
+               # xtest fonts on the font path before running xts-config.
+               $::vars{"XT_FONTPATH"} = $::vars{"XT_FONTPATH_GOOD"};
+               my @fp = split(/,/, $::vars{"XT_FONTPATH"});
+
+               # Remove xtest directory
+               my @fpg = grep(!/xtest/i, @fp);
+
+               # If xtest directory is not called "xtest", remove the
+               # last directory in the path (as it's less likely to
+               # be the path containing "default"/"cursor" than the
+               # first directory in the path).
+               pop @fpg if (scalar(@fp) == scalar(@fpg));
+
+               $::vars{"XT_FONTPATH_GOOD"} = join(',', @fpg);
+       }
        if($::vars{"XT_SCREEN_COUNT"} > 1)
        {
-- 
1.7.2.5

.

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to