Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tlug: Mucked up my kterm fonts



--------------------------------------------------------
tlug note from "Stephen J. Turnbull" <turnbull@example.com>
--------------------------------------------------------
>>>>> "Jim" == Jim Breen <jwb@example.com> writes:

    >>> It seems to me that you must have edited either your .
    >>> Xresources or /usr/X11R6/lib/X11/app-defaults/KTerm.

    Jim> I didn't touch either. Neither had the time/date changed. The
    Jim> latter was, of course, reset when I originally did the "make
    Jim> install" for the kterm.  I suspect there is some other file
    Jim> in an obscure place known to the server.

Unfortunately, there are lots of them.  This is an Xt application, so
you can probably pretty well figure them out.  In order of increasing
priority:
(1) Hard-coded fall-back values in the source
(2) The application defaults file, which should set everything set in
    (1).  Usually, but not necessarily, the same as (1) in the
    distribution version.
(3) An assortment of user .Xdefaults files.  These are only read if
    the RESOURCE_MANAGER property is not set on the root window.
(4) The root window's RESOURCE_MANAGER property.

The RESOURCE_MANAGER property is set using xrdb.  This can be invoked
in all sorts of places.  Normally it's done in .xinitrc or .xsession.
Look there to see what you've got.  The user resource database lives
in ~/.Xresources.  But there is also at least one, and sometimes
several, system resource databases.

    >>> you're in TRUH-BULL and can only get out by deleting the
    >>> server-generated font.  You'll have to find it first....

    Jim> Which I was never able to do! I'm pretty sure that the server
    Jim> rebuilt it each time I started X, but I could never find from

Well, in that case you wouldn't be able to find a font stored on disk.

    Jim> where. As I mentioned, none of the resource files had been
    Jim> changed.

"None" is a strong word here :-).  If you are using a session or
desktop manager that restarts you in more or less the same state you
were in when you shut down, then it probably writes a session resource 
file.  Then there are the system files I mentioned.

    Jim> Well, being a purist, I use the 1990 sets (those last two
    Jim> jinmeiyoukanji are *SO* important 8-)}

One of these days I'll upgrade :-).

    Jim> Anyway, it's fixed, and this is how it happened.

    Jim> (a) Jason asked me if I still had the problem if I ran X as
    Jim> another user.  I tried this, and yes it still occurred.

This sort of eliminates the session manager theory, as well as your
personal resource database.

    Jim> (b) I tried both the old JE kterm and the patched version,
    Jim> noticed that they pick up different fonts, and looked (again)
    Jim> at the app.defaults. The newer kterm has a general XLFD mask

I assume you are referring to the "*fontList*" resources.  These are
specifiers for XFontSets.  Basically, an XFontSet contains one font
for every character set encoding in the current locale.  You can find
out what character sets are requested by looking in
/usr/X11R6/lib/X11/locale/<LOCALE>/XLC_LOCALE.  kterm, I believe,
hardcodes the locale to ja_JP.EUC, which is translated to "ja" by an
alias file.  I imagine that the algorithm works character set by
character set on a "first-fit" basis from the list of fonts generated
by applying XListFonts() to the mask(s).

I note that on my machine, at least, .../ja/XLC_LOCALE does not admit
JISX0208.1990 character sets.  The JISX0212.1990 character set
information is commented out.  You might want to check and see what
your locale database does for this, to avoid future problems.

BTW, what version of kterm are you using?

    Jim> (c) I (re)visited my font.dir file and found that the XLFD of
    Jim> the 24x24 JIS212 font didn't match the mask. 'mkfontdir'
    Jim> extracts this from the header of the .bdf, and I hadn't
    Jim> previously twigged that a mask was operating with the newer
    Jim> kterm.

Ah, and there is no provision for setting the font directly with a
"*VT100*kanji0212Font3" type of resource; the ones that remain are for 
backward compatibility.

    Jim> (d) I edited the .bdf header to make the XLFD conform to what
    Jim> kterm wanted ("--misc-fixed-r- etc etc."), ran mkfontdir,
    Jim> restarted X and crossed my fingers.

Since this is a unique font (its proper name should probably something
like "-Jim_Breen's_Secret_Santa_font_foundry-gothic-*-jisx0212.1990-0"
:-), this is OK.  More portable would be to put it at the head of the
fontList resource.

By the way, the XFree86 3.1.2 server is in general _not_ happy with
the format of the resources as specified in the KTerm.ad file.  When I 
used the model "-adobe-courier-medium-r-normal--14-*" it did not find
the scaleable font, even though it is on my path.  With 
"-adobe-courier-medium-r-normal--14-*-*-*-*-*-*-*" (14 hyphens) it did 
find it.  Whether this is related to your bogus scaling problem I can't 
say.

    Jim> 	A. The 24x24 font now works correctly, so now I can
    Jim> select "Large" for text containing both JIS X 212 and JIS X
    Jim> 208 characters.

What kind of text is this?  I'm not sure I've ever seen a JIS X 212
character in the wild, only captive in Ghostscript fonts and the like.

    Jim> 	B. somewhere along the line the bogus scalings of the
    Jim> 16x16 font fell off. It has reverted to the ones I wanted.

I think you're just funnin' us yokels.  Are you really a writer for
"The X Files" in disguise?

I'm beginning to see some method in the madness, though.  There is no
"best fit" algorithm for fonts (at least not today), so as I mentioned 
above the server uses a first fit approach.  You are guaranteed to a
list which is sorted at a gross level according to the list of fonts
in the XFontSet specifier, and within those according to the
fontpath.  But within each directory on the fontpath there is no
guaranteed order.  I bet you reran mkfontdir several times, and each
time the ordering changed.

Since the server is allowed to be _really_ lazy about how it
constructs the list of names with partially specified (less than 14
hyphens) XLFDs, I bet that this in combination with the fact that you
were changing the fonts available is what made it seem like Friday the 
13th on Monday.

    Jim> BTW, I have mentioned a 24x24 bdf for JIS212. This is NOT
    Jim> publicly available. A friend who shall be nameless, but who,
    Jim> er, works in fonts slipped me a copy for personal use. For
    Jim> all sorts of labyrinthine commercial reasons his company
    Jim> cannot release bitmapped versions of this font.

Scalable fonts are fine by me.  XFree86 is quite happy with both
"Speedo" and "Type 1" fonts (although they are a bit slower to start
up; I suppose it could take _forever_ to scale kanji fonts).

Ho ho ho.  I imagine the company probably doesn't want to give away
its scalable outlines, either.

-- 
                            Stephen J. Turnbull
Institute of Policy and Planning Sciences                    Yaseppochi-Gumi
University of Tsukuba                      http://turnbull.sk.tsukuba.ac.jp/
Tel: +81 (298) 53-5091;  Fax: 55-3849              turnbull@example.com
-----------------------------------------------------------------
a word from the sponsor will appear below
-----------------------------------------------------------------
The TLUG mailing list is proudly sponsored by TWICS - Japan's First
Public-Access Internet System.  Now offering 20,000 yen/year flat
rate Internet access with no time charges.  Full line of corporate
Internet and intranet products are available.   info@example.com
Tel: 03-3351-5977   Fax: 03-3353-6096


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links