diff options
author | Owen Taylor <owt1@cornell.edu> | 1998-03-28 00:10:49 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1998-03-28 00:10:49 +0000 |
commit | b2c30ad95d9e6d06592da25cf1490be3510b7946 (patch) | |
tree | 4d7a62ea8c8ff144031c9563920d18315bac782d /gdk | |
parent | f2cfc17be8bb73ff93ead9bfe6973223de4a598c (diff) | |
download | gtk+-b2c30ad95d9e6d06592da25cf1490be3510b7946.tar.gz |
Don't clear the window on an expose event. On draws, just clear the
Fri Mar 27 17:58:41 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkhandlebox.c (gtk_handle_box_paint): Don't clear
the window on an expose event. On draws, just clear the
portion we are redrawing.
* gdk/gdkfont.c (gdk_fontset_load): Corrected calculation
of fontset ascent/descent.
* gtk/gtkwidget.[ch]: Added new function to show a toplevel
window and wait for it to be mapped, gtk_window_show_now ()
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/gdkfont.c | 19 | ||||
-rw-r--r-- | gdk/x11/gdkfont-x11.c | 19 |
2 files changed, 28 insertions, 10 deletions
diff --git a/gdk/gdkfont.c b/gdk/gdkfont.c index c0c19ca2c9..8b45be3940 100644 --- a/gdk/gdkfont.c +++ b/gdk/gdkfont.c @@ -86,13 +86,22 @@ gdk_fontset_load (gchar *fontset_name) } else { - XFontSetExtents *extent = XExtentsOfFontSet(fontset); - + gint num_fonts; + gint i; + XFontStruct **font_structs; + gchar **font_names; + private->xfont = fontset; font->type = GDK_FONT_FONTSET; - /* how to define ascent and descent for fontset ??? */ - font->ascent = extent->max_logical_extent.height; - font->descent = font->ascent / 4 ; + num_fonts = XFontsOfFontSet (fontset, &font_structs, &font_names); + + font->ascent = font->descent = 0; + + for (i = 0; i < num_fonts; i++) + { + font->ascent = MAX (font->ascent, font_structs[i]->ascent); + font->descent = MAX (font->descent, font_structs[i]->descent); + } } return font; } diff --git a/gdk/x11/gdkfont-x11.c b/gdk/x11/gdkfont-x11.c index c0c19ca2c9..8b45be3940 100644 --- a/gdk/x11/gdkfont-x11.c +++ b/gdk/x11/gdkfont-x11.c @@ -86,13 +86,22 @@ gdk_fontset_load (gchar *fontset_name) } else { - XFontSetExtents *extent = XExtentsOfFontSet(fontset); - + gint num_fonts; + gint i; + XFontStruct **font_structs; + gchar **font_names; + private->xfont = fontset; font->type = GDK_FONT_FONTSET; - /* how to define ascent and descent for fontset ??? */ - font->ascent = extent->max_logical_extent.height; - font->descent = font->ascent / 4 ; + num_fonts = XFontsOfFontSet (fontset, &font_structs, &font_names); + + font->ascent = font->descent = 0; + + for (i = 0; i < num_fonts; i++) + { + font->ascent = MAX (font->ascent, font_structs[i]->ascent); + font->descent = MAX (font->descent, font_structs[i]->descent); + } } return font; } |