[Gtk-sharp-list] Changing font size on a label

Aaron Oxford aaron at hardwarehookups.com.au
Tue Oct 16 07:39:40 EDT 2007


For the benefit of any poor soul searching this list for a way to 
change the font on a label in Gtk# (Novell Win32 2.8.3):

Pango.FontDescription fd = Pango.FontDescription.FromString("Arial 
7"); // small font
Label l = new Label("Wiggity");
l.ModifyFont(fd);

As with all things in Gtk#, not difficult, just inflexible and not 
documented anywhere. For the record:

Pango.FontDescription fd = new Pango.FontDescription();
fd.Family = "Arial";
fd.Size = 7.0;

Does NOT work.

At least now in a few days time Googling 'gtk font label -php' might. :-)

Aaron.
---------------------------------------------------------------------------------
Aaron Oxford   -   aaron+hardwarehookups .com .au
Director, Innovative Computer Solutions (Aust) Pty. Ltd.
49 Maitland Rd, Mayfield, NSW 2304 Australia
http://www.ic-solutions.com.au
Developer, SourceForge project VioLet Composer
http://sourceforge.net/projects/buzz-like



More information about the Gtk-sharp-list mailing list