|
Bugzilla – Full Text Bug Listing |
| Summary: | icewm fonts not displayed | ||
|---|---|---|---|
| Product: | [openSUSE] SUSE LINUX 10.0 | Reporter: | Jan Engelhardt <jengelh> |
| Component: | X.Org | Assignee: | Mike Fabian <mfabian> |
| Status: | VERIFIED FIXED | QA Contact: | Stefan Dirsch <sndirsch> |
| Severity: | Enhancement | ||
| Priority: | P5 - None | ||
| Version: | RC 3 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Found By: | Beta-Customer | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
|
Description
Jan Engelhardt
2005-08-05 09:46:45 UTC
rpm -qa '*font*'
doesn't tell you much because not all font packages have "font" in
their name. Usually we try use the same name for a package as the
project is called upstream.
To list all fonts you have installed, 'fc-list' works well.
For example:
mfabian@magellan:~$ fc-list : family style file
/usr/X11R6/lib/X11/fonts/truetype/FZKaiTiB.ttf: FZKaiTiB,方正楷體:style=Regular
/usr/X11R6/lib/X11/fonts/misc/lt1-16i-etl.pcf.gz: ETL fixed:style=Italic
/usr/X11R6/lib/X11/fonts/75dpi/luIS08-ISO8859-1.pcf.gz: B&H Lucida:style=Sans Italic
/usr/X11R6/lib/X11/fonts/75dpi/luIS10-ISO8859-1.pcf.gz: B&H Lucida:style=Sans Italic
/usr/X11R6/lib/X11/fonts/test/garaci__.ttf: GaramondCondensed:style=Italic
/usr/X11R6/lib/X11/fonts/truetype/luxirri.ttf: Luxi Serif:style=Oblique
/usr/X11R6/lib/X11/fonts/100dpi/helvB18.pcf.gz: Adobe Helvetica:style=Bold
/usr/X11R6/lib/X11/fonts/75dpi/charB24.pcf.gz: Bitstream Charter:style=Bold
/usr/X11R6/lib/X11/fonts/truetype/sappm___.ttf: Sappy Mugs:style=Regular
/usr/X11R6/lib/X11/fonts/75dpi/ncenR24.pcf.gz: Adobe New Century Schoolbook:style=Regular
[...]
icewm usually takes some default font if it cannot find the one given in the theme. And if no font is given at all, some default also jumps in. Even if I explicitly name a font as "use this one", it does not work. Because it also does not work on some 9.0, where there is just the suse plain icewm and no personal configuration, I ask, where may the error be? I'll post "the testcase" soon. http://jengelh.hopto.org/ic_0805.iso (vmware usage advised) - hit enter to start X when it asks you or login as "linux" and run startx. I just tried icewm on a default 9.3 installation where I only added the icewm packages and it works just fine. That means you must have screwed up your system somehow. >That means you must have screwed up your system somehow.
Yes, and that's why I ask you if you know something. After all, the iso is
created from init_buildsystem, so it's 100% fresh.
We cannot help you if you use a very strange stripped down system and supply no useful information to track down the problem. I have no vmware and will not install this just to debug the problems in your .iso. If what you describe is really a bug in icewm, which I doubt, then you have to prove it by giving a lot more details. We cannot waste time to debug the problems you created yourself. → closing as WORKSFORME. So, I eventually figured it out: Xnest :77 & export LANG=""; DISPLAY=:77 icewm; (You can use your normal X server, but Xnest is easier to play with.) Then... unset LANG; # this effectively sets it back to "POSIX" DISPLAY=:77 icewm; It works just fine for me with LANG=en_US.UTF-8 (or de_DE.UTF-8, ja_JP.UTF-8). In Xnest as well as with a normal X-server. That means I still cannot reproduce your bug. Something is severely broken on your system. If you broke it yourself, you should find out. If you still think there is a bug somewhere, you need to explain in detail how to reproduce it. → WORKSFORME. I said LANG="", not en_US.UTF-8. As for the livecd, it somehow got fixed by itself, or I do not remember what I did. The rest of the problem using LANG="" is my own problem, so this finally can get... WORKSFORME ;) Apparently fontconfig doesn't match any useful fonts when using LANG="". Look at this: mfabian@magellan:~$ locale LANG=ja_JP.UTF-8 LC_CTYPE="ja_JP.UTF-8" LC_NUMERIC="ja_JP.UTF-8" LC_TIME="ja_JP.UTF-8" LC_COLLATE="ja_JP.UTF-8" LC_MONETARY="ja_JP.UTF-8" LC_MESSAGES="ja_JP.UTF-8" LC_PAPER="ja_JP.UTF-8" LC_NAME="ja_JP.UTF-8" LC_ADDRESS="ja_JP.UTF-8" LC_TELEPHONE="ja_JP.UTF-8" LC_MEASUREMENT="ja_JP.UTF-8" LC_IDENTIFICATION="ja_JP.UTF-8" LC_ALL= mfabian@magellan:~$ fc-match sans hgjgbbmp.ttc: "HGPGothicB" "Regular" mfabian@magellan:~$ export LANG="" mfabian@magellan:~$ fc-match msbm10.ttf: "msbm10" "Medium" mfabian@magellan:~$ LC_CTYPE=POSIX fc-match verdana.ttf: "Verdana" "Regular" mfabian@magellan:~$ LC_CTYPE=C fc-match verdana.ttf: "Verdana" "Regular" mfabian@magellan:~$ LC_CTYPE=en_US.UTF-8 fc-match verdana.ttf: "Verdana" "Regular" mfabian@magellan:~$ LC_CTYPE="" fc-match msbm10.ttf: "msbm10" "Medium" mfabian@magellan:~$ fc-match sans verdana.ttf: "Verdana" "Regular" mfabian@magellan:~$ When LANG is set to ja_JP.UTF-8, it matches a Japanese font. OK. When LANG is en_US.UTF-8 or LANG is unset it matches an English font. OK. LC_CTYPE overrides LANG when choosing a font. Also OK. When setting LANG="" (or LC_CTYPE=""), a weird font is choosen, in my case a weird, broken font from the free-ttf-fonts package which has many mathematical symbols at code positions where they do not belong, consequently the results look weird, not only in icewm. Apparently the font matching works rather random when LANG="". Should be no big problem as LANG="" or LC_CTYPE="" should not be used anyway. But maybe it would be nice if the font matching of fontconfig would fall back to the way it works in the POSIX locale. Open a feature request. If I have a little bit of time I'll try to improve that in fontconfig. Reopening and assigning to me. But as this bug is not serious (happens only when LANG is set illegally anyway), I won't do that soon. REOPEN. If it is illegal, why is it allowed in the first place? (Well, that's a dumb question, because you set it at the shell level while fontconfig is far away. But I had to put this question :v) I tried deeper... and here is what causes icewm to drop fonts. Let me express it in boolean C style: if(defined($LANG) && $LANG="" && !defined(LC_CTYPE)) then fux0r_icewm; IOW: export LANG="" unset LC_CTYPE If LANG is unset or LC_CTYPE is filled with e.g. de_DE.UTF-8, seems to work. Yes, but as I explained this is a stupid setting which should never be used. And it has nothing to do with icewm, fontconfig already matches weird fonts with that setting. If you use such a illegal locale setting, the behavior is "undefined". I think it would make sense for fontconfig to fall back to C/POSIX in that case. But as this is already a user error, and a rare one in my opinion, it is not so urgent to improve that in fontconfig. Improved fontconfig package submitted to STABLE. Should show up in SuSE Linux 10.0 Beta3. ------------------------------------------------------------------- Tue Aug 16 17:02:35 CEST 2005 - mfabian@suse.de - Bugzilla #102328: fall back to POSIX if the effective value of LC_CTYPE is the empty string "". By falling back to POSIX here we make sure that even in this case fontconfig matches something readable. Without that it apparently matches completely random and might match a font which doesn't even have ASCII glyphs. As a result, nothing at all may be displayed. ------------------------------------------------------------------- The old fontconfig package without the fix behaves like this: mfabian@shannon:~$ LC_CTYPE="" fc-match sans SY______.PFB: "Symbol" "Regular" mfabian@shannon:~$ LC_CTYPE="fff" fc-match sans verdana.ttf: "Verdana" "Regular" mfabian@shannon:~$ LC_CTYPE="POSIX" fc-match sans verdana.ttf: "Verdana" "Regular" mfabian@shannon:~$ I.e. when the effective value of LC_CTYPE is the empty string, some random nonsense font may be matched, a symbol font in this example. If this font has no ASCII glyphs, nothing at all may be displayed in the application. The new fontconfig package with the fix behaves like this: mfabian@magellan:~$ LC_CTYPE="" fc-match sans verdana.ttf: "Verdana" "Regular" mfabian@magellan:~$ LC_CTYPE="fff" fc-match sans verdana.ttf: "Verdana" "Regular" mfabian@magellan:~$ LC_CTYPE="POSIX" fc-match sans verdana.ttf: "Verdana" "Regular" mfabian@magellan:~$ I.e. with the fix the case with the empty string behaves the same way as the case with "POSIX". Packages for SuSE Linux 9.3 are here: ftp://ftp.suse.com/pub/projects/m17n/9.3/i586/fontconfig-2.3.2.20050721-3.1.i586.rpm ftp://ftp.suse.com/pub/projects/m17n/9.3/i586/fontconfig-devel-2.3.2.20050721-3.1.i586.rpm ftp://ftp.suse.com/pub/projects/m17n/9.3/src/fontconfig-2.3.2.20050721-3.1.src.rpm ftp://ftp.suse.com/pub/projects/m17n/9.3/x86_64/fontconfig-2.3.2.20050721-3.1.x86_64.rpm ftp://ftp.suse.com/pub/projects/m17n/9.3/x86_64/fontconfig-devel-2.3.2.20050721-3.1.x86_64.rpm icewm should work for you now even if you set LANG="". Closing as FIXED. What's m17n standing for? "multilingualization" = "m" + 17-letters + "n" → m17n "internationalization" = "i" + 18-letters + "n" → i18n "localization" = "l" + 10-letters + "n" → l10n Reported upstream: From: Mike FABIAN <mfabian@suse.de> Subject: patch: fallback to POSIX if LC_CTYPE is the empty string "". To: fontconfig@lists.freedesktop.org Date: Tue, 16 Aug 2005 18:02:05 +0200 User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.5 (corn, linux) Content-Type: multipart/mixed; boundary="=-=-=" Reply-To: mfabian@suse.de A SuSE user recently reported a bug that icewm didn't show any fonts. It turned out to be user error, he had set LANG="" (and no other locale specific environment variables). When the effective value of LC_CTYPE is the empty string, fontconfig currently matches apparently random and it may happen that a symbol font or some other font completely unsuitable for displaying even English is matched. This happens only when LC_CTYPE is the empty string, for all other values, even nonsensical ones, fontconfig falls back to English: mfabian@shannon:~$ LC_CTYPE="" fc-match sans SY______.PFB: "Symbol" "Regular" mfabian@shannon:~$ LC_CTYPE="fff" fc-match sans verdana.ttf: "Verdana" "Regular" mfabian@shannon:~$ LC_CTYPE="POSIX" fc-match sans verdana.ttf: "Verdana" "Regular" mfabian@shannon:~$ Although setting LC_CTYPE="" is not a valid setting in my opinion, I think fontconfig should fall back to matching an English font in that case, just as it does for all the other invalid settings of LC_CTYPE. Patch attached. diff -ru fontconfig-2.3.2.20050721.orig/src/fcdefault.c fontconfig-2.3.2.20050721/src/fcdefault.c --- fontconfig-2.3.2.20050721.orig/src/fcdefault.c 2004-12-07 02:14:46.000000000 +0100 +++ fontconfig-2.3.2.20050721/src/fcdefault.c 2005-08-16 16:45:02.000000000 +0200 @@ -111,6 +111,11 @@ ctype = getenv ("LANG"); } } + /* + * if ctype is still empty, fall back to POSIX + */ + if (!strcmp(ctype,"")) + ctype = "POSIX"; if (ctype) { lang = ctype; -- Mike FABIAN <mfabian@suse.de> http://www.suse.de/~mfabian 睡眠不足はいい仕事の敵だ。 _______________________________________________ fontconfig mailing list fontconfig@freedesktop.org http://freedesktop.org/mailman/listinfo/fontconfig Reply by Keith Packard: From: Keith Packard <keithp@keithp.com> Subject: Re: patch: fallback to POSIX if LC_CTYPE is the empty string "". To: mfabian@suse.de Cc: fontconfig@lists.freedesktop.org, keithp@keithp.com Date: Tue, 16 Aug 2005 10:08:04 -0700 Gnus-Warning: This is a duplicate of message <1124212084.4352.30.camel@evo.keithp.com> X-Mailer: Evolution 2.2.3 Content-Type: multipart/mixed; boundary="===============1987565347==" On Tue, 2005-08-16 at 18:02 +0200, Mike FABIAN wrote: > A SuSE user recently reported a bug that icewm didn't show any fonts. > > It turned out to be user error, he had set LANG="" (and no > other locale specific environment variables). > Although setting LC_CTYPE="" is not a valid setting in my opinion, I > think fontconfig should fall back to matching an English font in that > case, just as it does for all the other invalid settings of LC_CTYPE. It should probably treat an empty lang as if the lang was not set: Index: fcdefault.c =================================================================== RCS file: /cvs/fontconfig/fontconfig/src/fcdefault.c,v retrieving revision 1.7 diff -u -p -r1.7 fcdefault.c --- fcdefault.c 7 Dec 2004 01:14:46 -0000 1.7 +++ fcdefault.c 16 Aug 2005 17:06:46 -0000 @@ -111,7 +111,8 @@ FcDefaultSubstitute (FcPattern *pattern) ctype = getenv ("LANG"); } } - if (ctype) + /* ignore missing or empty ctype */ + if (ctype && *ctype != '\0') { lang = ctype; territory = strchr (ctype, '_'); There's no point setting ctype to 'POSIX'; the only ctypes which have any effect on the library are those in <lang>_<territory> form. -keith _______________________________________________ fontconfig mailing list fontconfig@freedesktop.org http://freedesktop.org/mailman/listinfo/fontconfig Package with Keith Packard's fix submitted to STABLE. Keith's fix achieves the same and looks more logical. |