Example #1
0
		internal static IntPtr GlyphsToIntPtr (Glyph[] glyphs)
		{
			int size = Marshal.SizeOf (glyphs[0]);
			IntPtr dest = Marshal.AllocHGlobal (size * glyphs.Length);
			int pos = dest.ToInt32 ();
			for (int i = 0; i < glyphs.Length; i++, pos += size)
				Marshal.StructureToPtr (glyphs[i], (IntPtr) pos, false);
			return dest;
		}
Example #2
0
		public TextExtents GlyphExtents (Glyph[] glyphs)
		{
			IntPtr ptr = Context.FromGlyphToUnManagedMemory (glyphs);
			TextExtents extents;

			NativeMethods.cairo_scaled_font_glyph_extents (handle, ptr, glyphs.Length, out extents);

			Marshal.FreeHGlobal (ptr);
			return extents;
		}
Example #3
0
 public NativeGlyph_4byte_longs(Glyph source)
 {
     index = (int) source.index;
     x = source.x;
     y = source.y;
 }
Example #4
0
        internal static IntPtr FromGlyphToUnManagedMemory(Glyph [] glyphs)
        {
            IntPtr dest = Marshal.AllocHGlobal (native_glyph_size * glyphs.Length);
            long pos = dest.ToInt64();

            if (c_compiler_long_size == 8){
                foreach (Glyph g in glyphs){
                    Marshal.StructureToPtr (g, (IntPtr)pos, false);
                    pos += native_glyph_size;
                }
            } else {
                foreach (Glyph g in glyphs){
                    NativeGlyph_4byte_longs n = new NativeGlyph_4byte_longs (g);

                    Marshal.StructureToPtr (n, (IntPtr)pos, false);
                    pos += native_glyph_size;
                }
            }

            return dest;
        }
Example #5
0
 public void ShowGlyphs(Matrix matrix, Glyph[] glyphs)
 {
     ShowGlyphs (glyphs);
 }
Example #6
0
        public void ShowGlyphs(Glyph[] glyphs)
        {
            IntPtr ptr;

            ptr = FromGlyphToUnManagedMemory (glyphs);

            NativeMethods.cairo_show_glyphs (handle, ptr, glyphs.Length);

            Marshal.FreeHGlobal (ptr);
        }
Example #7
0
 public void GlyphPath(Matrix matrix, Glyph[] glyphs)
 {
     GlyphPath (glyphs);
 }
                public void GlyphPath (Matrix matrix, Glyph[] glyphs)
                {

                        IntPtr ptr;

                        ptr = FromGlyphToUnManagedMemory (glyphs);

                        CairoAPI.cairo_glyph_path (state, ptr, glyphs.Length);

                        Marshal.FreeHGlobal (ptr);

                }
Example #9
0
        public void GlyphPath(Glyph[] glyphs)
        {
            IntPtr ptr;

                        ptr = FromGlyphToUnManagedMemory (glyphs);

                        NativeMethods.cairo_glyph_path (state, ptr, glyphs.Length);

                        Marshal.FreeHGlobal (ptr);
        }
Example #10
0
        public void GlyphPath(Glyph[] glyphs)
        {
            CheckDisposed ();

            IntPtr ptr;

            ptr = FromGlyphToUnManagedMemory (glyphs);

            NativeMethods.cairo_glyph_path (handle, ptr, glyphs.Length);

            Marshal.FreeHGlobal (ptr);
        }
Example #11
0
        public TextExtents GlyphExtents(Glyph[] glyphs)
        {
            CheckDisposed ();

            IntPtr ptr = FromGlyphToUnManagedMemory (glyphs);

            TextExtents extents;

            NativeMethods.cairo_glyph_extents (handle, ptr, glyphs.Length, out extents);

            Marshal.FreeHGlobal (ptr);

            return extents;
        }
Example #12
0
 public NativeGlyph_4byte_longs(Glyph source)
 {
     index = (int)source.index;
     x     = source.x;
     y     = source.y;
 }