public GlyphItem[] ApplyAttrs (string text, Pango.AttrList list) { IntPtr native_text = GLib.Marshaller.StringToPtrGStrdup (text); IntPtr list_handle = pango_glyph_item_apply_attrs (ref this, native_text, list.Handle); GLib.Marshaller.Free (native_text); if (list_handle == IntPtr.Zero) return new GlyphItem [0]; GLib.SList item_list = new GLib.SList (list_handle, typeof (GlyphItem)); GlyphItem[] result = new GlyphItem [item_list.Count]; int i = 0; foreach (GlyphItem item in item_list) result [i++] = item; return result; }
public GlyphItem[] ApplyAttrs(string text, Pango.AttrList list) { IntPtr native_text = GLib.Marshaller.StringToPtrGStrdup(text); IntPtr list_handle = pango_glyph_item_apply_attrs(ref this, native_text, list.Handle); GLib.Marshaller.Free(native_text); if (list_handle == IntPtr.Zero) { return(new GlyphItem [0]); } GLib.SList item_list = new GLib.SList(list_handle, typeof(GlyphItem)); GlyphItem[] result = new GlyphItem [item_list.Count]; int i = 0; foreach (GlyphItem item in item_list) { result [i++] = item; } return(result); }