GNOME Bugzilla – Bug 169020
font_from_pango_font should handle FC_PIXEL_SIZE
Last modified: 2005-07-20 15:21:19 UTC
If you set an absolute size for a font (with Pango-1.8) you'll get a FcPattern with FC_PIXEL_SIZE set not FC_SIZE. So, gnome-print-pango.c:font_from_pango_font() should, after checking for FC_SIZE, check again for FC_PIXEL_SIZE if the FC_SIZE check fails. So something like: - if (FcPatternGetDouble (fcfont->font_pattern, FC_SIZE, 0, &size) != FcResultMatch) - return NULL; + result = FcPatternGetDouble (fcfont->font_pattern, FC_SIZE, 0, &size); + if (result == FcResultNoMatch) + result = FcPatternGetDouble (fcfont->font_pattern, FC_PIXEL_SIZE, 0, &size); + if (result != FcResultMatch) + return NULL; The resolution is 72 for the fontmap so FC_SIZE and FC_PIXEL_SIZE can be treated identically.
done. Patch will be in 2.10.1 thanks
Hmm, the applied patch doesn't work: if (FcPatternGetDouble (fcfont->font_pattern, FC_SIZE, 0, &size) != FcResultMatch) + return NULL; + if (FcPatternGetDouble (fcfont->font_pattern, FC_SIZE, 0, &size) != FcResultMatch && + FcPatternGetDouble (fcfont->font_pattern, FC_PIXEL_SIZE, 0, &size) != FcResultMatch) return NULL; That reads "bail out if FC_SIZE is not there. Then Bail out if FC_SIZE and FC_PIXEL_SIZE are both not there" Right now Pango head is only setting FC_PIXEL_SIZE, resulting in printing not working ... I'll put a workaround to set FC_SIZE in the pattern as well, at a small cost in efficiency.
Created attachment 49467 [details] [review] Original suggestion as a real patch Here's my suggestion as a patch, tested to work. (Serves me write for doing a pseudo-patch the first time...)
Committed (HEAD and gnome-2-10) 2005-07-20 Owen Taylor <otaylor@redhat.com> * libgnomeprint/gnome-print-pango.c: Redo the code that looks for FC_PIXEL_SIZE; the previous fix for bug #169020 wasn't quite right.