Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IDWriteFontFileStream::ReadFileFragment method

Reads a fragment from a font file.

Syntax


virtual HRESULT ReadFileFragment(
  [out] const void   ** fragmentStart,
              UINT64  fileOffset,
              UINT64  fragmentSize,
  [out]       void   ** fragmentContext
) = 0;

Parameters

fragmentStart [out]

Type: const void**

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

fileOffset

Type: UINT64

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

fragmentSize

Type: UINT64

The size of the file fragment, in bytes.

fragmentContext [out]

Type: void**

When this method returns, contains the address of a pointer to a pointer to the client-defined context to be passed to ReleaseFileFragment.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

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

Requirements

Minimum supported client

Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Header

Dwrite.h

Library

Dwrite.lib

DLL

Dwrite.dll

See also

IDWriteFontFileStream

 

 

Show:
© 2017 Microsoft