[]
IDWriteFontFileStream
[Guid("6d4865fe-0ab8-4d91-8f62-5dd6be34a3e0")]
public class FontFileStreamNative : ComObjectCallback, IUnknown, IFontFileStream, ICallbackable, IDisposable
Initializes a new instance of the FontFileStreamNative class.
public FontFileStreamNative(IntPtr nativePtr)
nativePtr
System.IntPtrThe native pointer.
HRESULT IDWriteFontFileStream::GetFileSize([Out] unsigned longlong* fileSize)
public long GetFileSize()
HRESULT IDWriteFontFileStream::GetLastWriteTime([Out] unsigned longlong* lastWriteTime)
public long GetLastWriteTime()
Reads a fragment from a font file.
public void ReadFileFragment(out IntPtr fragmentStart, long fileOffset, long fragmentSize, out IntPtr fragmentContext)
fragmentStart
System.IntPtrWhen this method returns, contains an address of a reference to the start of the font file fragment. This parameter is passed uninitialized.
fileOffset
longThe offset of the fragment, in bytes, from the beginning of the font file.
fragmentSize
longThe size of the file fragment, in bytes.
fragmentContext
System.IntPtrWhen this method returns, contains the address of
Note that ReadFileFragment implementations must check whether the requested font file fragment is within the file bounds. Otherwise, an error should be returned from ReadFileFragment. {{DirectWrite}} may invoke IFontFileStream methods on the same object from multiple threads simultaneously. Therefore, ReadFileFragment implementations that rely on internal mutable state must serialize access to such state across multiple threads. For example, an implementation that uses separate Seek and Read operations to read a file fragment must place the code block containing Seek and Read calls under a lock or a critical section.
Releases a fragment from a file.
public void ReleaseFileFragment(IntPtr fragmentContext)
fragmentContext
System.IntPtrA reference to the client-defined context of a font fragment returned from {{ReadFileFragment}}.
Performs an explicit conversion from System.IntPtr to FontFileStreamNative.
public static explicit operator FontFileStreamNative(IntPtr nativePointer)
nativePointer
System.IntPtr