summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-11-02 07:04:59 -0400
committerMatthias Clasen <mclasen@redhat.com>2022-11-07 15:42:38 +0100
commit2c6ac137a3984bcbcc62c36a91aa7a1f4c711038 (patch)
treed28094b5aa97156ee477b8ff292cfd7e6695cfb1 /demos
parent5bd264d5324e72e14edb40398d6c037c9f3df046 (diff)
downloadgtk+-2c6ac137a3984bcbcc62c36a91aa7a1f4c711038.tar.gz
gtk-demo: Improve language handlng
In the font features demo, don't add a item for the default language to the dropdown, that does not make sense.
Diffstat (limited to 'demos')
-rw-r--r--demos/gtk-demo/font_features.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/demos/gtk-demo/font_features.c b/demos/gtk-demo/font_features.c
index fd358eb47b..025b6d354a 100644
--- a/demos/gtk-demo/font_features.c
+++ b/demos/gtk-demo/font_features.c
@@ -855,11 +855,6 @@ update_script_combo (void)
pair->lang_tag = 0;
g_hash_table_add (tags, pair);
- pair = g_new (TagPair, 1);
- pair->script_tag = HB_OT_TAG_DEFAULT_SCRIPT;
- pair->lang_tag = HB_OT_TAG_DEFAULT_LANGUAGE;
- g_hash_table_add (tags, pair);
-
if (hb_font)
{
hb_tag_t tables[2] = { HB_OT_TAG_GSUB, HB_OT_TAG_GPOS };
@@ -971,9 +966,6 @@ update_features (void)
/* set feature presence checks from the font features */
- if (gtk_drop_down_get_selected (GTK_DROP_DOWN (demo->script_lang)) == 0)
- return;
-
selected = gtk_drop_down_get_selected_item (GTK_DROP_DOWN (demo->script_lang));
if (selected->lang_tag == 0) /* None is selected */
@@ -1002,6 +994,8 @@ update_features (void)
pango_font = get_pango_font ();
hb_font = pango_font_get_hb_font (pango_font);
+ g_print ("language %s\n", selected->langname);
+
if (hb_font)
{
hb_tag_t tables[2] = { HB_OT_TAG_GSUB, HB_OT_TAG_GPOS };
@@ -1028,9 +1022,6 @@ update_features (void)
char buf[5];
hb_tag_to_string (features[j], buf);
buf[4] = 0;
-#if 0
- g_print ("%s present in %s\n", buf, i == 0 ? "GSUB" : "GPOS");
-#endif
if (g_str_has_prefix (buf, "ss") || g_str_has_prefix (buf, "cv"))
{
@@ -1422,10 +1413,7 @@ instance_changed (GtkDropDown *combo)
ikey.name = (char *) text;
instance = g_hash_table_lookup (demo->instances, &ikey);
if (!instance)
- {
- g_print ("did not find instance %s\n", text);
- goto out;
- }
+ goto out;
pango_font = get_pango_font ();
hb_font = pango_font_get_hb_font (pango_font);