GNOME Bugzilla – Bug 123498
GtkFontSelection should localize style list
Last modified: 2013-10-06 05:31:59 UTC
The font style list isn't i18n'ized. The attached patch adds some gettext calls and adds four strings. regs, Chris
Created attachment 20361 [details] [review] Proposed patch. Definitly works with 2.2, applies cleanly to HEAD as of today.
Fonts can have many different styles; the Regular/Bold/Bold Italic/Italic combination is just one possibility. You need to handle all the different string forms of the style enumerations that are found in pango/fonts.c.
Should I really add every single style/variant/weight specification? If I only stick to this file, it won't work since we've got "Regular", too - which isn't mentioned in there. Combinations like "Bold Italic" aren't inside this file as well. From what I can see, we have to look somewhere else - at least for the fc backend, we have only four possible combinations that are all covered by the patch. Please take a look at pango/pangofc-fontmap.c:pango_fc_family_list_faces. IMHO we should commit the patch and research the available combinations for other backends later. regs, Chris
No, this patch won't be applied; perhaps the localization needs to occur at the Pango level; I'd have to look at how it works again to say for sure.
(and, yes, I get gtk-bugs@gtk.org email)
if we localize font style info, we need to be careful to retain a non-localized query capability since clients may need to test the 'canonical' i.e. non-localized strings. for instance, assistive technologies get this info and then re-present it to the user (using client-side localization).
Bill: Shouldn't those use pango_font_face_get_face_name or do they directly "query" the UI (the font list). IMHO this would be a bit hacky. Is there any widespread code currently relying on that? What could be done about this? gtk_font_selection_show_available_styles is static, so at least it is no lib export issue. regs, Chris
Louie: Why does the patch need work? I didn't get any serious feedback on a better implementation. regs, Chris
*** Bug 319484 has been marked as a duplicate of this bug. ***
Owen: Maybe you could take another look at the issue. Bill: How is are the ally strings extraced from a tree view?
You may refer to bug #319484. I posted an better patch there. http://bugzilla.gnome.org/attachment.cgi?id=53766&action=view This issue is different from bug #95731. That bug tells that it should be able to get localized family and style name STORED in the FONT via pango. However there are large amount of fonts which don't provide localized family and style name at all. So for non-English users, it's hard to understand the meaning of "Regular, Italic, Bold" etc. Fortunately, most fonts use the same set of style names, so that we could localize them in po files.
But this localization should still happen in pango, don't you think ?
Yes, you could fix it in pango, but however you need change pango's API to support it, just like bug #95731. It's more diffcult.
So, shouldn't this be reassigned to Pango?
Any movement here? It's a pretty essential flaw that font styles are never localized and for what I want, Christian's patch in comment #1 would already help with the lion share of the common fonts.
Created attachment 196703 [details] [review] Updated patch for GTK+ 3 (including new widgets) While this is not the approach we want (should get fixed in pango), we use this patch in openSUSE as it makes a big difference for users. This is the updated version for GTK+ 3.
Using LibreOffice or the recent gnome-font-viewer, i can see these styles Regular/Bold/Italic/Semibold/Caps/Condensed/Oblique/Extralight/Book/Small Caps/Slanted/Initials/Normal/Medium/BoldOblique [1]/Demi/Light/LightOblique [2]/Bold.1.1 [3]/BoldItalic [4]/regular (+ combination of each) [1] For Waree, Umpush, Tlwg Typo, Tlwg Typist, TlwgTypewriter, TlwgMono, Sawasdee, Purisa, Norasi, Loma, Kinnari, Garuda fonts. Maybe is it a bug on my Debian system and that it should be "Bold Oblique" [2] For Umpush fonts. Maybe is it a bug on my Debian system and that it should be "LightOblique" [3] For padmaa-Bold.1.1 fonts. Maybe is it a bug on my Debian system and that it should be "Bold" [4] For Kinnari fonts. Maybe is it a bug on my Debian system and that it should be "BoldI talic" Thanks
I've just learned (after having filled a bug report against Debian in which LinuxLibertine have typos : "Samll Caps" instead of "Small Caps") that LinuxLibertine guys will no longer produce font substyles. See http://sourceforge.net/p/linuxlibertine/bugs/168/
GtkFontSelection has been deprecated, and the new font chooser doesn't have a style list.