Re: definining fontsets in /etc/gtkr/gtkrc.* is a very bad thing



On 22 Aug 2000, Owen Taylor wrote:

> 
> Vlad Harchev <hvv@hippo.ru> writes:
> 
> >  It looks like fontset concept is actively pushed by gtk developers (the proof
> > for this is existance of /etc/gtk/gtkrc.* for most languages). I think this is
> > _very_ bad approach. I think any /etc/gtk/gtkrc.* shouldn't be installed at
> > all or they should define a safe default for _font_, _not_ _fontset_. First
> > of all, most files in /etc/gtk/ define several fonts for a given charset.
> 
> The way internationalization works in Xlib is via fontsets. GTK+-2.0
> will bypass this mechanism, but for GTK+-1.2, we are using that
> mechanism.
>

  Hmm, for one-byte locales like a lot of them are (i.e. excluding utf and
CJK locales), fontsets are unnecessary since in this case all strings passed
to gtk functions are plain char* strings, so only one font in fontset will be
used for drawing any string from that locale. So, 90% of /etc/gtkrc/gtkrc.*
could be rewritten not to use fontset. Or am I wrong in theory?
 
> > Let's see gtkrc.ru from gtk-1.3.1:
> > 
> > style "gtk-default-ru" {
> >        fontset = "-adobe-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-*,\
> >                   -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
> >                   -cronyx-helvetica-medium-r-normal--12-*-*-*-*-*-koi8-r,\
> >                   -*-arial-medium-r-normal--12-*-*-*-*-*-koi8-r"
> > }
> > class "GtkWidget" style "gtk-default-ru"
> > 
> >  The last two line for some reason list 2 fonts with the same encoding koi8-r.
> >  This means that Xlib according to XCreateFontSet(3X) will choose random font
> >  (at fontset creation) that will be used for strings in koi8-r charset (and
> >  almost each /etc/gtk/gtkrc.* defines several fonts for the same encoding).
> >  That's a bad thing.
> 
> It may be random in theory, in practice, it is the first found wins.

 The only use of two fonts with the same encoding I can see - is for case when
one of the fonts is unavailable...
 
> >  Even if we removed either of two fonts from that fontset,
> >  that will mean that user will have no way to choose font using  gnome control 
> >  center! 
> 
> Yes, the font selection mechanism in the control center is not
> properly internationalized.

 Hmm, I didn't think that way - seems this is a right direction.

> > Also, that limits to only given font size and font weight. This
> > is true for any language for which exists /etc/gtk/gtkrc.*.
> > 
> >  Since gtk reads /etc/gtkrc/gtkrc.* before ~/.gtkrc (checked), putting default
> > font  for that language in /etc/gtk/gtkrc.ru will serve two purposes:
> > 1) it will provide well-choosen default font for that language
> > 2) it will allow user to override that default font in his/her ~/.gtkrc using
> >    gnome control center.
> > 
> >  So, what do you think about all this?
> 
> I'm afraid, for GTK+-1.2, if your language is not encoded in iso-8859-1,
> you will either:
> 
>  a) need to edit your ~/.gtkrc by hand.

 As for me personally - I just kill /etc/gtk/gtkrc.ru - I don't see any
drawbacks in practice using this approach. But it could be considered broken,
I agree, unless gnomecc is patched.
 
>  b) Submit a patch to the control center so it sets the fontset not
>     the font, for those languages.

 I would love to do that, but I don't have time and can't afford downloading a
pile of software recent gnome needs. I hope someone will do that. 

> (The way it works, is that if a fontset has been specified, then that
> overrides the font. Otherwise (basically) the last specified fontset
> or font wins.)
> 
> Regards,
>                                         Owen

 Thanks for a quick answer to this letter. 
 Other are waiting for your attention. :)

 Best regards,
  -Vlad






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