Problem With Setting Font to Display Text in a TextView
- From: Jim Orcheson <jim va3hj ca>
- To: gtkmm-list gnome org
- Subject: Problem With Setting Font to Display Text in a TextView
- Date: Sat, 15 May 2010 15:19:22 -0400
Suppose I have an application with a window containing both a TextView
and a FontButton. I want to display the text in the TextView using the
font selected via the FontButton.
The Textview is called textview, and the FontButton is called
fontbutton. Here is sample code in the on_font_set routine:
Pango::FontDescription *fd = new Pango::FontDescription;
fd->set_family(fontbutton.get_font_name());
textview.modify_font(*fd);
This works for a limited set of the fonts listed in the font selection
dialog opened by clicking on the FontButton. If I select Arial, Arial
Black, orTimes New Roman., the text in the TextView is displayed in the
requested font; if I select any other font, the text remains in the old
font.
What am I missing here?
Jim
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]