Re: [Nautilus-list] fonts on sidebar's tabs problem solved



On Thu, 22 Mar 2001, Ramiro Estrugo wrote:

> Ramiro Estrugo wrote:
> > 
> > This is all true of 1.0.
> 
> Ok, I lied.  Its supposed to work in 1.0 as well.
> 
> Can you please file a bug for the issue ?  Thanks.

 Hmm..
 OK, tomorrow :)
 
> > 
> > Already in the CVS HEAD of Nautilus this works much better.  We use the
> > font server's configuration to populate the font choices.
> > 
> > Can you elaborate a bit on how "scanning for fonts with locale-specific
> > encoding first" should work ?
> > 
> > -re
> > 
> 
> Also, if you (or any one else that knows about these things) can please
> file a bug about the "scanning fonts in locale specific encoding" issue
> I would be grateful.  I am interested in knowing how to determine the
> charset given a locale.  The rest is easy.

  Here is a code that can be used for this:

#ifdef HAVE_LANGINFO_H
#include <langinfo.h>
#endif

static char*
get_locale_charset_name()
{
        static char* charset = NULL;

        if (charset)
                return charset;

#ifdef _NL_CTYPE_CODESET_NAME
        charset = nl_langinfo (_NL_CTYPE_CODESET_NAME);
#elif defined(CODESET)
        charset = nl_langinfo (CODESET);
#elif
        {
                char* locale = setlocale(LC_CTYPE,NULL);
                char* tmp = strchr(locale,'.');
                if (tmp)
                        charset = tmp+1;
        }
#endif
        if (!charset)
                charset = "ISO-8859-1";
        charset = g_strdup(charset);
        return charset;
}

 But in general you may not need it - just query a font with *-* as
registry-encoding and X will try to return the one that fits best for current
locale.

> -re
> 
> _______________________________________________
> gnome-i18n mailing list
> gnome-i18n@gnome.org
> http://mail.gnome.org/mailman/listinfo/gnome-i18n
> 

 Best regards,
  -Vlad





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