gnome-terminal r2580 - trunk/src
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-terminal r2580 - trunk/src
- Date: Thu, 29 May 2008 19:35:30 +0000 (UTC)
Author: chpe
Date: Thu May 29 19:35:30 2008
New Revision: 2580
URL: http://svn.gnome.org/viewvc/gnome-terminal?rev=2580&view=rev
Log:
Use vte_terminal_set_font directly.
Modified:
trunk/src/terminal-screen.c
trunk/src/terminal-widget-vte.c
trunk/src/terminal-widget.h
Modified: trunk/src/terminal-screen.c
==============================================================================
--- trunk/src/terminal-screen.c (original)
+++ trunk/src/terminal-screen.c Thu May 29 19:35:30 2008
@@ -816,12 +816,12 @@
{
TerminalScreenPrivate *priv = screen->priv;
TerminalProfile *profile;
- GtkWidget *term;
PangoFontDescription *desc;
-
- term = priv->term;
+ gboolean no_aa_without_render;
+
profile = priv->profile;
+ /* FIXMEchpe make this use a get_font_desc on TerminalProfile */
if (terminal_profile_get_use_system_font (profile))
desc = get_system_monospace_font ();
else
@@ -831,8 +831,29 @@
priv->font_scale *
pango_font_description_get_size (desc));
- terminal_widget_set_pango_font (term, desc,
- terminal_profile_get_no_aa_without_render (profile));
+ no_aa_without_render = terminal_profile_get_no_aa_without_render (profile);
+ if (!no_aa_without_render)
+ {
+ vte_terminal_set_font (VTE_TERMINAL (screen), desc);
+ }
+ else
+ {
+ Display *dpy;
+ gboolean has_render;
+ gint event_base, error_base;
+
+ /* FIXME multi-head/mult-screen! */
+ dpy = gdk_x11_display_get_xdisplay (gtk_widget_get_display (GTK_WIDGET (screen)));
+ has_render = (XRenderQueryExtension (dpy, &event_base, &error_base) &&
+ (XRenderFindVisualFormat (dpy, DefaultVisual (dpy, DefaultScreen (dpy))) != NULL));
+
+ if (has_render)
+ vte_terminal_set_font (VTE_TERMINAL (screen), desc);
+ else
+ vte_terminal_set_font_full (VTE_TERMINAL (screen),
+ desc,
+ VTE_ANTI_ALIAS_FORCE_DISABLE);
+ }
pango_font_description_free (desc);
}
Modified: trunk/src/terminal-widget-vte.c
==============================================================================
--- trunk/src/terminal-widget-vte.c (original)
+++ trunk/src/terminal-widget-vte.c Thu May 29 19:35:30 2008
@@ -513,32 +513,3 @@
{
vte_terminal_feed_child(VTE_TERMINAL(widget), data, len);
}
-
-void
-terminal_widget_set_pango_font (GtkWidget *widget,
- const PangoFontDescription *font_desc,
- gboolean no_aa_without_render)
-{
- g_return_if_fail (font_desc != NULL);
-
- if (!no_aa_without_render)
- vte_terminal_set_font (VTE_TERMINAL (widget), font_desc);
-
- else
- {
- Display *dpy;
- gboolean has_render;
- gint event_base, error_base;
-
- dpy = gdk_x11_display_get_xdisplay (gdk_display_get_default ());
- has_render = (XRenderQueryExtension (dpy, &event_base, &error_base) &&
- (XRenderFindVisualFormat (dpy, DefaultVisual (dpy, DefaultScreen (dpy))) != NULL));
-
- if (has_render)
- vte_terminal_set_font (VTE_TERMINAL (widget), font_desc);
- else
- vte_terminal_set_font_full (VTE_TERMINAL (widget),
- font_desc,
- VTE_ANTI_ALIAS_FORCE_DISABLE);
- }
-}
Modified: trunk/src/terminal-widget.h
==============================================================================
--- trunk/src/terminal-widget.h (original)
+++ trunk/src/terminal-widget.h Thu May 29 19:35:30 2008
@@ -141,12 +141,6 @@
const char *data,
int len);
-void terminal_widget_set_pango_font (GtkWidget *widget,
- const PangoFontDescription *font_desc,
- gboolean anti_alias);
-
-gboolean terminal_widget_supports_pango_fonts (void);
-
G_END_DECLS
#endif /* TERMINAL_WIDGET_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]