For adding a language on gdm's login screen, apart from having a locale file, few translations and required fonts, it is required that language is recognized by fontconfig. To make a fontconfig recognize the language, a related lang.orth file is required. With my experiment on this, I think there is also need to add an entry to fcfreetype.c of fontconfig and related language code entry in ttnameid.h of freetype2. After making all these changes the language is listed in the gdm's list. But this has a problem, as the entries of language code in ttnameid.h are MS and MAC codes for these languages and there are languages that do not have these codes but are included in iso639-2 language codes. Thus my question is, how much important is it to have an entry for the language in the file fcfreetype.c of fontconfig and related entry in the header file ttnameid.h of freetype2? And what is to be done for the language that does not have MS or MAC code? Is it possible to use our own codes?
Can anyone please help resolving this?
On Tue, 2008-08-12 at 19:17 +0530, Rahul Bhalerao wrote:
For adding a language on gdm's login screen, apart from having a locale file, few translations and required fonts, it is required that language is recognized by fontconfig. To make a fontconfig recognize the language, a related lang.orth file is required. With my experiment on this, I think there is also need to add an entry to fcfreetype.c of fontconfig and related language code entry in ttnameid.h of freetype2. After making all these changes the language is listed in the gdm's list. But this has a problem, as the entries of language code in ttnameid.h are MS and MAC codes for these languages and there are languages that do not have these codes but are included in iso639-2 language codes. Thus my question is, how much important is it to have an entry for the language in the file fcfreetype.c of fontconfig and related entry in the header file ttnameid.h of freetype2? And what is to be done for the language that does not have MS or MAC code? Is it possible to use our own codes?
Can anyone please help resolving this?
Ray (who wrote most of this code) is busy doing something else right now, so let me summarize what I know about this:
What gdm does it is only shows a language in the list if a) we have translations for it and b) we have fonts for it. For b), we basically ask fontconfig "do you have fonts for this language ?". It seems that fontconfig says "no" if it doesn't know the language. It would be better if fontconfig could say "I don't know" in that case...
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Matthias Clasen wrote:
For b), we basically ask fontconfig "do you have fonts for this language ?". It seems that fontconfig says "no" if it doesn't know the language. It would be better if fontconfig could say "I don't know" in that case...
One way to detect that fontconfig doesn't know about the language is by querying the newly added FcLangGetCharSet(). It returns NULL if it doesn't know.
behdad
On Tue, Aug 12, 2008 at 7:37 PM, Matthias Clasen mclasen@redhat.com wrote:
What gdm does it is only shows a language in the list if a) we have translations for it and b) we have fonts for it. For b), we basically ask fontconfig "do you have fonts for this language ?". It seems that fontconfig says "no" if it doesn't know the language. It would be better if fontconfig could say "I don't know" in that case...
Apart from these three conditions, even if fontconfig knows the language, is it necessary that fcfreetype.c has MAC language code defined for that language, in order to list it in gdm?
When I tried adding .orth file, the "fc-list fontname lang" listed the appropriate language, but still it did not appear in gdm list until, the definitions were made in fcfreetype.c and ttnameid.h.
Rahul.
On Wed, 2008-08-13 at 18:45 +0530, Rahul Bhalerao wrote:
On Tue, Aug 12, 2008 at 7:37 PM, Matthias Clasen mclasen@redhat.com wrote:
What gdm does it is only shows a language in the list if a) we have translations for it and b) we have fonts for it. For b), we basically ask fontconfig "do you have fonts for this language ?". It seems that fontconfig says "no" if it doesn't know the language. It would be better if fontconfig could say "I don't know" in that case...
Apart from these three conditions, even if fontconfig knows the language, is it necessary that fcfreetype.c has MAC language code defined for that language, in order to list it in gdm?
When I tried adding .orth file, the "fc-list fontname lang" listed the appropriate language, but still it did not appear in gdm list until, the definitions were made in fcfreetype.c and ttnameid.h.
I don't know offhand why that would be. Here is the code that gdm uses to determine if a language has sufficient font support:
pattern = FcPatternBuild (NULL, FC_LANG, FcTypeString, language_code, NULL);
if (pattern == NULL) goto done;
object_set = FcObjectSetBuild (NULL, NULL);
if (object_set == NULL) goto done;
font_set = FcFontList (NULL, pattern, object_set);
if (font_set == NULL) goto done;
is_displayable = (font_set->nfont > 0);
Rahul Bhalerao wrote:
On Tue, Aug 12, 2008 at 7:37 PM, Matthias Clasen mclasen@redhat.com wrote:
What gdm does it is only shows a language in the list if a) we have translations for it and b) we have fonts for it. For b), we basically ask fontconfig "do you have fonts for this language ?". It seems that fontconfig says "no" if it doesn't know the language. It would be better if fontconfig could say "I don't know" in that case...
Patch for this committed upstream: http://bugzilla.gnome.org/show_bug.cgi?id=547826
I'll build it in rawhide when koji is back.
Apart from these three conditions, even if fontconfig knows the language, is it necessary that fcfreetype.c has MAC language code defined for that language, in order to list it in gdm?
When I tried adding .orth file, the "fc-list fontname lang" listed the appropriate language, but still it did not appear in gdm list until, the definitions were made in fcfreetype.c and ttnameid.h.
That makes no sense. The only thing those values are used for is to extract localized family and style names from font files. Those values are defined by MS and can't be free extended. And your fonts needs to use it for them to have any effect at all.
Rahul.
behdad