summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2005-03-01 20:54:42 +0000
committerOwen Taylor <otaylor@src.gnome.org>2005-03-01 20:54:42 +0000
commit857c69a5513be76ed91a7989b4831a0d47e01fe9 (patch)
treec05e21adf928108a0caa9d9b3a52f3b2f3063a53
parentc63801bd14a3ad1508c8683860f461fe3b4a9873 (diff)
downloadpango-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)
-rw-r--r--ChangeLog6
-rw-r--r--ChangeLog.pre-1-106
-rw-r--r--pango/pango-context.c10
3 files changed, 20 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e25b6e1f..186c0c27 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
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)
+
+2005-03-01 Owen Taylor <otaylor@redhat.com>
+
Build fixes from Andrew P. Lentvorski, Jr, #164655
* pango/pangoft2-render.c: Duplicate the
diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10
index e25b6e1f..186c0c27 100644
--- a/ChangeLog.pre-1-10
+++ b/ChangeLog.pre-1-10
@@ -1,5 +1,11 @@
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)
+
+2005-03-01 Owen Taylor <otaylor@redhat.com>
+
Build fixes from Andrew P. Lentvorski, Jr, #164655
* pango/pangoft2-render.c: Duplicate the
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);