public SKStreamAsset OpenStream(out int ttcIndex) { fixed(int *ttc = &ttcIndex) { return(SKStreamAsset.GetObject(SkiaApi.sk_typeface_open_stream(Handle, ttc))); } }
public static SKTypeface FromStream (SKStreamAsset stream, int index = 0) { if (stream == null) throw new ArgumentNullException (nameof (stream)); var typeface = GetObject<SKTypeface> (SkiaApi.sk_typeface_create_from_stream (stream.Handle, index)); stream.RevokeOwnership (typeface); return typeface; }
public static SKTypeface FromStream(SKStreamAsset stream, int index = 0) { if (stream == null) { throw new ArgumentNullException("stream"); } return(GetObject <SKTypeface> (SkiaApi.sk_typeface_create_from_stream(stream.Handle, index))); }
public static SKTypeface FromStream(SKStreamAsset stream, int index = 0) { if (stream == null) { throw new ArgumentNullException(nameof(stream)); } var typeface = GetObject <SKTypeface> (SkiaApi.sk_typeface_create_from_stream(stream.Handle, index)); stream.RevokeOwnership(); return(typeface); }
public SKTypeface CreateTypeface(SKStreamAsset stream, int index = 0) { if (stream == null) { throw new ArgumentNullException(nameof(stream)); } if (stream is SKManagedStream managed) { stream = managed.ToMemoryStream(); managed.Dispose(); } var typeface = GetObject <SKTypeface> (SkiaApi.sk_fontmgr_create_from_stream(Handle, stream.Handle, index)); stream.RevokeOwnership(typeface); return(typeface); }