From 4fad46e9cbc7f6a29a113bf064cf210743544caf Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 7 Oct 2010 18:46:08 +0100 Subject: Don't try so hard to find a matching font with the given encoding See http://sourceware.org/bugzilla/show_bug.cgi?id=10948 Currently, if the locale is UTF-8, no CJK fonts are installed, and someone does XCreateFontSet() with a font name of "*", we end up asking the server to list the (non-existent) fonts 11 times for each CJK encoding, which can take a while. A * wildcard can match multiple components in a XLFD name in XListFonts(), so there's no need to try adding more than one to get a match. We do try once with a leading '*-' in case the fontname isn't a full well-formed XLFD name, maybe even that isn't needed? (See also http://invisible-island.net/xterm/xterm.faq.html#slow_menus) Signed-off-by: Jon TURNEY Signed-off-by: Alan Coopersmith Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/omGeneric.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11') diff --git a/nx-X11/lib/X11/omGeneric.c b/nx-X11/lib/X11/omGeneric.c index 24d5a902e..89d1b2ffd 100644 --- a/nx-X11/lib/X11/omGeneric.c +++ b/nx-X11/lib/X11/omGeneric.c @@ -833,7 +833,7 @@ parse_omit_name( return True; /* This may mot be needed anymore as XListFonts() takes care of this */ - while (num_fields < 12) { + if (num_fields < 12) { if ((last - buf) > (XLFD_MAX_LEN - 2)) return -1; *last = '*'; -- cgit v1.2.3