[Gtk-sharp-list] DrawGlyphs
John Luke
jluke@users.sourceforge.net
Tue, 04 May 2004 16:33:58 -0400
On Mon, 2004-05-03 at 21:54 +0200, Morten Krog wrote:
> Can somebody give me a hint to how one should draw text in a Gdk.Window?
>
> DrawGlyphs seems to be the only GTK method wrapped currently and it
> takes all sorts of Pango-arguments; most of those seems unsupported
> right now.
>
> Furthermore: Pango seems to be kinda overkill if you simply want to draw
> some short text at a fixed position.
>
> I know this seems like a pretty simple question and I am kinda
> embarresed to ask it in the first place. I, on the other hand, have
> absolutely no idea on how to handle this with the information I have at
> the moment.
>
> /Morten Krog
>
I added a small example of how to do this to monodoc just the other day,
or if you don't yet have it look here:
http://cvs.hispalinux.es/cgi-bin/cvsweb/gtk-sharp/doc/en/Pango/Layout.xml?rev=1.16&content-type=text/x-cvsweb-markup&cvsroot=mono
If you need something more complicated than just setting the
FontDescription. You probably need to use Layout.SetMarkup instead of
the Layout.Attributes directly as they are broken I believe.
There was another way to draw text before pango, but it's the only
non-deprecated way now and it looks much nicer.