GNOME Bugzilla – Bug 95731
Add API to get localized family/style names
Last modified: 2018-05-22 12:01:22 UTC
Need to add something like: char *pango_font_font_family_get_display_name (PangoFontFamily *family, PangoLanguage lang); char *pango_font_font_face_get_display_name (PangoFontFace *face, PangoLanguage lang); See discussion in bug 68113.
fontconfig-2.3 hopefully will have the necessary underlying bits.
*** Bug 310316 has been marked as a duplicate of this bug. ***
There are several drawbacks of adding such new APIs: 1. Adding new APIs will break binary compatibility. 2. We must patch all applications and libraries which use pango, in order to let them use the new APIs. 3. These two APIs are not enough, we also need something like pango_font_face_describe_by_language (), pango_font_description_get_display_family (). It'll make things much more complex.
Created attachment 53504 [details] [review] My proposal.
1. We don't make strong guarantees about the implementation of font systems, the implementation is protected with PANGO_ENABLE_BACKEND. 2. Yep. If you add new capabiitites apps generally have to be modified to use those capabilities. You can't just suddenly start using existing APIs to mean something different. (A global setting that changes API behavior is a particularly bad thing to do. The application can pull the rug out from under he feet of the library. Or vice versa.) 3. I don't see any reason for pango_font_face_describe_by_language() or "pango_font_description_get_display_family()" ... a A font description is *programmatic* somethingyou store in a config file. There is no reason to localize it.
1. So I think similiar behaviour should be implemented in other backends as well. 2. In fontconfig/freetype, all family names are equal. A font can be loaded by its English name as well as its Chinese name. So IMO. The concept of "display name" is not suitable in such situation. So why pango_font_map_list_families can only return English names of the fonts? 3. Because, as you konw, pango_font_face_describe () is used in GtkFontSelection to get the font's name. The name is not only used for configuration file, but also for displaying (for example, GtkFontButton). So if pango_font_family_get_display_name() is introduced to get the "display name" of a font family, pango_font_face_describe () is also necessary to get the "display name" of a font face. However, I already solved this issue in fontconfig. So,at least in fontconfig based system, we don't need to change pango. (sa. https://bugzilla.novell.com/show_bug.cgi?id=128930).
track this bug status
*** Bug 539681 has been marked as a duplicate of this bug. ***
FWIW, fontconfig now supports FC_NAMELANG that allows defaulting to one language over the other for these strings.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pango/issues/3.