summaryrefslogtreecommitdiff
path: root/gtk/gtkfontchooserwidget.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-08-15 17:29:34 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-08-15 17:29:34 -0400
commit0f9fc277c2a8175fe1e8fc9b0884b43d08bc4b79 (patch)
treebcbacda4be165d6a339e2a7edb3c929b00eeb09e /gtk/gtkfontchooserwidget.c
parent69246f5828aeeee23f0f097577a6b280e93ea88f (diff)
downloadgtk+-0f9fc277c2a8175fe1e8fc9b0884b43d08bc4b79.tar.gz
GtkFontChooser: Prevent font fallback in the preview
We don't want to preview the fallback fonts, after all. https://bugzilla.gnome.org/show_bug.cgi?id=570414
Diffstat (limited to 'gtk/gtkfontchooserwidget.c')
-rw-r--r--gtk/gtkfontchooserwidget.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c
index e7d347d7c5..f184316abe 100644
--- a/gtk/gtkfontchooserwidget.c
+++ b/gtk/gtkfontchooserwidget.c
@@ -540,6 +540,7 @@ static void
gtk_font_chooser_widget_init (GtkFontChooserWidget *fontchooser)
{
GtkFontChooserWidgetPrivate *priv;
+ PangoAttrList *attrs;
fontchooser->priv = gtk_font_chooser_widget_get_instance_private (fontchooser);
priv = fontchooser->priv;
@@ -552,8 +553,14 @@ gtk_font_chooser_widget_init (GtkFontChooserWidget *fontchooser)
priv->font_desc = pango_font_description_new ();
/* Set default preview text */
- gtk_entry_set_text (GTK_ENTRY (priv->preview),
- pango_language_get_sample_string (NULL));
+ gtk_entry_set_text (GTK_ENTRY (priv->preview), priv->preview_text);
+
+ /* Prevent font fallback */
+ attrs = pango_attr_list_new ();
+ pango_attr_list_insert (attrs, pango_attr_fallback_new (FALSE));
+ gtk_entry_set_attributes (GTK_ENTRY (priv->preview), attrs);
+ pango_attr_list_unref (attrs);
+
gtk_widget_add_events (priv->preview, GDK_SCROLL_MASK);
/* Set the upper values of the spin/scale with G_MAXINT / PANGO_SCALE */