[gnome-terminal/gnome-3-2] Only display monospace fonts
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal/gnome-3-2] Only display monospace fonts
- Date: Tue, 13 Sep 2011 11:11:55 +0000 (UTC)
commit 8e64f5e5a36a6580101499dd99dcf518e6083be3
Author: Christian Persch <chpe gnome org>
Date: Tue Sep 13 13:11:16 2011 +0200
Only display monospace fonts
When choosing a terminal font, only show the monospace ones.
src/profile-editor.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/profile-editor.c b/src/profile-editor.c
index 4f88f3b..5ac20f6 100644
--- a/src/profile-editor.c
+++ b/src/profile-editor.c
@@ -549,6 +549,16 @@ init_background_darkness_scale (GtkWidget *scale)
NULL);
}
+#if GTK_CHECK_VERSION (3, 1, 19)
+static gboolean
+font_family_is_monospace (const PangoFontFamily *family,
+ const PangoFontFace *face,
+ gpointer data)
+{
+ return pango_font_family_is_monospace ((PangoFontFamily *) family);
+}
+
+#endif
static void
editor_response_cb (GtkWidget *editor,
@@ -872,6 +882,11 @@ terminal_profile_edit (TerminalProfile *profile,
G_CALLBACK (reset_compat_defaults_cb),
profile);
+#if GTK_CHECK_VERSION (3, 1, 19)
+ gtk_font_chooser_set_filter_func (GTK_FONT_CHOOSER (gtk_builder_get_object (builder, "font-selector")),
+ font_family_is_monospace, NULL, NULL);
+#endif
+
SET_ENUM_VALUE ("image-radiobutton", TERMINAL_BACKGROUND_IMAGE);
SET_ENUM_VALUE ("solid-radiobutton", TERMINAL_BACKGROUND_SOLID);
SET_ENUM_VALUE ("transparent-radiobutton", TERMINAL_BACKGROUND_TRANSPARENT);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]