Re: Latin2 fonts problem

On Tue, 26 Jan 1999, Marcin Gorycki wrote:
> Hi,
> I have the following problem: I come from the country using Latin2 character
> set (Poland) and I constantly find it difficult to select correct fonts for
> X, as most of the time it is preconfigured to use Latin1 (*-iso8859-1)
> fonts.

X is a many splendored thing.  The X Window System itself isn't
preconfigured to use ANY fonts.  The trouble is that until recently there
has been little to no standardization regarding how programs determine
which fonts to use.

For the rest of this message, I will assume that:
  * You are using XFree86 (although other X Servers work similarly)
  * You have some Latin2 fonts already installed
  * You have the fontpath to your Latin2 fonts in your XF86Config file
  * You are familiar with the X Logical Font Description Conventions
    (i.e. the -adobe-times-medium-r-normal--*-*-*-*-*-*-*-*" stuff), if
    not, there is a decent explanation here:

> The same in GNOME, only here I had to create my own gtk theme containing
> only the font definition for my language (although some widget still use
> Latin1 fonts because I don't know the name of the widget).  The problem
> is, when I switch the theme (say, to Metal or whatever), I lose my font
> encoding.

The themes given in gtk-engines do have Latin1 fonts as the default, and
when you select a theme, you get its fonts too, since that is part of the

Fortunately, it is easy to modify these themes with a text editor.  You
find the themes in <prefix>/share/themes.  In each directory you find
<themename>/gtk/gtkrc.  Open that file with a text editor, and you should
see, near the top, a section titled [style "default"], inside that
section, you should see a line saying [font = "<some font descriptor>"],
just change the font descriptor to the one you want.  This will work for
ALL the gtk-engines themes except for Default.  For default, you do what
you described doing above.

Now, if you want to change for good, so that the new fonts don't go away
when you update gtk-engines, you need to do the same thing as above, but
in the source directory.  First, unless you are using CVS, go to the
directory just above your gtk-engines source directory, and copy it    
("cp -aR gtk-engines gtk-engines.orig").  You don't need to do this step
if you use CVS.  Find the files in gtk-engines/<theme>/Theme/gtk/gtkrc.
Once you've edited them to your desire, then:
  * If you use CVS:
    1) cd to the top level of gtk-engines
    2) type "cvs diff -uN >../gtkthemelatin2.patch"
  * If you use tarballs:
    1) cd to the directory just above gtk-engines
    2) type "diff -uNr gtk-engines.orig gtk-engines >gtkthemelatin2.patch"
       (or whatever the two directories are called)
The next time you update gtk-engines, before you recompile, apply the
patch.  You will have the fonts you want in the themes you want.

> I think I would have to create my own theme derived from Metal with
> Latin2 fonts inside, which a bit of a pain, at least until someone comes
> up with a nice theme editor. Wouldn't it be nice if such things were
> inside the gtkrc file ? That way, if an user switches his LANG to
> something else than default, the theme would modify itself accordingly.

The trouble is that even if someone mapped every possible language code to
a font, you can't assume that the font is available on the system using
the language code.

You're better off maintaining a Latin2 theme or two.  Submit them to, I'm sure others would be interested.

Best of Luck,

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