Re: font handling confusion (in gtk-demo)

martine cs washington edu (Evan Martin) writes:
> I recently began the process of porting an app to the new GTK (it'll be
> out RSN, right?) and I needed to update some code that was using the old
> GtkText widget.   Some of the text needs to be monospaced (server
> responses), but I can't for the life of me figure out how to set up an
> appropriate tag to achieve a "monospaced font" effect.
> After looking through a variety of pages and documentation, I noticed
> this in the gtk-demo source:
>   if (is_source)
>       {
>             font_desc = pango_font_description_from_string ("Courier
> 	    12");
> Is hardcoding a font name like "Courier 12" considered ok practice?

Not really, you might want to file a bugzilla report against gtk-demo
since it should be a good demo.

The alias "monospace" is supposed to be guaranteed to exist on every
GTK 2 installation. If it doesn't get installed now it should be
fixed. If we fix gtk-demo to use the right alias then bugs should
become evident quickly.

(The other "guaranteed" font names are "sans" and "serif")


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]