Bug 102328 - icewm fonts not displayed
Summary: icewm fonts not displayed
Status: VERIFIED FIXED
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: X.Org (show other bugs)
Version: RC 3
Hardware: All Linux
: P5 - None : Enhancement
Target Milestone: ---
Assignee: Mike Fabian
QA Contact: Stefan Dirsch
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-05 09:46 UTC by Jan Engelhardt
Modified: 2006-07-15 09:37 UTC (History)
0 users

See Also:
Found By: Beta-Customer
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Engelhardt 2005-08-05 09:46:45 UTC
For some reason, icewm does not display any text in the title bars, menu bars,
menu, everywhere. It works with e.g. blackbox.
Am I missing some packages?

# rpm -qa '*font*'|sort
fontconfig-2.2.99.20050218-8
fontconfig-devel-2.2.99.20050218-8
fonts-config-20041001-5
ghostscript-fonts-std-8.15rc1-16
xorg-x11-fonts-100dpi-6.8.2-30
xorg-x11-fonts-75dpi-6.8.2-30
xorg-x11-fonts-scalable-6.8.2-30

These are installed on both 9.3 hosts.
Comment 1 Mike Fabian 2005-08-05 10:30:09 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
    [...]
Comment 2 Jan Engelhardt 2005-08-05 10:38:35 UTC
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.
Comment 3 Jan Engelhardt 2005-08-05 12:05:17 UTC
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.
Comment 4 Mike Fabian 2005-08-05 13:15:56 UTC
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.


Comment 5 Jan Engelhardt 2005-08-05 20:18:32 UTC
>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.
Comment 6 Mike Fabian 2005-08-06 18:29:33 UTC
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.

Comment 7 Jan Engelhardt 2005-08-08 12:17:03 UTC
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;

Comment 8 Mike Fabian 2005-08-08 12:36:04 UTC
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.


Comment 9 Jan Engelhardt 2005-08-08 12:46:58 UTC
I said LANG="", not en_US.UTF-8.
Comment 10 Jan Engelhardt 2005-08-08 13:13:16 UTC
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 ;)
Comment 11 Mike Fabian 2005-08-08 13:46:46 UTC
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.
Comment 12 Jan Engelhardt 2005-08-08 13:50:51 UTC
Open a feature request.
Comment 13 Mike Fabian 2005-08-08 14:05:27 UTC
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.
Comment 14 Mike Fabian 2005-08-08 14:06:03 UTC
REOPEN.
Comment 15 Jan Engelhardt 2005-08-08 14:10:08 UTC
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)
Comment 16 Jan Engelhardt 2005-08-11 17:48:54 UTC
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.
Comment 17 Mike Fabian 2005-08-11 21:22:30 UTC
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.
Comment 18 Mike Fabian 2005-08-16 15:15:41 UTC
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.
  
-------------------------------------------------------------------
Comment 19 Mike Fabian 2005-08-16 15:25:08 UTC
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".

Comment 21 Mike Fabian 2005-08-16 15:39:06 UTC
icewm should work for you now even if you set LANG="".

Closing as FIXED.
Comment 22 Jan Engelhardt 2005-08-16 15:52:05 UTC
What's m17n standing for?
Comment 23 Mike Fabian 2005-08-16 16:21:15 UTC
"multilingualization"  = "m" + 17-letters + "n" → m17n
"internationalization" = "i" + 18-letters + "n" → i18n
"localization"         = "l" + 10-letters + "n" → l10n
Comment 24 Mike Fabian 2005-08-16 17:14:48 UTC
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
Comment 25 Mike Fabian 2005-08-16 17:15:33 UTC
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
Comment 26 Mike Fabian 2005-08-16 17:28:15 UTC
Package with Keith Packard's fix submitted to STABLE.

Keith's fix achieves the same and looks more logical.