Solved - with a neat workaround.
Using the 'layout' sample code from the sole Mono example, it was very
easy to use DrawLayout instead of DrawGlyphs, now that everything else
is sorted.
DrawGlyphs was possibly overkill, useful for Hebrew, Arabic, Mandarin
etc, but not strictly necessary for standard English fonts.
Nice feature is that when I use the Font selection button on my GUI, the
text updates without hitting the write button again.
Here's the central code:
Pango.Layout layout = new Pango.Layout(this.PangoContext);
layout.Width = Pango.Units.FromPixels(400);//the 400 is width
layout.Wrap = Pango.WrapMode.Word;
layout.Alignment = Pango.Alignment.Left;
layout.FontDescription =
Pango.FontDescription.FromString(fontbutton1.FontName );
layout.SetMarkup("<span color=" + (char)34 + "blue" + (char)34 + ">" +
"Simon" + "</span>");
Gdk.Window drawable = drawingarea1.GdkWindow ;
Gdk.GC glick = new Gdk.GC(drawable);
drawable.DrawLayout( glick, 20, 20, layout);
Simono
--
Next meeting: Crown Hotel, Blandford Forum, Tuesday 2010-11-02 20:00
Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/
How to Report Bugs Effectively: http://goo.gl/4Xue