/// Gets the key used to identify the FontCollection as well as storing index for fonts.
/// </summary>
/// <value>The key.</value>
publicDataStreamKey
{
get
{
return_keyStream;
}
}
/// <summary>
/// Creates a font file enumerator object that encapsulates a collection of font files. The font system calls back to this interface to create a font collection.
/// </summary>
/// <param name="factory">Pointer to the <see cref="SharpDX.DirectWrite.Factory"/> object that was used to create the current font collection.</param>
/// <param name="collectionKey">A font collection key that uniquely identifies the collection of font files within the scope of the font collection loader being used. The buffer allocated for this key must be at least the size, in bytes, specified by collectionKeySize.</param>
/// <returns>
/// a reference to the newly created font file enumerator.
/// Creates a font file stream object that encapsulates an open file resource.
/// </summary>
/// <param name="fontFileReferenceKey">A reference to a font file reference key that uniquely identifies the font file resource within the scope of the font loader being used. The buffer allocated for this key must at least be the size, in bytes, specified by fontFileReferenceKeySize.</param>
/// <returns>
/// a reference to the newly created <see cref="SharpDX.DirectWrite.FontFileStream"/> object.
/// </returns>
/// <remarks>
/// The resource is closed when the last reference to fontFileStream is released.
/// Initializes a new instance of the <see cref="ResourceFontFileStream"/> class.
/// </summary>
/// <param name="stream">The stream.</param>
publicResourceFontFileStream(DataStreamstream)
{
this._stream=stream;
}
/// <summary>
/// Reads a fragment from a font file.
/// </summary>
/// <param name="fragmentStart">When this method returns, contains an address of a reference to the start of the font file fragment. This parameter is passed uninitialized.</param>
/// <param name="fileOffset">The offset of the fragment, in bytes, from the beginning of the font file.</param>
/// <param name="fragmentSize">The size of the file fragment, in bytes.</param>
/// <param name="fragmentContext">When this method returns, contains the address of</param>
/// <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 <see cref="SharpDX.DirectWrite.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.
/// <returns>the total size of the file.</returns>
/// <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).
/// the last modified time of the file in the format that represents the number of 100-nanosecond intervals since January 1, 1601 (UTC).
/// </returns>
/// <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.
/// Advances to the next font file in the collection. When it is first created, the enumerator is positioned before the first element of the collection and the first call to MoveNext advances to the first file.
/// </summary>
/// <returns>
/// the value TRUE if the enumerator advances to a file; otherwise, FALSE if the enumerator advances past the last file in the collection.