vte r2311 - in trunk: . src



Author: behdad
Date: Tue Dec  2 19:57:47 2008
New Revision: 2311
URL: http://svn.gnome.org/viewvc/vte?rev=2311&view=rev

Log:
2008-12-02  Behdad Esfahbod  <behdad gnome org>

        * src/vtepangocairo.c (context_hash), (context_equal),
        (font_info_create_for_context), (font_info_create_for_screen),
        (font_info_create_for_widget): Respect PangoLanguage set on a widget's
        PangoContext.



Modified:
   trunk/ChangeLog
   trunk/src/vtepangocairo.c

Modified: trunk/src/vtepangocairo.c
==============================================================================
--- trunk/src/vtepangocairo.c	(original)
+++ trunk/src/vtepangocairo.c	Tue Dec  2 19:57:47 2008
@@ -91,8 +91,8 @@
  * do the following:
  *
  *   - Use a global cache to share font info structs across different widgets.
- *     We use cairo font options, resolution, and font description as the key
- *     for our hash table.
+ *     We use pango language, cairo font options, resolution, and font description
+ *     as the key for our hash table.
  *
  *   - When a font info struct is no longer used by any widget, we delay
  *     destroying it for a while (FONT_CACHE_TIMEOUT seconds).  This is
@@ -543,7 +543,8 @@
 {
 	return pango_units_from_double (pango_cairo_context_get_resolution (context))
 	     ^ pango_font_description_hash (pango_context_get_font_description (context))
-	     ^ cairo_font_options_hash (pango_cairo_context_get_font_options (context));
+	     ^ cairo_font_options_hash (pango_cairo_context_get_font_options (context))
+	     ^ GPOINTER_TO_UINT (pango_context_get_language (context));
 }
 
 static gboolean
@@ -552,7 +553,8 @@
 {
 	return pango_cairo_context_get_resolution (a) == pango_cairo_context_get_resolution (b)
 	    && pango_font_description_equal (pango_context_get_font_description (a), pango_context_get_font_description (b))
-	    && cairo_font_options_equal (pango_cairo_context_get_font_options (a), pango_cairo_context_get_font_options (b));
+	    && cairo_font_options_equal (pango_cairo_context_get_font_options (a), pango_cairo_context_get_font_options (b))
+	    && pango_context_get_language (a) == pango_context_get_language (b);
 }
 
 static struct font_info *
@@ -584,7 +586,8 @@
 static struct font_info *
 font_info_create_for_context (PangoContext               *context,
 			      const PangoFontDescription *desc,
-			      VteTerminalAntiAlias        antialias)
+			      VteTerminalAntiAlias        antialias,
+			      PangoLanguage              *language)
 {
 	if (!PANGO_IS_CAIRO_FONT_MAP (pango_context_get_font_map (context))) {
 		/* Ouch, Gtk+ switched over to some drawing system?
@@ -595,9 +598,12 @@
 	}
 
 	pango_context_set_base_dir (context, PANGO_DIRECTION_LTR);
+
 	if (desc)
 		pango_context_set_font_description (context, desc);
 
+	pango_context_set_language (context, language);
+
 	switch (antialias) {
 		cairo_font_options_t *font_options;
 		cairo_antialias_t cr_aa;
@@ -636,10 +642,11 @@
 static struct font_info *
 font_info_create_for_screen (GdkScreen                  *screen,
 			     const PangoFontDescription *desc,
-			     VteTerminalAntiAlias        antialias)
+			     VteTerminalAntiAlias        antialias,
+			     PangoLanguage              *language)
 {
 	return font_info_create_for_context (gdk_pango_context_get_for_screen (screen),
-					     desc, antialias);
+					     desc, antialias, language);
 }
 
 static struct font_info *
@@ -648,8 +655,9 @@
 			     VteTerminalAntiAlias        antialias)
 {
 	GdkScreen *screen = gtk_widget_get_screen (widget);
+	PangoLanguage *language = pango_context_get_language (gtk_widget_get_pango_context (widget));
 
-	return font_info_create_for_screen (screen, desc, antialias);
+	return font_info_create_for_screen (screen, desc, antialias, language);
 }
 
 static struct unichar_info *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]