public void Shape(Buffer buffer, params Feature[] features) { if (buffer == null) { throw new ArgumentNullException(nameof(buffer)); } if (features == null || features.Length == 0) { HarfBuzzApi.hb_shape(Handle, buffer.Handle, IntPtr.Zero, 0); } else { var ptr = StructureArrayToPtr(features); HarfBuzzApi.hb_shape(Handle, buffer.Handle, ptr, (uint)features.Length); Marshal.FreeCoTaskMem(ptr); } }