Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv8137/src/cbits/GTK
Modified Files:
FontDialog.c
Log Message:
bugfixes
Index: FontDialog.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/FontDialog.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FontDialog.c 16 Mar 2003 23:48:13 -0000 1.1
--- FontDialog.c 18 Mar 2003 11:39:56 -0000 1.2
***************
*** 1,38 ****
! #include "FontDialog.h"
!
! BOOL osRunFontDialog(char **fname, int *fsize, int *fweight, int *fstyle, BOOL *funderline, BOOL *fstrikeout)
! {
! GtkWidget *font_dialog;
!
! font_dialog = gtk_font_selection_dialog_new("Font");
! if (gtk_dialog_run(GTK_DIALOG(font_dialog)) == GTK_RESPONSE_OK)
! {
! gchar font_name;
! PangoFontDescription *font_descr;
!
! font_name = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(font_dialog));
! font_descr = pango_font_description_from_string(font_name);
!
! *fname = strdup(pango_font_description_get_family(font_descr));
! *fsize = pango_font_description_get_size(font_descr)/PANGO_SCALE;
! *fweight = pango_font_description_get_weight(desc);
!
! switch (pango_font_description_get_style(desc))
! {
! case PANGO_STYLE_NORMAL: *fstyle = 0; break;
! case PANGO_STYLE_OBLIQUE: *fstyle = 1; break;
! case PANGO_STYLE_ITALIC: *fstyle = 2; break;
! default: *fstyle = -1; break;
! }
!
! *funderline = FALSE;
! *fstrikeout = FALSE;
!
! pango_font_description_free(font_descr);
!
! return TRUE;
! }
! gtk_widget_destroy (color_dialog);
!
! return FALSE;
! }
\ No newline at end of file
--- 1,38 ----
! #include "FontDialog.h"
!
! BOOL osRunFontDialog(char **fname, int *fsize, int *fweight, int *fstyle, BOOL *funderline, BOOL *fstrikeout)
! {
! GtkWidget *font_dialog;
!
! font_dialog = gtk_font_selection_dialog_new("Font");
! if (gtk_dialog_run(GTK_DIALOG(font_dialog)) == GTK_RESPONSE_OK)
! {
! gchar font_name;
! PangoFontDescription *font_descr;
!
! font_name = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(font_dialog));
! font_descr = pango_font_description_from_string(font_name);
!
! *fname = strdup(pango_font_description_get_family(font_descr));
! *fsize = pango_font_description_get_size(font_descr)/PANGO_SCALE;
! *fweight = pango_font_description_get_weight(font_descr);
!
! switch (pango_font_description_get_style(font_descr))
! {
! case PANGO_STYLE_NORMAL: *fstyle = 0; break;
! case PANGO_STYLE_OBLIQUE: *fstyle = 1; break;
! case PANGO_STYLE_ITALIC: *fstyle = 2; break;
! default: *fstyle = -1; break;
! }
!
! *funderline = FALSE;
! *fstrikeout = FALSE;
!
! pango_font_description_free(font_descr);
!
! return TRUE;
! }
! gtk_widget_destroy (font_dialog);
!
! return FALSE;
! }
|