This commit is contained in:
Matthew Leibowitz 2017-04-21 07:25:27 +02:00
Родитель a8f0112894
Коммит dd901ae957
4 изменённых файлов: 30 добавлений и 2 удалений

Просмотреть файл

@ -57,11 +57,16 @@ namespace SkiaSharp
{
unsafe {
fixed (byte *b = &buffer [0]) {
return (int)SkiaApi.sk_stream_read (Handle, (IntPtr) b, (IntPtr)size);
return Read ((IntPtr) b, size);
}
}
}
public int Read (IntPtr buffer, int size)
{
return (int)SkiaApi.sk_stream_read (Handle, buffer, (IntPtr)size);
}
public int Skip (int size)
{
return (int)SkiaApi.sk_stream_skip (Handle, (IntPtr)size);
@ -81,6 +86,11 @@ namespace SkiaSharp
{
return SkiaApi.sk_stream_move (Handle, offset);
}
public IntPtr GetMemoryBase ()
{
return SkiaApi.sk_stream_get_memory_base (Handle);
}
public bool HasPosition {
get {

Просмотреть файл

@ -137,6 +137,8 @@ namespace SkiaSharp
public SKFontStyleSlant FontSlant => SkiaApi.sk_typeface_get_font_slant (Handle);
public SKTypefaceStyle Style => SkiaApi.sk_typeface_get_style (Handle);
public int UnitsPerEm => SkiaApi.sk_typeface_get_units_per_em(Handle);
public UInt32[] GetTableTags()
{
int tableCount = SkiaApi.sk_typeface_count_tables(Handle);
@ -171,6 +173,16 @@ namespace SkiaSharp
return true;
}
public SKStreamAsset OpenStream()
{
int ttcIndex;
return OpenStream(out ttcIndex);
}
public SKStreamAsset OpenStream(out int ttcIndex)
{
return GetObject<SKStreamAssetImplementation>(SkiaApi.sk_typeface_open_stream(Handle, out ttcIndex));
}
}
}

Просмотреть файл

@ -957,6 +957,10 @@ namespace SkiaSharp
public extern static SKFontStyleSlant sk_typeface_get_font_slant(sk_typeface_t typeface);
[DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]
public extern static SKTypefaceStyle sk_typeface_get_style(sk_typeface_t typeface);
[DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]
public extern static sk_stream_assetstream_t sk_typeface_open_stream(sk_typeface_t typeface, out int ttcIndex);
[DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]
public extern static int sk_typeface_get_units_per_em(sk_typeface_t typeface);
// FontMgr
[DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]
@ -1020,6 +1024,8 @@ namespace SkiaSharp
[DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]
public extern static IntPtr sk_stream_get_length(sk_stream_t stream);
[DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]
public extern static IntPtr sk_stream_get_memory_base(sk_stream_t cstream);
[DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]
public extern static sk_stream_filestream_t sk_filestream_new([MarshalAs(UnmanagedType.LPStr)] string path);
[DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]
public extern static sk_stream_memorystream_t sk_memorystream_new();

2
externals/skia поставляемый

@ -1 +1 @@
Subproject commit b65d8510ebb7b160ab2ba4d10170c04651d516dd
Subproject commit e989b31f4a42ffac94e2b8acbea5a935d6d65cbd