summaryrefslogtreecommitdiff
path: root/pango/pangoxft-font.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-05-11 08:22:20 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-05-11 08:22:20 +0000
commitf0f38b3ab2fd9e9a8debe35db71156afc01b5d8c (patch)
tree77fc322e6198986ffc06378a21019eccb3e4c7ce /pango/pangoxft-font.c
parent0a7f8d6fb481d2bd502b5f376a0dcef6f82ee0ff (diff)
downloadpango-f0f38b3ab2fd9e9a8debe35db71156afc01b5d8c.tar.gz
Update docs to note a size value of zero may have been set explicitly.
2006-05-11 Behdad Esfahbod <behdad@gnome.org> * pango/fonts.c (pango_font_description_set_size): Update docs to note a size value of zero may have been set explicitly. * pango/pango-context.c (pango_context_load_font): Don't warn if font size if zero. * pango/pangoatsui-fontmap.c (pango_atsui_font_map_load_font): * pango/pangox-fontmap.c (pango_x_font_map_load_font): Don't return if size is zero (probably will fail with no fonts found.) * pango/pangoxft-fontmap.c (pango_xft_font_map_default_substitute): * Xft chokes on size zero. Reassing PIXEL_SIZE to 1.0 if it's zero.
Diffstat (limited to 'pango/pangoxft-font.c')
-rw-r--r--pango/pangoxft-font.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pango/pangoxft-font.c b/pango/pangoxft-font.c
index fe3844fb..51fa7fcf 100644
--- a/pango/pangoxft-font.c
+++ b/pango/pangoxft-font.c
@@ -172,7 +172,7 @@ _pango_xft_font_get_mini_font (PangoXftFont *xfont)
xfont->mini_width = PANGO_SCALE * width;
xfont->mini_height = PANGO_SCALE * height;
- xfont->mini_pad = PANGO_SCALE * MAX ((int)(2.2 * height + 27) / 28, 1);
+ xfont->mini_pad = PANGO_SCALE * MIN (height / 2, MAX ((int)(2.2 * height + 27) / 28, 1));
}
return xfont->mini_font;
@@ -387,7 +387,7 @@ xft_font_get_font (PangoFont *font)
xfont = (PangoXftFont *)font;
fcfont = (PangoFcFont *)font;
- if (xfont->xft_font == NULL)
+ if (G_UNLIKELY (xfont->xft_font == NULL))
{
FcPattern *pattern = FcPatternDuplicate (fcfont->font_pattern);
FcPatternDel (pattern, FC_SPACING);