[]
        
(Showing Draft Content)

C1.Util.DX.DirectWrite.FontFileStream.ReadFileFragment

ReadFileFragment Method

ReadFileFragment(out IntPtr, long, long, out IntPtr)

Reads a fragment from a font file.

Declaration
void ReadFileFragment(out IntPtr fragmentStart, long fileOffset, long fragmentSize, out IntPtr fragmentContext)
Parameters
Type Name Description
IntPtr fragmentStart

When this method returns, contains an address of a reference to the start of the font file fragment. This parameter is passed uninitialized.

long fileOffset

The offset of the fragment, in bytes, from the beginning of the font file.

long fragmentSize

The size of the file fragment, in bytes.

IntPtr fragmentContext

When this method returns, contains the address of

Remarks

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 FontFileStream 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.