GNOME Bugzilla – Bug 168102
Use PangoFontDescriptions internally for GimpText, instead of serialized strings
Last modified: 2018-05-24 11:26:17 UTC
We're doing some contortions to workaround bug #166540, and if bug #168085 is fixed, some of our font names can potentionally look even uglier. If we work on PangoFontDescriptions internally, resolving GIMP fonts to pango fonts is nicely disambiguated. It also gives us the opportunity to pretty print the names.
We would still have to serialize the font somehow and make sure that the same font is being choosen the next time the text layer in an XCF file is edited.
Bumping to Future since this will not be done for 2.4, but may be addressed as part of text tool improvments for 2.5.
PangoFontDescriptions apparently are not powerful enough to unambiguously describe the individual PangoFontFaces, see bug #341213. I guess there is no way around using the FontFaces directly and invent some kind of serializing :-/
Created attachment 88870 [details] [review] Patch to make font selection more reliable This is a patch that makes the font selection more reliable by (ab)using the fontconfig parts of pango. This makes it possible to use all fonts installed on the system (ok, there might be corner cases I have not yet stumbled upon). It also is a bit problematic, as people using older versions of the gimp will get a warning message with newer XCFs, but it is not possible to transparently store the fontconfig bits in the "font" property of a GimpText, because that would make the PangoFontDescription generated within older Gimps basically useless.
Hmm, I just realize that this bug is more about the user visible font names, this does not get adressed with the above patch, although it allows us to generate arbitrarily nice font names without having to care about the serializability for PangoFontDescriptions.
The patch looks sensible to me, should that functionality be needed.
Actually I think PangoFontDescriptions might not be adequate. See bug 733832.
Comment on attachment 88870 [details] [review] Patch to make font selection more reliable per comment 7
-- 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/gimp/issues/130.