[gtk/pango2: 85/91] Fix up font features demo




commit 9dd121ed813788474b8e79f079398dd917c2dc03
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jul 2 01:21:34 2022 -0400

    Fix up font features demo

 demos/gtk-demo/font_features.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/demos/gtk-demo/font_features.c b/demos/gtk-demo/font_features.c
index 08f1c9156f..420e95f848 100644
--- a/demos/gtk-demo/font_features.c
+++ b/demos/gtk-demo/font_features.c
@@ -207,7 +207,7 @@ update_basic (void)
   desc = gtk_font_chooser_get_font_desc (GTK_FONT_CHOOSER (demo->font));
 
   gtk_adjustment_set_value (demo->size_adjustment,
-                            pango2_font_description_get_size (desc) / (double) PANGO_SCALE);
+                            pango2_font_description_get_size (desc) / (double) PANGO2_SCALE);
 }
 
 static void add_font_variations (GString *s);
@@ -503,8 +503,8 @@ update_display (void)
 
   if (do_waterfall)
     {
-      start = PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING;
-      end = PANGO_ATTR_INDEX_TO_TEXT_END;
+      start = PANGO2_ATTR_INDEX_FROM_TEXT_BEGINNING;
+      end = PANGO2_ATTR_INDEX_TO_TEXT_END;
     }
   else if (gtk_label_get_selection_bounds (GTK_LABEL (demo->the_label), &ins, &bound))
     {
@@ -520,7 +520,7 @@ update_display (void)
   desc = gtk_font_chooser_get_font_desc (GTK_FONT_CHOOSER (demo->font));
 
   value = gtk_adjustment_get_value (demo->size_adjustment);
-  pango2_font_description_set_size (desc, value * PANGO_SCALE);
+  pango2_font_description_set_size (desc, value * PANGO2_SCALE);
 
   s = g_string_new ("");
   add_font_variations (s);
@@ -672,7 +672,7 @@ update_display (void)
           g_string_append (waterfall, text);
           g_string_append_c (waterfall, '\n');
 
-          attr = pango2_attr_size_new (sizes[i] * PANGO_SCALE);
+          attr = pango2_attr_size_new (sizes[i] * PANGO2_SCALE);
           pango2_attribute_set_range (attr, start, start + text_len);
           pango2_attr_list_insert (attrs, attr);
 
@@ -700,7 +700,7 @@ get_pango_font (void)
   Pango2Context *context;
 
   desc = gtk_font_chooser_get_font_desc (GTK_FONT_CHOOSER (demo->font));
-  context = gtk_widget_get_pango2_context (demo->font);
+  context = gtk_widget_get_pango_context (demo->font);
 
   return pango2_context_load_font (context, desc);
 }
@@ -821,7 +821,7 @@ update_script_combo (void)
         }
     }
 
-  g_object_unref (pango2_font);
+  g_object_unref (pango_font);
 
   g_hash_table_iter_init (&iter, tags);
   while (g_hash_table_iter_next (&iter, (gpointer *)&pair, NULL))
@@ -939,10 +939,10 @@ update_features (void)
 
   /* set feature presence checks from the font features */
 
-  if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (script_lang), &iter))
+  if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (demo->script_lang), &iter))
     return;
 
-  model = gtk_combo_box_get_model (GTK_COMBO_BOX (script_lang));
+  model = gtk_combo_box_get_model (GTK_COMBO_BOX (demo->script_lang));
   gtk_tree_model_get (model, &iter,
                       1, &script_index,
                       2, &lang_index,
@@ -1079,7 +1079,7 @@ update_features (void)
         }
     }
 
-  g_object_unref (pango2_font);
+  g_object_unref (pango_font);
 }
 
 #define FixedToFloat(f) (((float)(f))/65536.0)
@@ -1412,7 +1412,7 @@ instance_changed (GtkComboBox *combo)
 
 out:
   g_free (text);
-  g_clear_object (&pango2_font);
+  g_clear_object (&pango_font);
   g_free (ai);
   g_free (coords);
 }


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