[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Pango with a GtkDrawingArea? (what to use instead of GdkFont?)
- From: Owen Taylor <otaylor redhat com>
- To: gtk-app-devel-list gnome org, kmccarty princeton edu
- Subject: Re: Pango with a GtkDrawingArea? (what to use instead of GdkFont?)
- Date: 04 May 2003 10:25:09 -0400
On Sun, 2003-05-04 at 05:07, Filip Van Raemdonck wrote:
> On Fri, May 02, 2003 at 11:09:18AM -0400, Kevin B. McCarty wrote:
> >
> > - what should I use instead of GdkFont?
>
> Pango Layouts
>
> > - how do I get it to use the output of a GtkFontSelectionDialog
> > (looking like "Sans 12") instead of an XLFD ("-adobe-helvetica...")?
> > The following just results in a segfault:
> > GdkFont *font =
> > gdk_font_from_description(pango_font_description_from_string("Sans 12"));
> > and I don't want to continue to use the deprecated GdkFont anyway.
>
> I'm not familiar with that dialog, but pango_layout_set_font_description
> accepts its kind of output.
>
> > - what should I use instead of gdk_draw_text() to replace the second
> > GdkFont argument after switching to Pango?
>
> gtk_paint_layout (documentation in the Style chapter of the GTK+ API
> reference - took me a while to find it there) or gdk_draw_layout for more
> lowlevel stuff.
gtk_paint_layout() should generally be avoided; it's only real feature
is to draw text differently in the insensitive state, and it has
all sorts of confusing and possibly tricky parameters. I'd recommend
just using gdk_draw_layout().
Regards,
Owen
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]