Пример #1
0
        public Pango.LogAttr GetLogAttrsReadonly(out int n_attrs)
        {
            IntPtr raw_ret = pango_layout_get_log_attrs_readonly(Handle, out n_attrs);

            Pango.LogAttr ret = Pango.LogAttr.New(raw_ret);
            return(ret);
        }
Пример #2
0
        public void LetterSpace(string text, Pango.LogAttr log_attrs, int letter_spacing)
        {
            IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal(System.Runtime.InteropServices.Marshal.SizeOf(this));

            System.Runtime.InteropServices.Marshal.StructureToPtr(this, this_as_native, false);
            IntPtr native_text      = GLib.Marshaller.StringToPtrGStrdup(text);
            IntPtr native_log_attrs = GLib.Marshaller.StructureToPtrAlloc(log_attrs);

            pango_glyph_item_letter_space(this_as_native, native_text, native_log_attrs, letter_spacing);
            ReadNative(this_as_native, ref this);
            System.Runtime.InteropServices.Marshal.FreeHGlobal(this_as_native);
            GLib.Marshaller.Free(native_text);
            Marshal.FreeHGlobal(native_log_attrs);
        }
Пример #3
0
        public static void GetLogAttrs(string text, int level, Pango.Language language, Pango.LogAttr log_attrs, int attrs_len)
        {
            IntPtr native_text      = GLib.Marshaller.StringToPtrGStrdup(text);
            IntPtr native_log_attrs = GLib.Marshaller.StructureToPtrAlloc(log_attrs);

            pango_get_log_attrs(native_text, System.Text.Encoding.UTF8.GetByteCount(text), level, language == null ? IntPtr.Zero : language.Handle, native_log_attrs, attrs_len);
            GLib.Marshaller.Free(native_text);
            Marshal.FreeHGlobal(native_log_attrs);
        }