[]
        
(Showing Draft Content)

GrapeCity.Documents.DX.DirectWrite.IFontFileStream

Interface IFontFileStream

Namespace
GrapeCity.Documents.DX.DirectWrite
Assembly
GcDocs.DX.Windows.dll

IDWriteFontFileStream

[Guid("6d4865fe-0ab8-4d91-8f62-5dd6be34a3e0")]
[Shadow(typeof(FontFileStreamShadow))]
public interface IFontFileStream : ICallbackable, IDisposable
Inherited Members
System.IDisposable.Dispose()

Methods

GetFileSize()

Obtains the total size of a file.

long GetFileSize()

Returns

long

the total size of the file.

Remarks

Implementing GetFileSize() for asynchronously loaded font files may require downloading the complete file contents. Therefore, this method should be used only for operations that either require a complete font file to be loaded (for example, copying a font file) or that need to make decisions based on the value of the file size (for example, validation against a persisted file size).

GetLastWriteTime()

Obtains the last modified time of the file.

long GetLastWriteTime()

Returns

long

the last modified time of the file in the format that represents the number of 100-nanosecond intervals since January 1, 1601 (UTC).

Remarks

The "last modified time" is used by DirectWrite font selection algorithms to determine whether one font resource is more up to date than another one.

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

Reads a fragment from a font file.

void ReadFileFragment(out IntPtr fragmentStart, long fileOffset, long fragmentSize, out IntPtr fragmentContext)

Parameters

fragmentStart System.IntPtr

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

fileOffset long

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

fragmentSize long

The size of the file fragment, in bytes.

fragmentContext System.IntPtr

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

ReleaseFileFragment(IntPtr)

Releases a fragment from a file.

void ReleaseFileFragment(IntPtr fragmentContext)

Parameters

fragmentContext System.IntPtr

A reference to the client-defined context of a font fragment returned from {{ReadFileFragment}}.