2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2003-02-02 05:50:21 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* GimpTextEditor
|
2008-02-09 04:52:03 +08:00
|
|
|
* Copyright (C) 2002-2003, 2008 Sven Neumann <sven@gimp.org>
|
2003-02-02 05:50:21 +08:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2003-03-31 23:10:15 +08:00
|
|
|
#include "widgets-types.h"
|
2003-02-02 05:50:21 +08:00
|
|
|
|
2003-03-31 23:10:15 +08:00
|
|
|
#include "core/gimpmarshal.h"
|
|
|
|
|
2003-08-25 22:24:28 +08:00
|
|
|
#include "gimphelp-ids.h"
|
2004-11-04 22:24:32 +08:00
|
|
|
#include "gimpmenufactory.h"
|
2008-02-08 21:50:34 +08:00
|
|
|
#include "gimplanguagestore.h"
|
2003-03-31 23:10:15 +08:00
|
|
|
#include "gimptexteditor.h"
|
2004-11-04 22:24:32 +08:00
|
|
|
#include "gimpuimanager.h"
|
2003-02-02 05:50:21 +08:00
|
|
|
|
2003-03-31 23:10:15 +08:00
|
|
|
#include "gimp-intl.h"
|
2003-02-02 05:50:21 +08:00
|
|
|
|
|
|
|
|
2003-03-31 23:10:15 +08:00
|
|
|
enum
|
2003-02-02 05:50:21 +08:00
|
|
|
{
|
2004-03-12 02:47:37 +08:00
|
|
|
TEXT_CHANGED,
|
2003-03-31 23:10:15 +08:00
|
|
|
DIR_CHANGED,
|
|
|
|
LAST_SIGNAL
|
2003-02-02 05:50:21 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-02-09 04:42:34 +08:00
|
|
|
static void gimp_text_editor_finalize (GObject *object);
|
2003-03-31 23:10:15 +08:00
|
|
|
|
2008-02-09 04:42:34 +08:00
|
|
|
static GtkWidget * gimp_text_editor_language_entry_new (void);
|
|
|
|
|
|
|
|
static void gimp_text_editor_text_changed (GtkTextBuffer *buffer,
|
|
|
|
GimpTextEditor *editor);
|
|
|
|
static void gimp_text_editor_font_toggled (GtkToggleButton *button,
|
|
|
|
GimpTextEditor *editor);
|
2005-06-11 22:18:51 +08:00
|
|
|
|
2003-03-31 23:10:15 +08:00
|
|
|
|
2006-05-15 17:46:31 +08:00
|
|
|
G_DEFINE_TYPE (GimpTextEditor, gimp_text_editor, GIMP_TYPE_DIALOG)
|
2003-03-31 23:10:15 +08:00
|
|
|
|
2005-12-20 06:37:49 +08:00
|
|
|
#define parent_class gimp_text_editor_parent_class
|
2003-03-31 23:10:15 +08:00
|
|
|
|
2005-12-20 06:37:49 +08:00
|
|
|
static guint text_editor_signals[LAST_SIGNAL] = { 0 };
|
2003-03-31 23:10:15 +08:00
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_text_editor_class_init (GimpTextEditorClass *klass)
|
|
|
|
{
|
2005-06-11 22:18:51 +08:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
|
|
|
|
|
object_class->finalize = gimp_text_editor_finalize;
|
|
|
|
|
2005-12-20 06:37:49 +08:00
|
|
|
klass->text_changed = NULL;
|
|
|
|
klass->dir_changed = NULL;
|
|
|
|
|
2004-03-12 02:47:37 +08:00
|
|
|
text_editor_signals[TEXT_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("text-changed",
|
2006-04-12 20:49:29 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpTextEditorClass, text_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
2004-11-04 22:24:32 +08:00
|
|
|
|
2003-03-31 23:10:15 +08:00
|
|
|
text_editor_signals[DIR_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("dir-changed",
|
2006-04-12 20:49:29 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpTextEditorClass, dir_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
2003-03-31 23:10:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-06-11 22:18:51 +08:00
|
|
|
gimp_text_editor_init (GimpTextEditor *editor)
|
2003-03-31 23:10:15 +08:00
|
|
|
{
|
2004-02-27 04:04:20 +08:00
|
|
|
editor->view = NULL;
|
|
|
|
editor->file_dialog = NULL;
|
2004-11-04 22:24:32 +08:00
|
|
|
editor->ui_manager = NULL;
|
2003-03-31 23:10:15 +08:00
|
|
|
|
|
|
|
switch (gtk_widget_get_default_direction ())
|
|
|
|
{
|
|
|
|
case GTK_TEXT_DIR_NONE:
|
|
|
|
case GTK_TEXT_DIR_LTR:
|
|
|
|
editor->base_dir = GIMP_TEXT_DIRECTION_LTR;
|
|
|
|
break;
|
|
|
|
case GTK_TEXT_DIR_RTL:
|
|
|
|
editor->base_dir = GIMP_TEXT_DIRECTION_RTL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-06-11 22:18:51 +08:00
|
|
|
static void
|
|
|
|
gimp_text_editor_finalize (GObject *object)
|
|
|
|
{
|
|
|
|
GimpTextEditor *editor = GIMP_TEXT_EDITOR (object);
|
|
|
|
|
|
|
|
if (editor->font_name)
|
|
|
|
g_free (editor->font_name);
|
|
|
|
|
|
|
|
if (editor->ui_manager)
|
|
|
|
g_object_unref (editor->ui_manager);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
2004-11-04 22:24:32 +08:00
|
|
|
|
|
|
|
/* public functions */
|
|
|
|
|
2003-02-02 05:50:21 +08:00
|
|
|
GtkWidget *
|
2004-11-04 22:24:32 +08:00
|
|
|
gimp_text_editor_new (const gchar *title,
|
2006-08-28 23:26:25 +08:00
|
|
|
GtkWindow *parent,
|
2004-11-04 22:24:32 +08:00
|
|
|
GimpMenuFactory *menu_factory)
|
2003-02-02 05:50:21 +08:00
|
|
|
{
|
2003-03-31 23:10:15 +08:00
|
|
|
GimpTextEditor *editor;
|
2004-03-12 02:47:37 +08:00
|
|
|
GtkTextBuffer *buffer;
|
2004-11-04 22:24:32 +08:00
|
|
|
GtkWidget *toolbar;
|
2003-02-02 05:50:21 +08:00
|
|
|
GtkWidget *scrolled_window;
|
|
|
|
|
2003-02-21 00:11:23 +08:00
|
|
|
g_return_val_if_fail (title != NULL, NULL);
|
2006-08-28 23:26:25 +08:00
|
|
|
g_return_val_if_fail (parent == NULL || GTK_IS_WINDOW (parent), NULL);
|
2004-11-04 22:24:32 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_MENU_FACTORY (menu_factory), NULL);
|
2003-02-02 05:50:21 +08:00
|
|
|
|
2003-03-31 23:10:15 +08:00
|
|
|
editor = g_object_new (GIMP_TYPE_TEXT_EDITOR,
|
2007-05-09 00:32:30 +08:00
|
|
|
"title", title,
|
|
|
|
"role", "gimp-text-editor",
|
|
|
|
"transient-for", parent,
|
|
|
|
"help-func", gimp_standard_help_func,
|
|
|
|
"help-id", GIMP_HELP_TEXT_EDITOR_DIALOG,
|
2003-03-31 23:10:15 +08:00
|
|
|
NULL);
|
2003-02-21 00:11:23 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
gtk_dialog_add_button (GTK_DIALOG (editor),
|
|
|
|
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
|
2003-02-02 05:50:21 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
g_signal_connect (editor, "response",
|
|
|
|
G_CALLBACK (gtk_widget_destroy),
|
|
|
|
NULL);
|
2003-09-02 21:43:26 +08:00
|
|
|
|
2004-11-04 22:24:32 +08:00
|
|
|
editor->ui_manager = gimp_menu_factory_manager_new (menu_factory,
|
|
|
|
"<TextEditor>",
|
|
|
|
editor, FALSE);
|
2003-03-31 23:10:15 +08:00
|
|
|
|
2005-02-09 04:55:00 +08:00
|
|
|
toolbar = gtk_ui_manager_get_widget (GTK_UI_MANAGER (editor->ui_manager),
|
|
|
|
"/text-editor-toolbar");
|
2004-12-01 08:13:48 +08:00
|
|
|
|
|
|
|
if (toolbar)
|
|
|
|
{
|
2008-02-09 05:03:18 +08:00
|
|
|
GtkToolItem *item;
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *entry;
|
|
|
|
|
2004-12-01 08:13:48 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (editor)->vbox), toolbar,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (toolbar);
|
2003-03-31 23:10:15 +08:00
|
|
|
|
2008-02-09 05:03:18 +08:00
|
|
|
item = gtk_tool_item_new ();
|
|
|
|
gtk_tool_item_set_expand (item, TRUE);
|
|
|
|
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
|
|
|
|
gtk_widget_show (GTK_WIDGET (item));
|
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, 6);
|
|
|
|
gtk_container_add (GTK_CONTAINER (item), hbox);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
|
|
|
label = gtk_label_new_with_mnemonic (_("_Language:"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (label);
|
|
|
|
|
|
|
|
entry = gimp_text_editor_language_entry_new ();
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (entry);
|
|
|
|
|
|
|
|
gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
|
|
|
|
}
|
2008-02-08 21:50:34 +08:00
|
|
|
|
2003-02-02 05:50:21 +08:00
|
|
|
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
|
|
|
|
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
|
2006-04-12 20:49:29 +08:00
|
|
|
GTK_POLICY_AUTOMATIC,
|
|
|
|
GTK_POLICY_AUTOMATIC);
|
2004-05-05 06:33:52 +08:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (scrolled_window), 2);
|
2008-02-09 05:03:18 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (editor)->vbox),
|
|
|
|
scrolled_window, TRUE, TRUE, 0);
|
2003-02-02 05:50:21 +08:00
|
|
|
gtk_widget_show (scrolled_window);
|
|
|
|
|
2004-03-12 02:47:37 +08:00
|
|
|
editor->view = gtk_text_view_new ();
|
2003-03-31 23:10:15 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (scrolled_window), editor->view);
|
|
|
|
gtk_widget_show (editor->view);
|
|
|
|
|
2004-03-12 02:47:37 +08:00
|
|
|
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (editor->view));
|
|
|
|
|
|
|
|
g_signal_connect (buffer, "changed",
|
2006-04-12 20:49:29 +08:00
|
|
|
G_CALLBACK (gimp_text_editor_text_changed),
|
|
|
|
editor);
|
2004-03-12 02:47:37 +08:00
|
|
|
|
2003-03-31 23:10:15 +08:00
|
|
|
switch (editor->base_dir)
|
|
|
|
{
|
|
|
|
case GIMP_TEXT_DIRECTION_LTR:
|
|
|
|
gtk_widget_set_direction (editor->view, GTK_TEXT_DIR_LTR);
|
|
|
|
break;
|
|
|
|
case GIMP_TEXT_DIRECTION_RTL:
|
|
|
|
gtk_widget_set_direction (editor->view, GTK_TEXT_DIR_RTL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2008-02-09 05:03:18 +08:00
|
|
|
gtk_widget_set_size_request (editor->view, 150, 64);
|
2008-02-09 04:42:34 +08:00
|
|
|
|
2005-06-11 22:18:51 +08:00
|
|
|
editor->font_toggle =
|
|
|
|
gtk_check_button_new_with_mnemonic (_("_Use selected font"));
|
2008-02-09 05:03:18 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (editor)->vbox),
|
|
|
|
editor->font_toggle, FALSE, FALSE, 0);
|
2005-06-11 22:18:51 +08:00
|
|
|
gtk_widget_show (editor->font_toggle);
|
|
|
|
|
|
|
|
g_signal_connect (editor->font_toggle, "toggled",
|
|
|
|
G_CALLBACK (gimp_text_editor_font_toggled),
|
|
|
|
editor);
|
|
|
|
|
2004-06-05 02:17:50 +08:00
|
|
|
gtk_widget_grab_focus (editor->view);
|
|
|
|
|
2004-11-04 22:24:32 +08:00
|
|
|
gimp_ui_manager_update (editor->ui_manager, editor);
|
|
|
|
|
2003-03-31 23:10:15 +08:00
|
|
|
return GTK_WIDGET (editor);
|
|
|
|
}
|
|
|
|
|
2004-03-12 02:47:37 +08:00
|
|
|
void
|
|
|
|
gimp_text_editor_set_text (GimpTextEditor *editor,
|
|
|
|
const gchar *text,
|
|
|
|
gint len)
|
|
|
|
{
|
|
|
|
GtkTextBuffer *buffer;
|
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_TEXT_EDITOR (editor));
|
|
|
|
g_return_if_fail (text != NULL || len == 0);
|
|
|
|
|
|
|
|
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (editor->view));
|
|
|
|
|
|
|
|
if (text)
|
|
|
|
gtk_text_buffer_set_text (buffer, text, len);
|
|
|
|
else
|
|
|
|
gtk_text_buffer_set_text (buffer, "", 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
gchar *
|
|
|
|
gimp_text_editor_get_text (GimpTextEditor *editor)
|
|
|
|
{
|
|
|
|
GtkTextBuffer *buffer;
|
|
|
|
GtkTextIter start_iter;
|
|
|
|
GtkTextIter end_iter;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_TEXT_EDITOR (editor), NULL);
|
|
|
|
|
|
|
|
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (editor->view));
|
|
|
|
|
|
|
|
gtk_text_buffer_get_bounds (buffer, &start_iter, &end_iter);
|
|
|
|
|
|
|
|
return gtk_text_buffer_get_text (buffer, &start_iter, &end_iter, FALSE);
|
|
|
|
}
|
|
|
|
|
2003-03-31 23:10:15 +08:00
|
|
|
void
|
|
|
|
gimp_text_editor_set_direction (GimpTextEditor *editor,
|
|
|
|
GimpTextDirection base_dir)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_TEXT_EDITOR (editor));
|
|
|
|
|
|
|
|
if (editor->base_dir == base_dir)
|
|
|
|
return;
|
|
|
|
|
|
|
|
editor->base_dir = base_dir;
|
|
|
|
|
2004-05-11 02:10:18 +08:00
|
|
|
if (editor->view)
|
2003-03-31 23:10:15 +08:00
|
|
|
{
|
2004-05-11 02:10:18 +08:00
|
|
|
switch (editor->base_dir)
|
|
|
|
{
|
|
|
|
case GIMP_TEXT_DIRECTION_LTR:
|
|
|
|
gtk_widget_set_direction (editor->view, GTK_TEXT_DIR_LTR);
|
|
|
|
break;
|
|
|
|
case GIMP_TEXT_DIRECTION_RTL:
|
|
|
|
gtk_widget_set_direction (editor->view, GTK_TEXT_DIR_RTL);
|
|
|
|
break;
|
|
|
|
}
|
2003-03-31 23:10:15 +08:00
|
|
|
}
|
|
|
|
|
2004-11-04 22:24:32 +08:00
|
|
|
gimp_ui_manager_update (editor->ui_manager, editor);
|
|
|
|
|
2003-03-31 23:10:15 +08:00
|
|
|
g_signal_emit (editor, text_editor_signals[DIR_CHANGED], 0);
|
|
|
|
}
|
|
|
|
|
2004-03-12 02:47:37 +08:00
|
|
|
GimpTextDirection
|
|
|
|
gimp_text_editor_get_direction (GimpTextEditor *editor)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_TEXT_EDITOR (editor), GIMP_TEXT_DIRECTION_LTR);
|
|
|
|
|
|
|
|
return editor->base_dir;
|
|
|
|
}
|
|
|
|
|
2005-06-11 22:18:51 +08:00
|
|
|
void
|
|
|
|
gimp_text_editor_set_font_name (GimpTextEditor *editor,
|
|
|
|
const gchar *font_name)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_TEXT_EDITOR (editor));
|
|
|
|
|
|
|
|
if (editor->font_name)
|
|
|
|
g_free (editor->font_name);
|
|
|
|
|
|
|
|
editor->font_name = g_strdup (font_name);
|
|
|
|
|
|
|
|
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->font_toggle)))
|
|
|
|
{
|
|
|
|
PangoFontDescription *font_desc = NULL;
|
|
|
|
|
|
|
|
if (font_name)
|
|
|
|
font_desc = pango_font_description_from_string (font_name);
|
|
|
|
|
|
|
|
gtk_widget_modify_font (editor->view, font_desc);
|
|
|
|
|
|
|
|
if (font_desc)
|
|
|
|
pango_font_description_free (font_desc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const gchar *
|
|
|
|
gimp_text_editor_get_font_name (GimpTextEditor *editor)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_TEXT_EDITOR (editor), NULL);
|
|
|
|
|
|
|
|
return editor->font_name;
|
|
|
|
}
|
|
|
|
|
2003-02-02 05:50:21 +08:00
|
|
|
|
2004-11-04 22:24:32 +08:00
|
|
|
/* private functions */
|
2003-02-02 05:50:21 +08:00
|
|
|
|
2008-02-09 04:42:34 +08:00
|
|
|
static GtkWidget *
|
|
|
|
gimp_text_editor_language_entry_new (void)
|
|
|
|
{
|
|
|
|
GtkWidget *entry;
|
|
|
|
GtkListStore *store;
|
|
|
|
GtkEntryCompletion *completion;
|
|
|
|
|
|
|
|
entry = gtk_entry_new ();
|
|
|
|
|
|
|
|
completion = gtk_entry_completion_new ();
|
|
|
|
gtk_entry_completion_set_text_column (completion,
|
|
|
|
GIMP_LANGUAGE_STORE_LANGUAGE);
|
2008-02-09 04:52:03 +08:00
|
|
|
gtk_entry_completion_set_inline_completion (completion, TRUE);
|
2008-02-09 04:42:34 +08:00
|
|
|
|
|
|
|
store = gimp_language_store_new (FALSE);
|
|
|
|
gtk_entry_completion_set_model (completion, GTK_TREE_MODEL (store));
|
|
|
|
g_object_unref (store);
|
|
|
|
|
|
|
|
gtk_entry_set_completion (GTK_ENTRY (entry), completion);
|
|
|
|
g_object_unref (completion);
|
|
|
|
|
|
|
|
return entry;
|
|
|
|
}
|
|
|
|
|
2003-02-02 05:50:21 +08:00
|
|
|
static void
|
2004-11-04 22:24:32 +08:00
|
|
|
gimp_text_editor_text_changed (GtkTextBuffer *buffer,
|
|
|
|
GimpTextEditor *editor)
|
2003-02-02 05:50:21 +08:00
|
|
|
{
|
2004-11-04 22:24:32 +08:00
|
|
|
g_signal_emit (editor, text_editor_signals[TEXT_CHANGED], 0);
|
2003-02-02 05:50:21 +08:00
|
|
|
}
|
2005-06-11 22:18:51 +08:00
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_text_editor_font_toggled (GtkToggleButton *button,
|
|
|
|
GimpTextEditor *editor)
|
|
|
|
{
|
|
|
|
PangoFontDescription *font_desc = NULL;
|
|
|
|
|
|
|
|
if (gtk_toggle_button_get_active (button) && editor->font_name)
|
|
|
|
font_desc = pango_font_description_from_string (editor->font_name);
|
|
|
|
|
|
|
|
gtk_widget_modify_font (editor->view, font_desc);
|
|
|
|
|
|
|
|
if (font_desc)
|
|
|
|
pango_font_description_free (font_desc);
|
|
|
|
}
|