static int iScintillaSetFontAttrib(Ihandle* ih, const char* value) { if (!ih->handle) return iupdrvSetFontAttrib(ih, value); else { int i, size = 0, is_bold = 0, is_italic = 0, is_underline = 0, is_strikeout = 0; char typeface[1024]; if (!iupdrvSetFontAttrib(ih, value)) return 0; if (!iupGetFontInfo(value, typeface, &size, &is_bold, &is_italic, &is_underline, &is_strikeout)) return 0; for (i = 0; i < 256; i++) { IupScintillaSendMessage(ih, SCI_STYLESETFONT, i, (sptr_t)typeface); IupScintillaSendMessage(ih, SCI_STYLESETSIZE, i, size); IupScintillaSendMessage(ih, SCI_STYLESETBOLD, i, is_bold); IupScintillaSendMessage(ih, SCI_STYLESETITALIC, i, is_italic); IupScintillaSendMessage(ih, SCI_STYLESETUNDERLINE, i, is_underline); } return 1; } }
static int gtkTabsSetFontAttrib(Ihandle* ih, const char* value) { iupdrvSetFontAttrib(ih, value); if (ih->handle) gtkTabsUpdatePageFont(ih); return 1; }
static int gtkFrameSetFontAttrib(Ihandle* ih, const char* value) { iupdrvSetFontAttrib(ih, value); if (ih->handle) { GtkWidget* label = gtk_frame_get_label_widget((GtkFrame*)ih->handle); if (label) iupgtkUpdateWidgetFont(ih, (GtkWidget*)label); } return 1; }
static int gtkToggleSetFontAttrib(Ihandle* ih, const char* value) { if (!iupdrvSetFontAttrib(ih, value)) return 0; if (ih->handle) { GtkWidget* label = gtk_button_get_image((GtkButton*)ih->handle); if (label) iupgtkUpdateWidgetFont(ih, label); } return 1; }
static int motFrameSetFontAttrib(Ihandle* ih, const char* value) { iupdrvSetFontAttrib(ih, value); if (ih->handle) { XmFontList fontlist; Widget title_label = (Widget)iupAttribGet(ih, "_IUPMOT_FRAMELABEL"); if (!title_label) return 1; fontlist = (XmFontList)iupmotGetFontListAttrib(ih); XtVaSetValues(title_label, XmNrenderTable, fontlist, NULL); } return 1; }