Re: Problem with hard-coded fonts in applications



O> > ===>
> > #define FIXED_12_FONT
> > "-b&h-lucidatypewriter-medium-r-normal-*-12-*-*-*-*-*-*-*"
> > #define FIXED_12_BFONT
> > "-b&h-lucidatypewriter-bold-r-normal-*-12-*-*-*-*-*-*-*"
> ...
> 
> > What should be the resolution of this?

I suggest to all developers that it should be gettextized such as:

#define FIXED_12_FONT
 N_("-b&h-lucidatypewriter-medium-r-normal-*-12-*-*-*-*-*-*-*")
#define FIXED_12_BFONT
 N_("-b&h-lucidatypewriter-bold-r-normal-*-12-*-*-*-*-*-*-*")

and, code as this:

gdk_fontset_load(_(FIXED_12_FONT))
gdk_fontset_load(_(FIXED_12_BFONT))

N_() is just to let gettextize command find this, and
_() is to get the gettextized strings.

#define FIXED_12_FONT
 _("-b&h-lucidatypewriter-medium-r-normal-*-12-*-*-*-*-*-*-*")

doesn't work.

> From my experience the solution is to add ",*-r-*" to the end
> (that is making it a "match all" fontset in practice), and
> then in the programs replace all gdk_font_load by gdk_fontset_load
>  
> > The best looks to be (and it is mentioned in control-center)
> > is to get the fixed/varied fonts from the GTK configuration.
> > Since this looks to be a common problem, has an application solved
> > it in a nice way so that logview & others can use the code?
> 
> Try
> 
> #define FIXED_12_FONT "-b&h-lucidatypewriter-medium-r-normal-*-12-*-*-*-*-*-*-*,*-r-*"

It means the apps will at least show the strings but very dirty.
It may be one good way to test apps but it is bad to implement this into
the final codes. If people will be satified with *-r-*, we need no
font selection.

#define FIXED_12_FONT "*-r-*"

and done...

So I recommend that the developer should let translators choose the
lang-dependent fonts with gettext.

--
Nakai




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