diff options
author | Owen Taylor <otaylor@redhat.com> | 2005-03-01 20:54:42 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2005-03-01 20:54:42 +0000 |
commit | 857c69a5513be76ed91a7989b4831a0d47e01fe9 (patch) | |
tree | c05e21adf928108a0caa9d9b3a52f3b2f3063a53 /pango/pango-context.c | |
parent | c63801bd14a3ad1508c8683860f461fe3b4a9873 (diff) | |
download | pango-857c69a5513be76ed91a7989b4831a0d47e01fe9.tar.gz |
Use the language from the context if %NULL is passed in for @language.
2005-03-01 Owen Taylor <otaylor@redhat.com>
* pango/pango-context.c (pango_context_get_metrics): Use
the language from the context if %NULL is passed in for
@language. (#163472)
Diffstat (limited to 'pango/pango-context.c')
-rw-r--r-- | pango/pango-context.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pango/pango-context.c b/pango/pango-context.c index f1d2c407..ab7bbdaa 100644 --- a/pango/pango-context.c +++ b/pango/pango-context.c @@ -1342,8 +1342,11 @@ update_metrics_from_items (PangoFontMetrics *metrics, * @context: a #PangoContext * @desc: a #PangoFontDescription structure * @language: language tag used to determine which script to get the metrics - * for, or %NULL to indicate to get the metrics for the entire - * font. + * for. %NULL means that the language tag from the context will + * be used. If no language tag is set on the ccontext, 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. * * Get overall metric information for a font particular font * description. Since the metrics may be substantially different for @@ -1374,6 +1377,9 @@ pango_context_get_metrics (PangoContext *context, g_return_val_if_fail (PANGO_IS_CONTEXT (context), NULL); g_return_val_if_fail (desc != NULL, NULL); + if (!language) + language = context->language; + current_fonts = pango_font_map_load_fontset (context->font_map, context, desc, language); metrics = get_base_metrics (current_fonts); |