+2008-12-07 Behdad Esfahbod <behdad@gnome.org>
+
+ * pango/pango-context.c (pango_context_get_metrics):
+ Fix docs re NULL language. Also allow NULL desc.
+
2008-12-06 Behdad Esfahbod <behdad@gnome.org>
* pango/pangocairo-font.c
state->gravity = attr == NULL ? PANGO_GRAVITY_AUTO : ((PangoAttrInt *)attr)->value;
attr = find_attribute (state->extra_attrs, PANGO_ATTR_GRAVITY_HINT);
- state->gravity_hint = attr == NULL ? state->context->gravity_hint : ((PangoAttrInt *)attr)->value;
+ state->gravity_hint = attr == NULL ? state->context->gravity_hint : (PangoGravityHint)((PangoAttrInt *)attr)->value;
state->changed |= FONT_CHANGED;
if (state->lang != old_lang)
} GetShaperFontInfo;
static gboolean
-get_shaper_and_font_foreach (PangoFontset *fontset,
+get_shaper_and_font_foreach (PangoFontset *fontset G_GNUC_UNUSED,
PangoFont *font,
gpointer data)
{
/**
* pango_context_get_metrics:
* @context: a #PangoContext
- * @desc: a #PangoFontDescription structure
+ * @desc: a #PangoFontDescription structure. %NULL means that the font
+ * description from the context will be used.
* @language: language tag used to determine which script to get the metrics
* for. %NULL means that the language tag from the context will
* be used. If no language tag is set on the context, metrics
- * large enough to cover a range of languages will be returned.
- * The process of determining such metrics is slow, so it is best
- * to always make sure some real language tag will be used.
+ * for the default language (as determined by
+ * pango_language_get_default()) will be returned.
*
* Get overall metric information for a particular font
* description. Since the metrics may be substantially different for
GList *items;
g_return_val_if_fail (PANGO_IS_CONTEXT (context), NULL);
- g_return_val_if_fail (desc != NULL, NULL);
+
+ if (!desc)
+ desc = context->font_desc;
if (!language)
language = context->language;