[dwm] Can someone explain how FONT configuration works in Status Bar?

From: Ning Bao <phabulosa_AT_gmail.com>
Date: Fri, 1 Jun 2007 23:27:47 -0700

Hi!

/*The following is my experience with DWM in the past 6 hours. If you have
no interest, please skip and look at the real questions of mine. */
First, I have to claim that I am not a program at all. DWM is such a
project requires programming knowledge, if my questions seem too stupid,
please let me know.
I have been convert to Linux for a while. First, I was attracted by
eyecandies such as Beryl (mainly on KDE). It was the main reason of my
switch. I told myself that Linux can beat Windows, just look at the Beryl
cube effect. However, the more I use linux, the more I realized that the
greatness of linux and thousands of opensource applications doesn't come
from the fancy feature, but their SIMPLICITY and SMART DESIGN. So, I felt
eyecandies like Beryl sort of violate the simplicity rule. So, I began to
try out other WMs, I like E17 very much. Today, I found DWM on Osnews and
just apt-get install dwm from (K)ubuntu repo. my first impression of DWM was
confusion because I never used something like this. However, I get used to
DWM after reading the man page. SO SIMPLE!!! SO FAST and VERY PRODUCTIVE.
Also, I was amazed that the source code is only 11k. I will give up on
Beryl and stick to this great WM.
/*END*/

Well, I cannot wait to try compiling the latest DWM myself although it seems
very daunting for me. I removed the DWM in Ubuntu repo and downloaded
version 4.2 The compiling process is very easy after read some ABCs on howto
install from source code in Ubuntu.

Ok, I met my first "bug". In DWM, Firefox cannot display Chinese character
in statusbar correctly. The symptom seems that it cannot recognize the
coding of Chinese characters. Some characters are displayed correctly, but
not all. Some are in different fonts (different language).

So, I did some research and tried to figure out the problem.

Here comes the comments I left in config.h.

    /* OriginalFONT configuration */
/* #define FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*" */

    /* New FONT configuration referring /etc/gtk/gtkrc.zh_CN This one works!
*/
    /*#define FONT "-*-*-medium-r-normal--16-*-*-*-*-*-
gb2312.1980-0,*-r-*"*/

    /*Then, I tried to adjust the font size, Hmmm... the size is not the
problem, though changing size seemed to change the fonts selection. For an
example, which choose 14, the fonts looks like LCD digital watch. So, I
suspected that the locale is the problem, so I replaced the gb2312 part with
* . Still, it is not the problem */

    /*Conclusion :It is the format of the FONT configuation caused the
problem. */

    /*The following line is the final version which I decided to use*/
#define FONT "-*-*-medium-r-normal--16-*-*-*-*-*-*,*-r-*"

1. I am wondering if my FONT configuration will work only in Ubuntu or will
work in other distro also?
2. My configuration seems not much different from the original line. Can
some one explain why my version works? It will be appreciated if someone can
give me some reference on linux fonts mechanism.

Thanks a lot!
Received on Sat Jun 02 2007 - 08:27:50 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:43:28 UTC