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
This commit is contained in:
Matthias Clasen 2014-08-15 17:29:34 -04:00
parent 69246f5828
commit 0f9fc277c2

View File

@ -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 */