Headers diff for dwrite.dll between 6.2.9200.17568-Windows_7.0 and 6.3.9600.17415-Windows_8.1 versions



 dwrite.h (6.2.9200.17568-Windows_7.0)   dwrite.h (6.3.9600.17415-Windows_8.1) 
skipping to change at line 122 skipping to change at line 122
DWRITE_FONT_FACE_TYPE_VECTOR, DWRITE_FONT_FACE_TYPE_VECTOR,
/// <summary> /// <summary>
/// A bitmap .FON format font face. /// A bitmap .FON format font face.
/// </summary> /// </summary>
DWRITE_FONT_FACE_TYPE_BITMAP, DWRITE_FONT_FACE_TYPE_BITMAP,
/// <summary> /// <summary>
/// Font face type is not recognized by the DirectWrite font system. /// Font face type is not recognized by the DirectWrite font system.
/// </summary> /// </summary>
DWRITE_FONT_FACE_TYPE_UNKNOWN DWRITE_FONT_FACE_TYPE_UNKNOWN,
/// <summary>
/// The font data includes only the CFF table from an OpenType CFF font.
/// This font face type can be used only for embedded fonts (i.e., custom
/// font file loaders) and the resulting font face object supports only the
/// minimum functionality necessary to render glyphs.
/// </summary>
DWRITE_FONT_FACE_TYPE_RAW_CFF
}; };
/// <summary> /// <summary>
/// Specifies algorithmic style simulations to be applied to the font face. /// Specifies algorithmic style simulations to be applied to the font face.
/// Bold and oblique simulations can be combined via bitwise OR operation. /// Bold and oblique simulations can be combined via bitwise OR operation.
/// </summary> /// </summary>
enum DWRITE_FONT_SIMULATIONS enum DWRITE_FONT_SIMULATIONS
{ {
/// <summary> /// <summary>
/// No simulations are performed. /// No simulations are performed.
skipping to change at line 178 skipping to change at line 186
/// Predefined font weight : Ultra-light (200). /// Predefined font weight : Ultra-light (200).
/// </summary> /// </summary>
DWRITE_FONT_WEIGHT_ULTRA_LIGHT = 200, DWRITE_FONT_WEIGHT_ULTRA_LIGHT = 200,
/// <summary> /// <summary>
/// Predefined font weight : Light (300). /// Predefined font weight : Light (300).
/// </summary> /// </summary>
DWRITE_FONT_WEIGHT_LIGHT = 300, DWRITE_FONT_WEIGHT_LIGHT = 300,
/// <summary> /// <summary>
/// Predefined font weight : Semi-light (350).
/// </summary>
DWRITE_FONT_WEIGHT_SEMI_LIGHT = 350,
/// <summary>
/// Predefined font weight : Normal (400). /// Predefined font weight : Normal (400).
/// </summary> /// </summary>
DWRITE_FONT_WEIGHT_NORMAL = 400, DWRITE_FONT_WEIGHT_NORMAL = 400,
/// <summary> /// <summary>
/// Predefined font weight : Regular (400). /// Predefined font weight : Regular (400).
/// </summary> /// </summary>
DWRITE_FONT_WEIGHT_REGULAR = 400, DWRITE_FONT_WEIGHT_REGULAR = 400,
/// <summary> /// <summary>
skipping to change at line 409 skipping to change at line 422
DWRITE_INFORMATIONAL_STRING_PREFERRED_FAMILY_NAMES, DWRITE_INFORMATIONAL_STRING_PREFERRED_FAMILY_NAMES,
/// <summary> /// <summary>
/// Subfamily name preferred by the designer. This name is typically only pr esent if it differs from the GDI-compatible subfamily name. /// Subfamily name preferred by the designer. This name is typically only pr esent if it differs from the GDI-compatible subfamily name.
/// </summary> /// </summary>
DWRITE_INFORMATIONAL_STRING_PREFERRED_SUBFAMILY_NAMES, DWRITE_INFORMATIONAL_STRING_PREFERRED_SUBFAMILY_NAMES,
/// <summary> /// <summary>
/// Sample text. This can be the font name or any other text that the design er thinks is the best example to display the font in. /// Sample text. This can be the font name or any other text that the design er thinks is the best example to display the font in.
/// </summary> /// </summary>
DWRITE_INFORMATIONAL_STRING_SAMPLE_TEXT DWRITE_INFORMATIONAL_STRING_SAMPLE_TEXT,
/// <summary>
/// The full name of the font, e.g. "Arial Bold", from name id 4 in the name
table.
/// </summary>
DWRITE_INFORMATIONAL_STRING_FULL_NAME,
/// <summary>
/// The postscript name of the font, e.g. "GillSans-Bold" from name id 6 in
the name table.
/// </summary>
DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_NAME,
/// <summary>
/// The postscript CID findfont name, from name id 20 in the name table.
/// </summary>
DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_CID_NAME
}; };
/// <summary> /// <summary>
/// The DWRITE_FONT_METRICS structure specifies the metrics of a font face that /// The DWRITE_FONT_METRICS structure specifies the metrics of a font face that
/// are applicable to all glyphs within the font face. /// are applicable to all glyphs within the font face.
/// </summary> /// </summary>
struct DWRITE_FONT_METRICS struct DWRITE_FONT_METRICS
{ {
/// <summary> /// <summary>
/// The number of font design units per em unit. /// The number of font design units per em unit.
/// Font files use their own coordinate system of font design units. /// Font files use their own coordinate system of font design units.
/// A font design unit is the smallest measurable unit in the em square, /// A font design unit is the smallest measurable unit in the em square,
/// an imaginary square that is used to size and align glyphs. /// an imaginary square that is used to size and align glyphs.
/// The concept of em square is used as a reference scale factor when defini ng font size and device transformation semantics. /// The concept of em square is used as a reference scale factor when defini ng font size and device transformation semantics.
/// The size of one em square is also commonly used to compute the paragraph identation value. /// The size of one em square is also commonly used to compute the paragraph indentation value.
/// </summary> /// </summary>
UINT16 designUnitsPerEm; UINT16 designUnitsPerEm;
/// <summary> /// <summary>
/// Ascent value of the font face in font design units. /// Ascent value of the font face in font design units.
/// Ascent is the distance from the top of font character alignment box to E nglish baseline. /// Ascent is the distance from the top of font character alignment box to E nglish baseline.
/// </summary> /// </summary>
UINT16 ascent; UINT16 ascent;
/// <summary> /// <summary>
skipping to change at line 541 skipping to change at line 569
/// <summary> /// <summary>
/// Specifies the Y coordinate of a glyph's vertical origin, in the font's d esign coordinate system. /// Specifies the Y coordinate of a glyph's vertical origin, in the font's d esign coordinate system.
/// The y coordinate of a glyph's vertical origin is the sum of the glyph's top side bearing /// The y coordinate of a glyph's vertical origin is the sum of the glyph's top side bearing
/// and the top (i.e. yMax) of the glyph's bounding box. /// and the top (i.e. yMax) of the glyph's bounding box.
/// </summary> /// </summary>
INT32 verticalOriginY; INT32 verticalOriginY;
}; };
/// <summary> /// <summary>
/// Optional adjustment to a glyph's position. An glyph offset changes the posit ion of a glyph without affecting /// Optional adjustment to a glyph's position. A glyph offset changes the positi on of a glyph without affecting
/// the pen position. Offsets are in logical, pre-transform units. /// the pen position. Offsets are in logical, pre-transform units.
/// </summary> /// </summary>
struct DWRITE_GLYPH_OFFSET struct DWRITE_GLYPH_OFFSET
{ {
/// <summary> /// <summary>
/// Offset in the advance direction of the run. A positive advance offset mo ves the glyph to the right /// Offset in the advance direction of the run. A positive advance offset mo ves the glyph to the right
/// (in pre-transform coordinates) if the run is left-to-right or to the lef t if the run is right-to-left. /// (in pre-transform coordinates) if the run is left-to-right or to the lef t if the run is right-to-left.
/// </summary> /// </summary>
FLOAT advanceOffset; FLOAT advanceOffset;
skipping to change at line 605 skipping to change at line 633
(static_cast<UINT32>(static_cast<UINT8>(b)) << 8) | \ (static_cast<UINT32>(static_cast<UINT8>(b)) << 8) | \
static_cast<UINT32>(static_cast<UINT8>(a))) static_cast<UINT32>(static_cast<UINT8>(a)))
interface IDWriteFontFileStream; interface IDWriteFontFileStream;
/// <summary> /// <summary>
/// Font file loader interface handles loading font file resources of a particul ar type from a key. /// Font file loader interface handles loading font file resources of a particul ar type from a key.
/// The font file loader interface is recommended to be implemented by a singlet on object. /// The font file loader interface is recommended to be implemented by a singlet on object.
/// IMPORTANT: font file loader implementations must not register themselves wit h DirectWrite factory /// IMPORTANT: font file loader implementations must not register themselves wit h DirectWrite factory
/// inside their constructors and must not unregister themselves in their destru ctors, because /// inside their constructors and must not unregister themselves in their destru ctors, because
/// registration and unregistraton operations increment and decrement the object reference count respectively. /// registration and unregistration operations increment and decrement the objec t reference count respectively.
/// Instead, registration and unregistration of font file loaders with DirectWri te factory should be performed /// Instead, registration and unregistration of font file loaders with DirectWri te factory should be performed
/// outside of the font file loader implementation as a separate step. /// outside of the font file loader implementation as a separate step.
/// </summary> /// </summary>
interface DWRITE_DECLARE_INTERFACE("727cad4e-d6af-4c9e-8a08-d695b11caa49") IDWri teFontFileLoader : public IUnknown interface DWRITE_DECLARE_INTERFACE("727cad4e-d6af-4c9e-8a08-d695b11caa49") IDWri teFontFileLoader : public IUnknown
{ {
/// <summary> /// <summary>
/// Creates a font file stream object that encapsulates an open file resourc e. /// Creates a font file stream object that encapsulates an open file resourc e.
/// The resource is closed when the last reference to fontFileStream is rele ased. /// The resource is closed when the last reference to fontFileStream is rele ased.
/// </summary> /// </summary>
/// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the font file resource /// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the font file resource
/// within the scope of the font loader being used.</param> /// within the scope of the font loader being used.</param>
/// <param name="fontFileReferenceKeySize">Size of font file reference key i n bytes.</param> /// <param name="fontFileReferenceKeySize">Size of font file reference key i n bytes.</param>
/// <param name="fontFileStream">Pointer to the newly created font file stre am.</param> /// <param name="fontFileStream">Pointer to the newly created font file stre am.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(CreateStreamFromKey)( STDMETHOD(CreateStreamFromKey)(
__in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey, _In_reads_bytes_(fontFileReferenceKeySize) void const* fontFileReference Key,
UINT32 fontFileReferenceKeySize, UINT32 fontFileReferenceKeySize,
__out IDWriteFontFileStream** fontFileStream _COM_Outptr_ IDWriteFontFileStream** fontFileStream
) PURE; ) PURE;
}; };
/// <summary> /// <summary>
/// A built-in implementation of IDWriteFontFileLoader interface that operates o n local font files /// A built-in implementation of IDWriteFontFileLoader interface that operates o n local font files
/// and exposes local font file information from the font file reference key. /// and exposes local font file information from the font file reference key.
/// Font file references created using CreateFontFileReference use this font fil e loader. /// Font file references created using CreateFontFileReference use this font fil e loader.
/// </summary> /// </summary>
interface DWRITE_DECLARE_INTERFACE("b2d9f3ec-c9fe-4a11-a2ec-d86208f7c0a2") IDWri teLocalFontFileLoader : public IDWriteFontFileLoader interface DWRITE_DECLARE_INTERFACE("b2d9f3ec-c9fe-4a11-a2ec-d86208f7c0a2") IDWri teLocalFontFileLoader : public IDWriteFontFileLoader
{ {
skipping to change at line 647 skipping to change at line 675
/// Obtains the length of the absolute file path from the font file referenc e key. /// Obtains the length of the absolute file path from the font file referenc e key.
/// </summary> /// </summary>
/// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the local font file /// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the local font file
/// within the scope of the font loader being used.</param> /// within the scope of the font loader being used.</param>
/// <param name="fontFileReferenceKeySize">Size of font file reference key i n bytes.</param> /// <param name="fontFileReferenceKeySize">Size of font file reference key i n bytes.</param>
/// <param name="filePathLength">Length of the file path string not includin g the terminated NULL character.</param> /// <param name="filePathLength">Length of the file path string not includin g the terminated NULL character.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetFilePathLengthFromKey)( STDMETHOD(GetFilePathLengthFromKey)(
__in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey, _In_reads_bytes_(fontFileReferenceKeySize) void const* fontFileReference Key,
UINT32 fontFileReferenceKeySize, UINT32 fontFileReferenceKeySize,
__out UINT32* filePathLength _Out_ UINT32* filePathLength
) PURE; ) PURE;
/// <summary> /// <summary>
/// Obtains the absolute font file path from the font file reference key. /// Obtains the absolute font file path from the font file reference key.
/// </summary> /// </summary>
/// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the local font file /// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the local font file
/// within the scope of the font loader being used.</param> /// within the scope of the font loader being used.</param>
/// <param name="fontFileReferenceKeySize">Size of font file reference key i n bytes.</param> /// <param name="fontFileReferenceKeySize">Size of font file reference key i n bytes.</param>
/// <param name="filePath">Character array that receives the local file path .</param> /// <param name="filePath">Character array that receives the local file path .</param>
/// <param name="filePathSize">Size of the filePath array in character count including the terminated NULL character.</param> /// <param name="filePathSize">Size of the filePath array in character count including the terminated NULL character.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetFilePathFromKey)( STDMETHOD(GetFilePathFromKey)(
__in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey, _In_reads_bytes_(fontFileReferenceKeySize) void const* fontFileReference Key,
UINT32 fontFileReferenceKeySize, UINT32 fontFileReferenceKeySize,
__out_ecount_z(filePathSize) WCHAR* filePath, _Out_writes_z_(filePathSize) WCHAR* filePath,
UINT32 filePathSize UINT32 filePathSize
) PURE; ) PURE;
/// <summary> /// <summary>
/// Obtains the last write time of the file from the font file reference key . /// Obtains the last write time of the file from the font file reference key .
/// </summary> /// </summary>
/// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the local font file /// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the local font file
/// within the scope of the font loader being used.</param> /// within the scope of the font loader being used.</param>
/// <param name="fontFileReferenceKeySize">Size of font file reference key i n bytes.</param> /// <param name="fontFileReferenceKeySize">Size of font file reference key i n bytes.</param>
/// <param name="lastWriteTime">Last modified time of the font file.</param> /// <param name="lastWriteTime">Last modified time of the font file.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetLastWriteTimeFromKey)( STDMETHOD(GetLastWriteTimeFromKey)(
__in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey, _In_reads_bytes_(fontFileReferenceKeySize) void const* fontFileReference Key,
UINT32 fontFileReferenceKeySize, UINT32 fontFileReferenceKeySize,
__out FILETIME* lastWriteTime _Out_ FILETIME* lastWriteTime
) PURE; ) PURE;
}; };
/// <summary> /// <summary>
/// The interface for loading font file data. /// The interface for loading font file data.
/// </summary> /// </summary>
interface DWRITE_DECLARE_INTERFACE("6d4865fe-0ab8-4d91-8f62-5dd6be34a3e0") IDWri teFontFileStream : public IUnknown interface DWRITE_DECLARE_INTERFACE("6d4865fe-0ab8-4d91-8f62-5dd6be34a3e0") IDWri teFontFileStream : public IUnknown
{ {
/// <summary> /// <summary>
/// Reads a fragment from a file. /// Reads a fragment from a file.
skipping to change at line 707 skipping to change at line 735
/// <param name="fragmentSize">Size of the fragment in bytes.</param> /// <param name="fragmentSize">Size of the fragment in bytes.</param>
/// <param name="fragmentContext">The client defined context to be passed to the ReleaseFileFragment.</param> /// <param name="fragmentContext">The client defined context to be passed to the ReleaseFileFragment.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
/// <remarks> /// <remarks>
/// IMPORTANT: ReadFileFragment() implementations must check whether the req uested file fragment /// IMPORTANT: ReadFileFragment() implementations must check whether the req uested file fragment
/// is within the file bounds. Otherwise, an error should be returned from R eadFileFragment. /// is within the file bounds. Otherwise, an error should be returned from R eadFileFragment.
/// </remarks> /// </remarks>
STDMETHOD(ReadFileFragment)( STDMETHOD(ReadFileFragment)(
__deref_out_bcount(fragmentSize) void const** fragmentStart, _Outptr_result_bytebuffer_(fragmentSize) void const** fragmentStart,
UINT64 fileOffset, UINT64 fileOffset,
UINT64 fragmentSize, UINT64 fragmentSize,
__out void** fragmentContext _Out_ void** fragmentContext
) PURE; ) PURE;
/// <summary> /// <summary>
/// Releases a fragment from a file. /// Releases a fragment from a file.
/// </summary> /// </summary>
/// <param name="fragmentContext">The client defined context of a font fragm ent returned from ReadFileFragment.</param> /// <param name="fragmentContext">The client defined context of a font fragm ent returned from ReadFileFragment.</param>
STDMETHOD_(void, ReleaseFileFragment)( STDMETHOD_(void, ReleaseFileFragment)(
void* fragmentContext void* fragmentContext
) PURE; ) PURE;
skipping to change at line 735 skipping to change at line 763
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
/// <remarks> /// <remarks>
/// Implementing GetFileSize() for asynchronously loaded font files may requ ire /// Implementing GetFileSize() for asynchronously loaded font files may requ ire
/// downloading the complete file contents, therefore this method should onl y be used for operations that /// downloading the complete file contents, therefore this method should onl y be used for operations that
/// either require complete font file to be loaded (e.g., copying a font fil e) or need to make /// either require complete font file to be loaded (e.g., copying a font fil e) or need to make
/// decisions based on the value of the file size (e.g., validation against a persisted file size). /// decisions based on the value of the file size (e.g., validation against a persisted file size).
/// </remarks> /// </remarks>
STDMETHOD(GetFileSize)( STDMETHOD(GetFileSize)(
__out UINT64* fileSize _Out_ UINT64* fileSize
) PURE; ) PURE;
/// <summary> /// <summary>
/// Obtains the last modified time of the file. The last modified time is us ed by DirectWrite font selection algorithms /// Obtains the last modified time of the file. The last modified time is us ed by DirectWrite font selection algorithms
/// to determine whether one font resource is more up to date than another o ne. /// to determine whether one font resource is more up to date than another o ne.
/// </summary> /// </summary>
/// <param name="lastWriteTime">Receives the last modifed time of the file i n the format that represents /// <param name="lastWriteTime">Receives the last modified time of the file in the format that represents
/// the number of 100-nanosecond intervals since January 1, 1601 (UTC).</par am> /// the number of 100-nanosecond intervals since January 1, 1601 (UTC).</par am>
/// <returns> /// <returns>
/// Standard HRESULT error code. For resources that don't have a concept of the last modified time, the implementation of /// Standard HRESULT error code. For resources that don't have a concept of the last modified time, the implementation of
/// GetLastWriteTime should return E_NOTIMPL. /// GetLastWriteTime should return E_NOTIMPL.
/// </returns> /// </returns>
STDMETHOD(GetLastWriteTime)( STDMETHOD(GetLastWriteTime)(
__out UINT64* lastWriteTime _Out_ UINT64* lastWriteTime
) PURE; ) PURE;
}; };
/// <summary> /// <summary>
/// The interface that represents a reference to a font file. /// The interface that represents a reference to a font file.
/// </summary> /// </summary>
interface DWRITE_DECLARE_INTERFACE("739d886a-cef5-47dc-8769-1a8b41bebbb0") IDWri teFontFile : public IUnknown interface DWRITE_DECLARE_INTERFACE("739d886a-cef5-47dc-8769-1a8b41bebbb0") IDWri teFontFile : public IUnknown
{ {
/// <summary> /// <summary>
/// This method obtains the pointer to the reference key of a font file. The pointer is only valid until the object that refers to it is released. /// This method obtains the pointer to the reference key of a font file. The pointer is only valid until the object that refers to it is released.
/// </summary> /// </summary>
/// <param name="fontFileReferenceKey">Pointer to the font file reference ke y. /// <param name="fontFileReferenceKey">Pointer to the font file reference ke y.
/// IMPORTANT: The pointer value is valid until the font file reference obje ct it is obtained from is released.</param> /// IMPORTANT: The pointer value is valid until the font file reference obje ct it is obtained from is released.</param>
/// <param name="fontFileReferenceKeySize">Size of font file reference key i n bytes.</param> /// <param name="fontFileReferenceKeySize">Size of font file reference key i n bytes.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetReferenceKey)( STDMETHOD(GetReferenceKey)(
__deref_out_bcount(*fontFileReferenceKeySize) void const** fontFileRefer _Outptr_result_bytebuffer_(*fontFileReferenceKeySize) void const** fontF
enceKey, ileReferenceKey,
__out UINT32* fontFileReferenceKeySize _Out_ UINT32* fontFileReferenceKeySize
) PURE; ) PURE;
/// <summary> /// <summary>
/// Obtains the file loader associated with a font file object. /// Obtains the file loader associated with a font file object.
/// </summary> /// </summary>
/// <param name="fontFileLoader">The font file loader associated with the fo nt file object.</param> /// <param name="fontFileLoader">The font file loader associated with the fo nt file object.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetLoader)( STDMETHOD(GetLoader)(
__out IDWriteFontFileLoader** fontFileLoader _COM_Outptr_ IDWriteFontFileLoader** fontFileLoader
) PURE; ) PURE;
/// <summary> /// <summary>
/// Analyzes a file and returns whether it represents a font, and whether th e font type is supported by the font system. /// Analyzes a file and returns whether it represents a font, and whether th e font type is supported by the font system.
/// </summary> /// </summary>
/// <param name="isSupportedFontType">TRUE if the font type is supported by the font system, FALSE otherwise.</param> /// <param name="isSupportedFontType">TRUE if the font type is supported by the font system, FALSE otherwise.</param>
/// <param name="fontFileType">The type of the font file. Note that even if isSupportedFontType is FALSE, /// <param name="fontFileType">The type of the font file. Note that even if isSupportedFontType is FALSE,
/// the fontFileType value may be different from DWRITE_FONT_FILE_TYPE_UNKNO WN.</param> /// the fontFileType value may be different from DWRITE_FONT_FILE_TYPE_UNKNO WN.</param>
/// <param name="fontFaceType">The type of the font face that can be constru cted from the font file. /// <param name="fontFaceType">The type of the font face that can be constru cted from the font file.
/// Note that even if isSupportedFontType is FALSE, the fontFaceType value m ay be different from /// Note that even if isSupportedFontType is FALSE, the fontFaceType value m ay be different from
skipping to change at line 803 skipping to change at line 831
/// <returns> /// <returns>
/// Standard HRESULT error code if there was a processing error during analy sis. /// Standard HRESULT error code if there was a processing error during analy sis.
/// </returns> /// </returns>
/// <remarks> /// <remarks>
/// IMPORTANT: certain font file types are recognized, but not supported by the font system. /// IMPORTANT: certain font file types are recognized, but not supported by the font system.
/// For example, the font system will recognize a file as a Type 1 font file , /// For example, the font system will recognize a file as a Type 1 font file ,
/// but will not be able to construct a font face object from it. In such si tuations, Analyze will set /// but will not be able to construct a font face object from it. In such si tuations, Analyze will set
/// isSupportedFontType output parameter to FALSE. /// isSupportedFontType output parameter to FALSE.
/// </remarks> /// </remarks>
STDMETHOD(Analyze)( STDMETHOD(Analyze)(
__out BOOL* isSupportedFontType, _Out_ BOOL* isSupportedFontType,
__out DWRITE_FONT_FILE_TYPE* fontFileType, _Out_ DWRITE_FONT_FILE_TYPE* fontFileType,
__out_opt DWRITE_FONT_FACE_TYPE* fontFaceType, _Out_opt_ DWRITE_FONT_FACE_TYPE* fontFaceType,
__out UINT32* numberOfFaces _Out_ UINT32* numberOfFaces
) PURE; ) PURE;
}; };
/// <summary> /// <summary>
/// Represents the internal structure of a device pixel (i.e., the physical arra ngement of red, /// Represents the internal structure of a device pixel (i.e., the physical arra ngement of red,
/// green, and blue color components) that is assumed for purposes of rendering text. /// green, and blue color components) that is assumed for purposes of rendering text.
/// </summary> /// </summary>
#ifndef DWRITE_PIXEL_GEOMETRY_DEFINED #ifndef DWRITE_PIXEL_GEOMETRY_DEFINED
enum DWRITE_PIXEL_GEOMETRY enum DWRITE_PIXEL_GEOMETRY
{ {
skipping to change at line 848 skipping to change at line 876
/// Represents a method of rendering glyphs. /// Represents a method of rendering glyphs.
/// </summary> /// </summary>
enum DWRITE_RENDERING_MODE enum DWRITE_RENDERING_MODE
{ {
/// <summary> /// <summary>
/// Specifies that the rendering mode is determined automatically based on t he font and size. /// Specifies that the rendering mode is determined automatically based on t he font and size.
/// </summary> /// </summary>
DWRITE_RENDERING_MODE_DEFAULT, DWRITE_RENDERING_MODE_DEFAULT,
/// <summary> /// <summary>
/// Specifies that no anti-aliasing is performed. Each pixel is either set t o the foreground /// Specifies that no antialiasing is performed. Each pixel is either set to the foreground
/// color of the text or retains the color of the background. /// color of the text or retains the color of the background.
/// </summary> /// </summary>
DWRITE_RENDERING_MODE_ALIASED, DWRITE_RENDERING_MODE_ALIASED,
/// <summary> /// <summary>
/// Specifies ClearType rendering with the same metrics as aliased text. Gly /// Specifies that antialiasing is performed in the horizontal direction and
phs can only the appearance
/// be positioned on whole-pixel boundaries. /// of glyphs is layout-compatible with GDI using CLEARTYPE_QUALITY. Use DWR
ITE_MEASURING_MODE_GDI_CLASSIC
/// to get glyph advances. The antialiasing may be either ClearType or grays
cale depending on
/// the text antialiasing mode.
/// </summary> /// </summary>
DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC, DWRITE_RENDERING_MODE_GDI_CLASSIC,
/// <summary> /// <summary>
/// Specifies ClearType rendering with the same metrics as text rendering us /// Specifies that antialiasing is performed in the horizontal direction and
ing GDI using a font the appearance
/// created with CLEARTYPE_NATURAL_QUALITY. Glyph metrics are closer to thei /// of glyphs is layout-compatible with GDI using CLEARTYPE_NATURAL_QUALITY.
r ideal values than Glyph advances
/// with aliased text, but glyphs are still positioned on whole-pixel bounda /// are close to the font design advances, but are still rounded to whole pi
ries. xels. Use
/// DWRITE_MEASURING_MODE_GDI_NATURAL to get glyph advances. The antialiasin
g may be either
/// ClearType or grayscale depending on the text antialiasing mode.
/// </summary> /// </summary>
DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL, DWRITE_RENDERING_MODE_GDI_NATURAL,
/// <summary> /// <summary>
/// Specifies ClearType rendering with anti-aliasing in the horizontal dimen /// Specifies that antialiasing is performed in the horizontal direction. Th
sion only. This is is rendering
/// typically used with small to medium font sizes (up to 16 ppem). /// mode allows glyphs to be positioned with subpixel precision and is there
fore suitable
/// for natural (i.e., resolution-independent) layout. The antialiasing may
be either
/// ClearType or grayscale depending on the text antialiasing mode.
/// </summary> /// </summary>
DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL, DWRITE_RENDERING_MODE_NATURAL,
/// <summary> /// <summary>
/// Specifies ClearType rendering with anti-aliasing in both horizontal and /// Similar to natural mode except that antialiasing is performed in both th
vertical dimensions. e horizontal
/// This is typically used at larger sizes to makes curves and diagonal line /// and vertical directions. This is typically used at larger sizes to make
s look smoother, at curves and
/// the expense of some softness. /// diagonal lines look smoother. The antialiasing may be either ClearType o
r grayscale
/// depending on the text antialiasing mode.
/// </summary> /// </summary>
DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC, DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC,
/// <summary> /// <summary>
/// Specifies that rendering should bypass the rasterizer and use the outlin /// Specifies that rendering should bypass the rasterizer and use the outlin
es directly. This is es directly.
/// typically used at very large sizes. /// This is typically used at very large sizes.
/// </summary> /// </summary>
DWRITE_RENDERING_MODE_OUTLINE DWRITE_RENDERING_MODE_OUTLINE,
// The following names are obsolete, but are kept as aliases to avoid breaki
ng existing code.
// Each of these rendering modes may result in either ClearType or grayscale
antialiasing
// depending on the DWRITE_TEXT_ANTIALIASING_MODE.
DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC = DWRITE_RENDERING_MODE_
GDI_CLASSIC,
DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL = DWRITE_RENDERING_MODE_
GDI_NATURAL,
DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL = DWRITE_RENDERING_MODE_
NATURAL,
DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC = DWRITE_RENDERING_MODE_
NATURAL_SYMMETRIC
}; };
/// <summary> /// <summary>
/// The DWRITE_MATRIX structure specifies the graphics transform to be applied /// The DWRITE_MATRIX structure specifies the graphics transform to be applied
/// to rendered glyphs. /// to rendered glyphs.
/// </summary> /// </summary>
struct DWRITE_MATRIX struct DWRITE_MATRIX
{ {
/// <summary> /// <summary>
/// Horizontal scaling / cosine of rotation /// Horizontal scaling / cosine of rotation
skipping to change at line 986 skipping to change at line 1029
/// </summary> /// </summary>
/// <param name="numberOfFiles">The number of files representing the font fa ce.</param> /// <param name="numberOfFiles">The number of files representing the font fa ce.</param>
/// <param name="fontFiles">User provided array that stores pointers to font files representing the font face. /// <param name="fontFiles">User provided array that stores pointers to font files representing the font face.
/// This parameter can be NULL if the user is only interested in the number of files representing the font face. /// This parameter can be NULL if the user is only interested in the number of files representing the font face.
/// This API increments reference count of the font file pointers returned a ccording to COM conventions, and the client /// This API increments reference count of the font file pointers returned a ccording to COM conventions, and the client
/// should release them when finished.</param> /// should release them when finished.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetFiles)( STDMETHOD(GetFiles)(
__inout UINT32* numberOfFiles, _Inout_ UINT32* numberOfFiles,
__out_ecount_opt(*numberOfFiles) IDWriteFontFile** fontFiles _Out_writes_opt_(*numberOfFiles) IDWriteFontFile** fontFiles
) PURE; ) PURE;
/// <summary> /// <summary>
/// Obtains the zero-based index of the font face in its font file or files. If the font files contain a single face, /// Obtains the zero-based index of the font face in its font file or files. If the font files contain a single face,
/// the return value is zero. /// the return value is zero.
/// </summary> /// </summary>
STDMETHOD_(UINT32, GetIndex)() PURE; STDMETHOD_(UINT32, GetIndex)() PURE;
/// <summary> /// <summary>
/// Obtains the algorithmic style simulation flags of a font face. /// Obtains the algorithmic style simulation flags of a font face.
skipping to change at line 1013 skipping to change at line 1056
/// </summary> /// </summary>
STDMETHOD_(BOOL, IsSymbolFont)() PURE; STDMETHOD_(BOOL, IsSymbolFont)() PURE;
/// <summary> /// <summary>
/// Obtains design units and common metrics for the font face. /// Obtains design units and common metrics for the font face.
/// These metrics are applicable to all the glyphs within a fontface and are used by applications for layout calculations. /// These metrics are applicable to all the glyphs within a fontface and are used by applications for layout calculations.
/// </summary> /// </summary>
/// <param name="fontFaceMetrics">Points to a DWRITE_FONT_METRICS structure to fill in. /// <param name="fontFaceMetrics">Points to a DWRITE_FONT_METRICS structure to fill in.
/// The metrics returned by this function are in font design units.</param> /// The metrics returned by this function are in font design units.</param>
STDMETHOD_(void, GetMetrics)( STDMETHOD_(void, GetMetrics)(
__out DWRITE_FONT_METRICS* fontFaceMetrics _Out_ DWRITE_FONT_METRICS* fontFaceMetrics
) PURE; ) PURE;
/// <summary> /// <summary>
/// Obtains the number of glyphs in the font face. /// Obtains the number of glyphs in the font face.
/// </summary> /// </summary>
STDMETHOD_(UINT16, GetGlyphCount)() PURE; STDMETHOD_(UINT16, GetGlyphCount)() PURE;
/// <summary> /// <summary>
/// Obtains ideal glyph metrics in font design units. Design glyphs metrics are used for glyph positioning. /// Obtains ideal glyph metrics in font design units. Design glyphs metrics are used for glyph positioning.
/// </summary> /// </summary>
skipping to change at line 1036 skipping to change at line 1079
/// <param name="glyphMetrics">Array of DWRITE_GLYPH_METRICS structures fill ed by this function. /// <param name="glyphMetrics">Array of DWRITE_GLYPH_METRICS structures fill ed by this function.
/// The metrics returned by this function are in font design units.</param> /// The metrics returned by this function are in font design units.</param>
/// <param name="isSideways">Indicates whether the font is being used in a s ideways run. /// <param name="isSideways">Indicates whether the font is being used in a s ideways run.
/// This can affect the glyph metrics if the font has oblique simulation /// This can affect the glyph metrics if the font has oblique simulation
/// because sideways oblique simulation differs from non-sideways oblique si mulation.</param> /// because sideways oblique simulation differs from non-sideways oblique si mulation.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. If any of the input glyph indices are outsi de of the valid glyph index range /// Standard HRESULT error code. If any of the input glyph indices are outsi de of the valid glyph index range
/// for the current font face, E_INVALIDARG will be returned. /// for the current font face, E_INVALIDARG will be returned.
/// </returns> /// </returns>
STDMETHOD(GetDesignGlyphMetrics)( STDMETHOD(GetDesignGlyphMetrics)(
__in_ecount(glyphCount) UINT16 const* glyphIndices, _In_reads_(glyphCount) UINT16 const* glyphIndices,
UINT32 glyphCount, UINT32 glyphCount,
__out_ecount(glyphCount) DWRITE_GLYPH_METRICS* glyphMetrics, _Out_writes_(glyphCount) DWRITE_GLYPH_METRICS* glyphMetrics,
BOOL isSideways = FALSE BOOL isSideways = FALSE
) PURE; ) PURE;
/// <summary> /// <summary>
/// Returns the nominal mapping of UCS4 Unicode code points to glyph indices as defined by the font 'CMAP' table. /// Returns the nominal mapping of UTF-32 Unicode code points to glyph indic es as defined by the font 'cmap' table.
/// Note that this mapping is primarily provided for line layout engines bui lt on top of the physical font API. /// Note that this mapping is primarily provided for line layout engines bui lt on top of the physical font API.
/// Because of OpenType glyph substitution and line layout character substit ution, the nominal conversion does not always correspond /// Because of OpenType glyph substitution and line layout character substit ution, the nominal conversion does not always correspond
/// to how a Unicode string will map to glyph indices when rendering using a particular font face. /// to how a Unicode string will map to glyph indices when rendering using a particular font face.
/// Also, note that Unicode Variant Selectors provide for alternate mappings for character to glyph. /// Also, note that Unicode Variation Selectors provide for alternate mappin gs for character to glyph.
/// This call will always return the default variant. /// This call will always return the default variant.
/// </summary> /// </summary>
/// <param name="codePoints">An array of USC4 code points to obtain nominal glyph indices from.</param> /// <param name="codePoints">An array of UTF-32 code points to obtain nomina l glyph indices from.</param>
/// <param name="codePointCount">The number of elements in the codePoints ar ray.</param> /// <param name="codePointCount">The number of elements in the codePoints ar ray.</param>
/// <param name="glyphIndices">Array of nominal glyph indices filled by this function.</param> /// <param name="glyphIndices">Array of nominal glyph indices filled by this function.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetGlyphIndices)( STDMETHOD(GetGlyphIndices)(
__in_ecount(codePointCount) UINT32 const* codePoints, _In_reads_(codePointCount) UINT32 const* codePoints,
UINT32 codePointCount, UINT32 codePointCount,
__out_ecount(codePointCount) UINT16* glyphIndices _Out_writes_(codePointCount) UINT16* glyphIndices
) PURE; ) PURE;
/// <summary> /// <summary>
/// Finds the specified OpenType font table if it exists and returns a point er to it. /// Finds the specified OpenType font table if it exists and returns a point er to it.
/// The function accesses the underling font data via the IDWriteFontStream interface /// The function accesses the underlying font data via the IDWriteFontFileSt ream interface
/// implemented by the font file loader. /// implemented by the font file loader.
/// </summary> /// </summary>
/// <param name="openTypeTableTag">Four character tag of table to find. /// <param name="openTypeTableTag">Four character tag of table to find.
/// Use the DWRITE_MAKE_OPENTYPE_TAG() macro to create it. /// Use the DWRITE_MAKE_OPENTYPE_TAG() macro to create it.
/// Unlike GDI, it does not support the special TTCF and null tags to ac cess the whole font.</param> /// Unlike GDI, it does not support the special TTCF and null tags to ac cess the whole font.</param>
/// <param name="tableData"> /// <param name="tableData">
/// Pointer to base of table in memory. /// Pointer to base of table in memory.
/// The pointer is only valid so long as the FontFace used to get the fo nt table still exists /// The pointer is only valid so long as the FontFace used to get the fo nt table still exists
/// (not any other FontFace, even if it actually refers to the same phys ical font). /// (not any other FontFace, even if it actually refers to the same phys ical font).
/// </param> /// </param>
skipping to change at line 1097 skipping to change at line 1140
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// If a table can not be found, the function will not return an error, but the size will be 0, table NULL, and exists = FALSE. /// If a table can not be found, the function will not return an error, but the size will be 0, table NULL, and exists = FALSE.
/// The context does not need to be freed if the table was not found. /// The context does not need to be freed if the table was not found.
/// </returns> /// </returns>
/// <remarks> /// <remarks>
/// The context for the same tag may be different for each call, /// The context for the same tag may be different for each call,
/// so each one must be held and released separately. /// so each one must be held and released separately.
/// </remarks> /// </remarks>
STDMETHOD(TryGetFontTable)( STDMETHOD(TryGetFontTable)(
__in UINT32 openTypeTableTag, _In_ UINT32 openTypeTableTag,
__deref_out_bcount(*tableSize) const void** tableData, _Outptr_result_bytebuffer_(*tableSize) const void** tableData,
__out UINT32* tableSize, _Out_ UINT32* tableSize,
__out void** tableContext, _Out_ void** tableContext,
__out BOOL* exists _Out_ BOOL* exists
) PURE; ) PURE;
/// <summary> /// <summary>
/// Releases the table obtained earlier from TryGetFontTable. /// Releases the table obtained earlier from TryGetFontTable.
/// </summary> /// </summary>
/// <param name="tableContext">Opaque context from TryGetFontTable.</param> /// <param name="tableContext">Opaque context from TryGetFontTable.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD_(void, ReleaseFontTable)( STDMETHOD_(void, ReleaseFontTable)(
__in void* tableContext _In_ void* tableContext
) PURE; ) PURE;
/// <summary> /// <summary>
/// Computes the outline of a run of glyphs by calling back to the outline s ink interface. /// Computes the outline of a run of glyphs by calling back to the outline s ink interface.
/// </summary> /// </summary>
/// <param name="emSize">Logical size of the font in DIP units. A DIP ("devi ce-independent pixel") equals 1/96 inch.</param> /// <param name="emSize">Logical size of the font in DIP units. A DIP ("devi ce-independent pixel") equals 1/96 inch.</param>
/// <param name="glyphIndices">Array of glyph indices.</param> /// <param name="glyphIndices">Array of glyph indices.</param>
/// <param name="glyphAdvances">Optional array of glyph advances in DIPs.</p aram> /// <param name="glyphAdvances">Optional array of glyph advances in DIPs.</p aram>
/// <param name="glyphOffsets">Optional array of glyph offsets.</param> /// <param name="glyphOffsets">Optional array of glyph offsets.</param>
/// <param name="glyphCount">Number of glyphs.</param> /// <param name="glyphCount">Number of glyphs.</param>
/// <param name="isSideways">If true, specifies that glyphs are rotated 90 d egrees to the left and vertical metrics are used. /// <param name="isSideways">If true, specifies that glyphs are rotated 90 d egrees to the left and vertical metrics are used.
/// A client can render a vertical run by specifying isSideways = true and r otating the resulting geometry 90 degrees to the /// A client can render a vertical run by specifying isSideways = true and r otating the resulting geometry 90 degrees to the
/// right using a transform. The isSideways and isRightToLeft parameters can not both be true.</param> /// right using a transform.</param>
/// <param name="isRightToLeft">If true, specifies that the advance directio n is right to left. By default, the advance direction /// <param name="isRightToLeft">If true, specifies that the advance directio n is right to left. By default, the advance direction
/// is left to right.</param> /// is left to right.</param>
/// <param name="geometrySink">Interface the function calls back to draw eac h element of the geometry.</param> /// <param name="geometrySink">Interface the function calls back to draw eac h element of the geometry.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetGlyphRunOutline)( STDMETHOD(GetGlyphRunOutline)(
FLOAT emSize, FLOAT emSize,
__in_ecount(glyphCount) UINT16 const* glyphIndices, _In_reads_(glyphCount) UINT16 const* glyphIndices,
__in_ecount_opt(glyphCount) FLOAT const* glyphAdvances, _In_reads_opt_(glyphCount) FLOAT const* glyphAdvances,
__in_ecount_opt(glyphCount) DWRITE_GLYPH_OFFSET const* glyphOffsets, _In_reads_opt_(glyphCount) DWRITE_GLYPH_OFFSET const* glyphOffsets,
UINT32 glyphCount, UINT32 glyphCount,
BOOL isSideways, BOOL isSideways,
BOOL isRightToLeft, BOOL isRightToLeft,
IDWriteGeometrySink* geometrySink _In_ IDWriteGeometrySink* geometrySink
) PURE; ) PURE;
/// <summary> /// <summary>
/// Determines the recommended rendering mode for the font given the specifi ed size and rendering parameters. /// Determines the recommended rendering mode for the font given the specifi ed size and rendering parameters.
/// </summary> /// </summary>
/// <param name="emSize">Logical size of the font in DIP units. A DIP ("devi ce-independent pixel") equals 1/96 inch.</param> /// <param name="emSize">Logical size of the font in DIP units. A DIP ("devi ce-independent pixel") equals 1/96 inch.</param>
/// <param name="pixelsPerDip">Number of physical pixels per DIP. For exampl e, if the DPI of the rendering surface is 96 this /// <param name="pixelsPerDip">Number of physical pixels per DIP. For exampl e, if the DPI of the rendering surface is 96 this
/// value is 1.0f. If the DPI is 120, this value is 120.0f/96.</param> /// value is 1.0f. If the DPI is 120, this value is 120.0f/96.</param>
/// <param name="measuringMode">Specifies measuring method that will be used /// <param name="measuringMode">Specifies measuring mode that will be used f
for glyphs in the font. or glyphs in the font.
/// Renderer implementations may choose different rendering modes for given /// Renderer implementations may choose different rendering modes for given
measuring methods, but measuring modes, but
/// best results are seen when the corresponding modes match: /// best results are seen when the corresponding modes match:
/// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURA L /// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURA L
/// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GD I_CLASSIC /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GD I_CLASSIC
/// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GD I_NATURAL /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GD I_NATURAL
/// </param> /// </param>
/// <param name="renderingParams">Rendering parameters object. This paramete r is necessary in case the rendering parameters /// <param name="renderingParams">Rendering parameters object. This paramete r is necessary in case the rendering parameters
/// object overrides the rendering mode.</param> /// object overrides the rendering mode.</param>
/// <param name="renderingMode">Receives the recommended rendering mode to u se.</param> /// <param name="renderingMode">Receives the recommended rendering mode to u se.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetRecommendedRenderingMode)( STDMETHOD(GetRecommendedRenderingMode)(
FLOAT emSize, FLOAT emSize,
FLOAT pixelsPerDip, FLOAT pixelsPerDip,
DWRITE_MEASURING_MODE measuringMode, DWRITE_MEASURING_MODE measuringMode,
IDWriteRenderingParams* renderingParams, IDWriteRenderingParams* renderingParams,
__out DWRITE_RENDERING_MODE* renderingMode _Out_ DWRITE_RENDERING_MODE* renderingMode
) PURE; ) PURE;
/// <summary> /// <summary>
/// Obtains design units and common metrics for the font face. /// Obtains design units and common metrics for the font face.
/// These metrics are applicable to all the glyphs within a fontface and are used by applications for layout calculations. /// These metrics are applicable to all the glyphs within a fontface and are used by applications for layout calculations.
/// </summary> /// </summary>
/// <param name="emSize">Logical size of the font in DIP units. A DIP ("devi ce-independent pixel") equals 1/96 inch.</param> /// <param name="emSize">Logical size of the font in DIP units. A DIP ("devi ce-independent pixel") equals 1/96 inch.</param>
/// <param name="pixelsPerDip">Number of physical pixels per DIP. For exampl e, if the DPI of the rendering surface is 96 this /// <param name="pixelsPerDip">Number of physical pixels per DIP. For exampl e, if the DPI of the rendering surface is 96 this
/// value is 1.0f. If the DPI is 120, this value is 120.0f/96.</param> /// value is 1.0f. If the DPI is 120, this value is 120.0f/96.</param>
/// <param name="transform">Optional transform applied to the glyphs and the ir positions. This transform is applied after the /// <param name="transform">Optional transform applied to the glyphs and the ir positions. This transform is applied after the
/// scaling specified by the font size and pixelsPerDip.</param> /// scaling specified by the font size and pixelsPerDip.</param>
/// <param name="fontFaceMetrics">Points to a DWRITE_FONT_METRICS structure to fill in. /// <param name="fontFaceMetrics">Points to a DWRITE_FONT_METRICS structure to fill in.
/// The metrics returned by this function are in font design units.</param> /// The metrics returned by this function are in font design units.</param>
STDMETHOD(GetGdiCompatibleMetrics)( STDMETHOD(GetGdiCompatibleMetrics)(
FLOAT emSize, FLOAT emSize,
FLOAT pixelsPerDip, FLOAT pixelsPerDip,
__in_opt DWRITE_MATRIX const* transform, _In_opt_ DWRITE_MATRIX const* transform,
__out DWRITE_FONT_METRICS* fontFaceMetrics _Out_ DWRITE_FONT_METRICS* fontFaceMetrics
) PURE; ) PURE;
/// <summary> /// <summary>
/// Obtains glyph metrics in font design units with the return values compat ible with what GDI would produce. /// Obtains glyph metrics in font design units with the return values compat ible with what GDI would produce.
/// Glyphs metrics are used for positioning of individual glyphs. /// Glyphs metrics are used for positioning of individual glyphs.
/// </summary> /// </summary>
/// <param name="emSize">Logical size of the font in DIP units. A DIP ("devi ce-independent pixel") equals 1/96 inch.</param> /// <param name="emSize">Logical size of the font in DIP units. A DIP ("devi ce-independent pixel") equals 1/96 inch.</param>
/// <param name="pixelsPerDip">Number of physical pixels per DIP. For exampl e, if the DPI of the rendering surface is 96 this /// <param name="pixelsPerDip">Number of physical pixels per DIP. For exampl e, if the DPI of the rendering surface is 96 this
/// value is 1.0f. If the DPI is 120, this value is 120.0f/96.</param> /// value is 1.0f. If the DPI is 120, this value is 120.0f/96.</param>
/// <param name="transform">Optional transform applied to the glyphs and the ir positions. This transform is applied after the /// <param name="transform">Optional transform applied to the glyphs and the ir positions. This transform is applied after the
skipping to change at line 1216 skipping to change at line 1256
/// <param name="isSideways">Indicates whether the font is being used in a s ideways run. /// <param name="isSideways">Indicates whether the font is being used in a s ideways run.
/// This can affect the glyph metrics if the font has oblique simulation /// This can affect the glyph metrics if the font has oblique simulation
/// because sideways oblique simulation differs from non-sideways oblique si mulation.</param> /// because sideways oblique simulation differs from non-sideways oblique si mulation.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. If any of the input glyph indices are outsi de of the valid glyph index range /// Standard HRESULT error code. If any of the input glyph indices are outsi de of the valid glyph index range
/// for the current font face, E_INVALIDARG will be returned. /// for the current font face, E_INVALIDARG will be returned.
/// </returns> /// </returns>
STDMETHOD(GetGdiCompatibleGlyphMetrics)( STDMETHOD(GetGdiCompatibleGlyphMetrics)(
FLOAT emSize, FLOAT emSize,
FLOAT pixelsPerDip, FLOAT pixelsPerDip,
__in_opt DWRITE_MATRIX const* transform, _In_opt_ DWRITE_MATRIX const* transform,
BOOL useGdiNatural, BOOL useGdiNatural,
__in_ecount(glyphCount) UINT16 const* glyphIndices, _In_reads_(glyphCount) UINT16 const* glyphIndices,
UINT32 glyphCount, UINT32 glyphCount,
__out_ecount(glyphCount) DWRITE_GLYPH_METRICS* glyphMetrics, _Out_writes_(glyphCount) DWRITE_GLYPH_METRICS* glyphMetrics,
BOOL isSideways = FALSE BOOL isSideways = FALSE
) PURE; ) PURE;
}; };
interface IDWriteFactory; interface IDWriteFactory;
interface IDWriteFontFileEnumerator; interface IDWriteFontFileEnumerator;
/// <summary> /// <summary>
/// The font collection loader interface is used to construct a collection of fo nts given a particular type of key. /// The font collection loader interface is used to construct a collection of fo nts given a particular type of key.
/// The font collection loader interface is recommended to be implemented by a s ingleton object. /// The font collection loader interface is recommended to be implemented by a s ingleton object.
/// IMPORTANT: font collection loader implementations must not register themselv es with a DirectWrite factory /// IMPORTANT: font collection loader implementations must not register themselv es with a DirectWrite factory
/// inside their constructors and must not unregister themselves in their destru ctors, because /// inside their constructors and must not unregister themselves in their destru ctors, because
/// registration and unregistraton operations increment and decrement the object reference count respectively. /// registration and unregistration operations increment and decrement the objec t reference count respectively.
/// Instead, registration and unregistration of font file loaders with DirectWri te factory should be performed /// Instead, registration and unregistration of font file loaders with DirectWri te factory should be performed
/// outside of the font file loader implementation as a separate step. /// outside of the font file loader implementation as a separate step.
/// </summary> /// </summary>
interface DWRITE_DECLARE_INTERFACE("cca920e4-52f0-492b-bfa8-29c72ee0a468") IDWri teFontCollectionLoader : public IUnknown interface DWRITE_DECLARE_INTERFACE("cca920e4-52f0-492b-bfa8-29c72ee0a468") IDWri teFontCollectionLoader : public IUnknown
{ {
/// <summary> /// <summary>
/// Creates a font file enumerator object that encapsulates a collection of font files. /// 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 . /// The font system calls back to this interface to create a font collection .
/// </summary> /// </summary>
/// <param name="factory">Factory associated with the loader.</param> /// <param name="factory">Factory associated with the loader.</param>
/// <param name="collectionKey">Font collection key that uniquely identifies the collection of font files within /// <param name="collectionKey">Font collection key that uniquely identifies the collection of font files within
/// the scope of the font collection loader being used.</param> /// the scope of the font collection loader being used.</param>
/// <param name="collectionKeySize">Size of the font collection key in bytes .</param> /// <param name="collectionKeySize">Size of the font collection key in bytes .</param>
/// <param name="fontFileEnumerator">Pointer to the newly created font file enumerator.</param> /// <param name="fontFileEnumerator">Pointer to the newly created font file enumerator.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(CreateEnumeratorFromKey)( STDMETHOD(CreateEnumeratorFromKey)(
IDWriteFactory* factory, _In_ IDWriteFactory* factory,
__in_bcount(collectionKeySize) void const* collectionKey, _In_reads_bytes_(collectionKeySize) void const* collectionKey,
UINT32 collectionKeySize, UINT32 collectionKeySize,
__out IDWriteFontFileEnumerator** fontFileEnumerator _COM_Outptr_ IDWriteFontFileEnumerator** fontFileEnumerator
) PURE; ) PURE;
}; };
/// <summary> /// <summary>
/// The font file enumerator interface encapsulates a collection of font files. The font system uses this interface /// The font file enumerator interface encapsulates a collection of font files. The font system uses this interface
/// to enumerate font files when building a font collection. /// to enumerate font files when building a font collection.
/// </summary> /// </summary>
interface DWRITE_DECLARE_INTERFACE("72755049-5ff7-435d-8348-4be97cfa6c7c") IDWri teFontFileEnumerator : public IUnknown interface DWRITE_DECLARE_INTERFACE("72755049-5ff7-435d-8348-4be97cfa6c7c") IDWri teFontFileEnumerator : public IUnknown
{ {
/// <summary> /// <summary>
/// Advances to the next font file in the collection. When it is first creat ed, the enumerator is positioned /// Advances to the next font file in the collection. When it is first creat ed, the enumerator is positioned
/// before the first element of the collection and the first call to MoveNex t advances to the first file. /// before the first element of the collection and the first call to MoveNex t advances to the first file.
/// </summary> /// </summary>
/// <param name="hasCurrentFile">Receives the value TRUE if the enumerator a dvances to a file, or FALSE if /// <param name="hasCurrentFile">Receives the value TRUE if the enumerator a dvances to a file, or FALSE if
/// the enumerator advanced past the last file in the collection.</param> /// the enumerator advanced past the last file in the collection.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(MoveNext)( STDMETHOD(MoveNext)(
__out BOOL* hasCurrentFile _Out_ BOOL* hasCurrentFile
) PURE; ) PURE;
/// <summary> /// <summary>
/// Gets a reference to the current font file. /// Gets a reference to the current font file.
/// </summary> /// </summary>
/// <param name="fontFile">Pointer to the newly created font file object.</p aram> /// <param name="fontFile">Pointer to the newly created font file object.</p aram>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetCurrentFontFile)( STDMETHOD(GetCurrentFontFile)(
__out IDWriteFontFile** fontFile _COM_Outptr_ IDWriteFontFile** fontFile
) PURE; ) PURE;
}; };
/// <summary> /// <summary>
/// Represents a collection of strings indexed by locale name. /// Represents a collection of strings indexed by locale name.
/// </summary> /// </summary>
interface DWRITE_DECLARE_INTERFACE("08256209-099a-4b34-b86d-c22b110e7771") IDWri teLocalizedStrings : public IUnknown interface DWRITE_DECLARE_INTERFACE("08256209-099a-4b34-b86d-c22b110e7771") IDWri teLocalizedStrings : public IUnknown
{ {
/// <summary> /// <summary>
/// Gets the number of language/string pairs. /// Gets the number of language/string pairs.
skipping to change at line 1311 skipping to change at line 1351
/// Gets the index of the item with the specified locale name. /// Gets the index of the item with the specified locale name.
/// </summary> /// </summary>
/// <param name="localeName">Locale name to look for.</param> /// <param name="localeName">Locale name to look for.</param>
/// <param name="index">Receives the zero-based index of the locale name/str ing pair.</param> /// <param name="index">Receives the zero-based index of the locale name/str ing pair.</param>
/// <param name="exists">Receives TRUE if the locale name exists or FALSE if not.</param> /// <param name="exists">Receives TRUE if the locale name exists or FALSE if not.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. If the specified locale name does not exist , the return value is S_OK, /// Standard HRESULT error code. If the specified locale name does not exist , the return value is S_OK,
/// but *index is UINT_MAX and *exists is FALSE. /// but *index is UINT_MAX and *exists is FALSE.
/// </returns> /// </returns>
STDMETHOD(FindLocaleName)( STDMETHOD(FindLocaleName)(
__in_z WCHAR const* localeName, _In_z_ WCHAR const* localeName,
__out UINT32* index, _Out_ UINT32* index,
__out BOOL* exists _Out_ BOOL* exists
) PURE; ) PURE;
/// <summary> /// <summary>
/// Gets the length in characters (not including the null terminator) of the locale name with the specified index. /// Gets the length in characters (not including the null terminator) of the locale name with the specified index.
/// </summary> /// </summary>
/// <param name="index">Zero-based index of the locale name.</param> /// <param name="index">Zero-based index of the locale name.</param>
/// <param name="length">Receives the length in characters, not including th e null terminator.</param> /// <param name="length">Receives the length in characters, not including th e null terminator.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetLocaleNameLength)( STDMETHOD(GetLocaleNameLength)(
UINT32 index, UINT32 index,
__out UINT32* length _Out_ UINT32* length
) PURE; ) PURE;
/// <summary> /// <summary>
/// Copies the locale name with the specified index to the specified array. /// Copies the locale name with the specified index to the specified array.
/// </summary> /// </summary>
/// <param name="index">Zero-based index of the locale name.</param> /// <param name="index">Zero-based index of the locale name.</param>
/// <param name="localeName">Character array that receives the locale name.< /param> /// <param name="localeName">Character array that receives the locale name.< /param>
/// <param name="size">Size of the array in characters. The size must includ e space for the terminating /// <param name="size">Size of the array in characters. The size must includ e space for the terminating
/// null character.</param> /// null character.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetLocaleName)( STDMETHOD(GetLocaleName)(
UINT32 index, UINT32 index,
__out_ecount_z(size) WCHAR* localeName, _Out_writes_z_(size) WCHAR* localeName,
UINT32 size UINT32 size
) PURE; ) PURE;
/// <summary> /// <summary>
/// Gets the length in characters (not including the null terminator) of the string with the specified index. /// Gets the length in characters (not including the null terminator) of the string with the specified index.
/// </summary> /// </summary>
/// <param name="index">Zero-based index of the string.</param> /// <param name="index">Zero-based index of the string.</param>
/// <param name="length">Receives the length in characters, not including th e null terminator.</param> /// <param name="length">Receives the length in characters, not including th e null terminator.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetStringLength)( STDMETHOD(GetStringLength)(
UINT32 index, UINT32 index,
__out UINT32* length _Out_ UINT32* length
) PURE; ) PURE;
/// <summary> /// <summary>
/// Copies the string with the specified index to the specified array. /// Copies the string with the specified index to the specified array.
/// </summary> /// </summary>
/// <param name="index">Zero-based index of the string.</param> /// <param name="index">Zero-based index of the string.</param>
/// <param name="stringBuffer">Character array that receives the string.</pa ram> /// <param name="stringBuffer">Character array that receives the string.</pa ram>
/// <param name="size">Size of the array in characters. The size must includ e space for the terminating /// <param name="size">Size of the array in characters. The size must includ e space for the terminating
/// null character.</param> /// null character.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetString)( STDMETHOD(GetString)(
UINT32 index, UINT32 index,
__out_ecount_z(size) WCHAR* stringBuffer, _Out_writes_z_(size) WCHAR* stringBuffer,
UINT32 size UINT32 size
) PURE; ) PURE;
}; };
interface IDWriteFontFamily; interface IDWriteFontFamily;
interface IDWriteFont; interface IDWriteFont;
/// <summary> /// <summary>
/// The IDWriteFontCollection encapsulates a collection of fonts. /// The IDWriteFontCollection encapsulates a collection of fonts.
/// </summary> /// </summary>
skipping to change at line 1398 skipping to change at line 1438
/// <summary> /// <summary>
/// Creates a font family object given a zero-based font family index. /// Creates a font family object given a zero-based font family index.
/// </summary> /// </summary>
/// <param name="index">Zero-based index of the font family.</param> /// <param name="index">Zero-based index of the font family.</param>
/// <param name="fontFamily">Receives a pointer the newly created font famil y object.</param> /// <param name="fontFamily">Receives a pointer the newly created font famil y object.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetFontFamily)( STDMETHOD(GetFontFamily)(
UINT32 index, UINT32 index,
__out IDWriteFontFamily** fontFamily _COM_Outptr_ IDWriteFontFamily** fontFamily
) PURE; ) PURE;
/// <summary> /// <summary>
/// Finds the font family with the specified family name. /// Finds the font family with the specified family name.
/// </summary> /// </summary>
/// <param name="familyName">Name of the font family. The name is not case-s ensitive but must otherwise exactly match a family name in the collection.</para m> /// <param name="familyName">Name of the font family. The name is not case-s ensitive but must otherwise exactly match a family name in the collection.</para m>
/// <param name="index">Receives the zero-based index of the matching font f amily if the family name was found or UINT_MAX otherwise.</param> /// <param name="index">Receives the zero-based index of the matching font f amily if the family name was found or UINT_MAX otherwise.</param>
/// <param name="exists">Receives TRUE if the family name exists or FALSE ot herwise.</param> /// <param name="exists">Receives TRUE if the family name exists or FALSE ot herwise.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. If the specified family name does not exist , the return value is S_OK, but *index is UINT_MAX and *exists is FALSE. /// Standard HRESULT error code. If the specified family name does not exist , the return value is S_OK, but *index is UINT_MAX and *exists is FALSE.
/// </returns> /// </returns>
STDMETHOD(FindFamilyName)( STDMETHOD(FindFamilyName)(
__in_z WCHAR const* familyName, _In_z_ WCHAR const* familyName,
__out UINT32* index, _Out_ UINT32* index,
__out BOOL* exists _Out_ BOOL* exists
) PURE; ) PURE;
/// <summary> /// <summary>
/// Gets the font object that corresponds to the same physical font as the s pecified font face object. The specified physical font must belong /// Gets the font object that corresponds to the same physical font as the s pecified font face object. The specified physical font must belong
/// to the font collection. /// to the font collection.
/// </summary> /// </summary>
/// <param name="fontFace">Font face object that specifies the physical font .</param> /// <param name="fontFace">Font face object that specifies the physical font .</param>
/// <param name="font">Receives a pointer to the newly created font object i f successful or NULL otherwise.</param> /// <param name="font">Receives a pointer to the newly created font object i f successful or NULL otherwise.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. If the specified physical font is not part of the font collection the return value is DWRITE_E_NOFONT. /// Standard HRESULT error code. If the specified physical font is not part of the font collection the return value is DWRITE_E_NOFONT.
/// </returns> /// </returns>
STDMETHOD(GetFontFromFontFace)( STDMETHOD(GetFontFromFontFace)(
IDWriteFontFace* fontFace, _In_ IDWriteFontFace* fontFace,
__out IDWriteFont** font _COM_Outptr_ IDWriteFont** font
) PURE; ) PURE;
}; };
/// <summary> /// <summary>
/// The IDWriteFontList interface represents a list of fonts. /// The IDWriteFontList interface represents a list of fonts.
/// </summary> /// </summary>
interface DWRITE_DECLARE_INTERFACE("1a0d8438-1d97-4ec1-aef9-a2fb86ed6acb") IDWri teFontList : public IUnknown interface DWRITE_DECLARE_INTERFACE("1a0d8438-1d97-4ec1-aef9-a2fb86ed6acb") IDWri teFontList : public IUnknown
{ {
/// <summary> /// <summary>
/// Gets the font collection that contains the fonts. /// Gets the font collection that contains the fonts.
/// </summary> /// </summary>
/// <param name="fontCollection">Receives a pointer to the font collection o bject.</param> /// <param name="fontCollection">Receives a pointer to the font collection o bject.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetFontCollection)( STDMETHOD(GetFontCollection)(
__out IDWriteFontCollection** fontCollection _COM_Outptr_ IDWriteFontCollection** fontCollection
) PURE; ) PURE;
/// <summary> /// <summary>
/// Gets the number of fonts in the font list. /// Gets the number of fonts in the font list.
/// </summary> /// </summary>
STDMETHOD_(UINT32, GetFontCount)() PURE; STDMETHOD_(UINT32, GetFontCount)() PURE;
/// <summary> /// <summary>
/// Gets a font given its zero-based index. /// Gets a font given its zero-based index.
/// </summary> /// </summary>
/// <param name="index">Zero-based index of the font in the font list.</para m> /// <param name="index">Zero-based index of the font in the font list.</para m>
/// <param name="font">Receives a pointer to the newly created font object.< /param> /// <param name="font">Receives a pointer to the newly created font object.< /param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetFont)( STDMETHOD(GetFont)(
UINT32 index, UINT32 index,
__out IDWriteFont** font _COM_Outptr_ IDWriteFont** font
) PURE; ) PURE;
}; };
/// <summary> /// <summary>
/// The IDWriteFontFamily interface represents a set of fonts that share the sam e design but are differentiated /// The IDWriteFontFamily interface represents a set of fonts that share the sam e design but are differentiated
/// by weight, stretch, and style. /// by weight, stretch, and style.
/// </summary> /// </summary>
interface DWRITE_DECLARE_INTERFACE("da20d8ef-812a-4c43-9802-62ec4abd7add") IDWri teFontFamily : public IDWriteFontList interface DWRITE_DECLARE_INTERFACE("da20d8ef-812a-4c43-9802-62ec4abd7add") IDWri teFontFamily : public IDWriteFontList
{ {
/// <summary> /// <summary>
/// Creates an localized strings object that contains the family names for t he font family, indexed by locale name. /// Creates a localized strings object that contains the family names for th e font family, indexed by locale name.
/// </summary> /// </summary>
/// <param name="names">Receives a pointer to the newly created localized st rings object.</param> /// <param name="names">Receives a pointer to the newly created localized st rings object.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetFamilyNames)( STDMETHOD(GetFamilyNames)(
__out IDWriteLocalizedStrings** names _COM_Outptr_ IDWriteLocalizedStrings** names
) PURE; ) PURE;
/// <summary> /// <summary>
/// Gets the font that best matches the specified properties. /// Gets the font that best matches the specified properties.
/// </summary> /// </summary>
/// <param name="weight">Requested font weight.</param> /// <param name="weight">Requested font weight.</param>
/// <param name="stretch">Requested font stretch.</param> /// <param name="stretch">Requested font stretch.</param>
/// <param name="style">Requested font style.</param> /// <param name="style">Requested font style.</param>
/// <param name="matchingFont">Receives a pointer to the newly created font object.</param> /// <param name="matchingFont">Receives a pointer to the newly created font object.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetFirstMatchingFont)( STDMETHOD(GetFirstMatchingFont)(
DWRITE_FONT_WEIGHT weight, DWRITE_FONT_WEIGHT weight,
DWRITE_FONT_STRETCH stretch, DWRITE_FONT_STRETCH stretch,
DWRITE_FONT_STYLE style, DWRITE_FONT_STYLE style,
__out IDWriteFont** matchingFont _COM_Outptr_ IDWriteFont** matchingFont
) PURE; ) PURE;
/// <summary> /// <summary>
/// Gets a list of fonts in the font family ranked in order of how well they match the specified properties. /// Gets a list of fonts in the font family ranked in order of how well they match the specified properties.
/// </summary> /// </summary>
/// <param name="weight">Requested font weight.</param> /// <param name="weight">Requested font weight.</param>
/// <param name="stretch">Requested font stretch.</param> /// <param name="stretch">Requested font stretch.</param>
/// <param name="style">Requested font style.</param> /// <param name="style">Requested font style.</param>
/// <param name="matchingFonts">Receives a pointer to the newly created font list object.</param> /// <param name="matchingFonts">Receives a pointer to the newly created font list object.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetMatchingFonts)( STDMETHOD(GetMatchingFonts)(
DWRITE_FONT_WEIGHT weight, DWRITE_FONT_WEIGHT weight,
DWRITE_FONT_STRETCH stretch, DWRITE_FONT_STRETCH stretch,
DWRITE_FONT_STYLE style, DWRITE_FONT_STYLE style,
__out IDWriteFontList** matchingFonts _COM_Outptr_ IDWriteFontList** matchingFonts
) PURE; ) PURE;
}; };
/// <summary> /// <summary>
/// The IDWriteFont interface represents a physical font in a font collection. /// The IDWriteFont interface represents a physical font in a font collection.
/// </summary> /// </summary>
interface DWRITE_DECLARE_INTERFACE("acd16696-8c14-4f5d-877e-fe3fc1d32737") IDWri teFont : public IUnknown interface DWRITE_DECLARE_INTERFACE("acd16696-8c14-4f5d-877e-fe3fc1d32737") IDWri teFont : public IUnknown
{ {
/// <summary> /// <summary>
/// Gets the font family to which the specified font belongs. /// Gets the font family to which the specified font belongs.
/// </summary> /// </summary>
/// <param name="fontFamily">Receives a pointer to the font family object.</ param> /// <param name="fontFamily">Receives a pointer to the font family object.</ param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetFontFamily)( STDMETHOD(GetFontFamily)(
__out IDWriteFontFamily** fontFamily _COM_Outptr_ IDWriteFontFamily** fontFamily
) PURE; ) PURE;
/// <summary> /// <summary>
/// Gets the weight of the specified font. /// Gets the weight of the specified font.
/// </summary> /// </summary>
STDMETHOD_(DWRITE_FONT_WEIGHT, GetWeight)() PURE; STDMETHOD_(DWRITE_FONT_WEIGHT, GetWeight)() PURE;
/// <summary> /// <summary>
/// Gets the stretch (aka. width) of the specified font. /// Gets the stretch (aka. width) of the specified font.
/// </summary> /// </summary>
skipping to change at line 1562 skipping to change at line 1602
STDMETHOD_(BOOL, IsSymbolFont)() PURE; STDMETHOD_(BOOL, IsSymbolFont)() PURE;
/// <summary> /// <summary>
/// Gets a localized strings collection containing the face names for the fo nt (e.g., Regular or Bold), indexed by locale name. /// Gets a localized strings collection containing the face names for the fo nt (e.g., Regular or Bold), indexed by locale name.
/// </summary> /// </summary>
/// <param name="names">Receives a pointer to the newly created localized st rings object.</param> /// <param name="names">Receives a pointer to the newly created localized st rings object.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetFaceNames)( STDMETHOD(GetFaceNames)(
__out IDWriteLocalizedStrings** names _COM_Outptr_ IDWriteLocalizedStrings** names
) PURE; ) PURE;
/// <summary> /// <summary>
/// Gets a localized strings collection containing the specified information al strings, indexed by locale name. /// Gets a localized strings collection containing the specified information al strings, indexed by locale name.
/// </summary> /// </summary>
/// <param name="informationalStringID">Identifies the string to get.</param > /// <param name="informationalStringID">Identifies the string to get.</param >
/// <param name="informationalStrings">Receives a pointer to the newly creat ed localized strings object.</param> /// <param name="informationalStrings">Receives a pointer to the newly creat ed localized strings object.</param>
/// <param name="exists">Receives the value TRUE if the font contains the sp ecified string ID or FALSE if not.</param> /// <param name="exists">Receives the value TRUE if the font contains the sp ecified string ID or FALSE if not.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. If the font does not contain the specified string, the return value is S_OK but /// Standard HRESULT error code. If the font does not contain the specified string, the return value is S_OK but
/// informationalStrings receives a NULL pointer and exists receives the val ue FALSE. /// informationalStrings receives a NULL pointer and exists receives the val ue FALSE.
/// </returns> /// </returns>
STDMETHOD(GetInformationalStrings)( STDMETHOD(GetInformationalStrings)(
DWRITE_INFORMATIONAL_STRING_ID informationalStringID, DWRITE_INFORMATIONAL_STRING_ID informationalStringID,
__out IDWriteLocalizedStrings** informationalStrings, _COM_Outptr_ IDWriteLocalizedStrings** informationalStrings,
__out BOOL* exists _Out_ BOOL* exists
) PURE; ) PURE;
/// <summary> /// <summary>
/// Gets a value that indicates what simulation are applied to the specified font. /// Gets a value that indicates what simulation are applied to the specified font.
/// </summary> /// </summary>
STDMETHOD_(DWRITE_FONT_SIMULATIONS, GetSimulations)() PURE; STDMETHOD_(DWRITE_FONT_SIMULATIONS, GetSimulations)() PURE;
/// <summary> /// <summary>
/// Gets the metrics for the font. /// Gets the metrics for the font.
/// </summary> /// </summary>
/// <param name="fontMetrics">Receives the font metrics.</param> /// <param name="fontMetrics">Receives the font metrics.</param>
STDMETHOD_(void, GetMetrics)( STDMETHOD_(void, GetMetrics)(
__out DWRITE_FONT_METRICS* fontMetrics _Out_ DWRITE_FONT_METRICS* fontMetrics
) PURE; ) PURE;
/// <summary> /// <summary>
/// Determines whether the font supports the specified character. /// Determines whether the font supports the specified character.
/// </summary> /// </summary>
/// <param name="unicodeValue">Unicode (UCS-4) character value.</param> /// <param name="unicodeValue">Unicode (UCS-4) character value.</param>
/// <param name="exists">Receives the value TRUE if the font supports the sp ecified character or FALSE if not.</param> /// <param name="exists">Receives the value TRUE if the font supports the sp ecified character or FALSE if not.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(HasCharacter)( STDMETHOD(HasCharacter)(
UINT32 unicodeValue, UINT32 unicodeValue,
__out BOOL* exists _Out_ BOOL* exists
) PURE; ) PURE;
/// <summary> /// <summary>
/// Creates a font face object for the font. /// Creates a font face object for the font.
/// </summary> /// </summary>
/// <param name="fontFace">Receives a pointer to the newly created font face object.</param> /// <param name="fontFace">Receives a pointer to the newly created font face object.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(CreateFontFace)( STDMETHOD(CreateFontFace)(
__out IDWriteFontFace** fontFace _COM_Outptr_ IDWriteFontFace** fontFace
) PURE; ) PURE;
}; };
/// <summary> /// <summary>
/// Direction for how reading progresses. /// Direction for how reading progresses.
/// </summary> /// </summary>
enum DWRITE_READING_DIRECTION enum DWRITE_READING_DIRECTION
{ {
/// <summary> /// <summary>
/// Reading progresses from left to right. /// Reading progresses from left to right.
/// </summary> /// </summary>
DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, DWRITE_READING_DIRECTION_LEFT_TO_RIGHT = 0,
/// <summary> /// <summary>
/// Reading progresses from right to left. /// Reading progresses from right to left.
/// </summary> /// </summary>
DWRITE_READING_DIRECTION_RIGHT_TO_LEFT DWRITE_READING_DIRECTION_RIGHT_TO_LEFT = 1,
/// <summary>
/// Reading progresses from top to bottom.
/// </summary>
DWRITE_READING_DIRECTION_TOP_TO_BOTTOM = 2,
/// <summary>
/// Reading progresses from bottom to top.
/// </summary>
DWRITE_READING_DIRECTION_BOTTOM_TO_TOP = 3,
}; };
/// <summary> /// <summary>
/// Direction for how lines of text are placed relative to one another. /// Direction for how lines of text are placed relative to one another.
/// </summary> /// </summary>
enum DWRITE_FLOW_DIRECTION enum DWRITE_FLOW_DIRECTION
{ {
/// <summary> /// <summary>
/// Text lines are placed from top to bottom. /// Text lines are placed from top to bottom.
/// </summary> /// </summary>
DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM = 0,
/// <summary>
/// Text lines are placed from bottom to top.
/// </summary>
DWRITE_FLOW_DIRECTION_BOTTOM_TO_TOP = 1,
/// <summary>
/// Text lines are placed from left to right.
/// </summary>
DWRITE_FLOW_DIRECTION_LEFT_TO_RIGHT = 2,
/// <summary>
/// Text lines are placed from right to left.
/// </summary>
DWRITE_FLOW_DIRECTION_RIGHT_TO_LEFT = 3,
}; };
/// <summary> /// <summary>
/// Alignment of paragraph text along the reading direction axis relative to /// Alignment of paragraph text along the reading direction axis relative to
/// the leading and trailing edge of the layout box. /// the leading and trailing edge of the layout box.
/// </summary> /// </summary>
enum DWRITE_TEXT_ALIGNMENT enum DWRITE_TEXT_ALIGNMENT
{ {
/// <summary> /// <summary>
/// The leading edge of the paragraph text is aligned to the layout box's le ading edge. /// The leading edge of the paragraph text is aligned to the layout box's le ading edge.
skipping to change at line 1665 skipping to change at line 1730
DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_TEXT_ALIGNMENT_LEADING,
/// <summary> /// <summary>
/// The trailing edge of the paragraph text is aligned to the layout box's t railing edge. /// The trailing edge of the paragraph text is aligned to the layout box's t railing edge.
/// </summary> /// </summary>
DWRITE_TEXT_ALIGNMENT_TRAILING, DWRITE_TEXT_ALIGNMENT_TRAILING,
/// <summary> /// <summary>
/// The center of the paragraph text is aligned to the center of the layout box. /// The center of the paragraph text is aligned to the center of the layout box.
/// </summary> /// </summary>
DWRITE_TEXT_ALIGNMENT_CENTER DWRITE_TEXT_ALIGNMENT_CENTER,
/// <summary>
/// Align text to the leading side, and also justify text to fill the lines.
/// </summary>
DWRITE_TEXT_ALIGNMENT_JUSTIFIED
}; };
/// <summary> /// <summary>
/// Alignment of paragraph text along the flow direction axis relative to the /// Alignment of paragraph text along the flow direction axis relative to the
/// flow's beginning and ending edge of the layout box. /// flow's beginning and ending edge of the layout box.
/// </summary> /// </summary>
enum DWRITE_PARAGRAPH_ALIGNMENT enum DWRITE_PARAGRAPH_ALIGNMENT
{ {
/// <summary> /// <summary>
/// The first line of paragraph is aligned to the flow's beginning edge of t he layout box. /// The first line of paragraph is aligned to the flow's beginning edge of t he layout box.
skipping to change at line 1698 skipping to change at line 1768
}; };
/// <summary> /// <summary>
/// Word wrapping in multiline paragraph. /// Word wrapping in multiline paragraph.
/// </summary> /// </summary>
enum DWRITE_WORD_WRAPPING enum DWRITE_WORD_WRAPPING
{ {
/// <summary> /// <summary>
/// Words are broken across lines to avoid text overflowing the layout box. /// Words are broken across lines to avoid text overflowing the layout box.
/// </summary> /// </summary>
DWRITE_WORD_WRAPPING_WRAP, DWRITE_WORD_WRAPPING_WRAP = 0,
/// <summary> /// <summary>
/// Words are kept within the same line even when it overflows the layout bo x. /// Words are kept within the same line even when it overflows the layout bo x.
/// This option is often used with scrolling to reveal overflow text. /// This option is often used with scrolling to reveal overflow text.
/// </summary> /// </summary>
DWRITE_WORD_WRAPPING_NO_WRAP DWRITE_WORD_WRAPPING_NO_WRAP = 1,
/// <summary>
/// Words are broken across lines to avoid text overflowing the layout box.
/// Emergency wrapping occurs if the word is larger than the maximum width.
/// </summary>
DWRITE_WORD_WRAPPING_EMERGENCY_BREAK = 2,
/// <summary>
/// Only wrap whole words, never breaking words (emergency wrapping) when th
e
/// layout width is too small for even a single word.
/// </summary>
DWRITE_WORD_WRAPPING_WHOLE_WORD = 3,
/// <summary>
/// Wrap between any valid characters clusters.
/// </summary>
DWRITE_WORD_WRAPPING_CHARACTER = 4,
}; };
/// <summary> /// <summary>
/// The method used for line spacing in layout. /// The method used for line spacing in layout.
/// </summary> /// </summary>
enum DWRITE_LINE_SPACING_METHOD enum DWRITE_LINE_SPACING_METHOD
{ {
/// <summary> /// <summary>
/// Line spacing depends solely on the content, growing to accomodate the si ze of fonts and inline objects. /// Line spacing depends solely on the content, growing to accommodate the s ize of fonts and inline objects.
/// </summary> /// </summary>
DWRITE_LINE_SPACING_METHOD_DEFAULT, DWRITE_LINE_SPACING_METHOD_DEFAULT,
/// <summary> /// <summary>
/// Lines are explicitly set to uniform spacing, regardless of contained fon t sizes. /// Lines are explicitly set to uniform spacing, regardless of contained fon t sizes.
/// This can be useful to avoid the uneven appearance that can occur from fo nt fallback. /// This can be useful to avoid the uneven appearance that can occur from fo nt fallback.
/// </summary> /// </summary>
DWRITE_LINE_SPACING_METHOD_UNIFORM DWRITE_LINE_SPACING_METHOD_UNIFORM
}; };
skipping to change at line 1828 skipping to change at line 1915
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_20 = 0x30327373, // 'ss20' DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_20 = 0x30327373, // 'ss20'
DWRITE_FONT_FEATURE_TAG_SUBSCRIPT = 0x73627573, // 'subs' DWRITE_FONT_FEATURE_TAG_SUBSCRIPT = 0x73627573, // 'subs'
DWRITE_FONT_FEATURE_TAG_SUPERSCRIPT = 0x73707573, // 'sups' DWRITE_FONT_FEATURE_TAG_SUPERSCRIPT = 0x73707573, // 'sups'
DWRITE_FONT_FEATURE_TAG_SWASH = 0x68737773, // 'swsh' DWRITE_FONT_FEATURE_TAG_SWASH = 0x68737773, // 'swsh'
DWRITE_FONT_FEATURE_TAG_TITLING = 0x6c746974, // 'titl' DWRITE_FONT_FEATURE_TAG_TITLING = 0x6c746974, // 'titl'
DWRITE_FONT_FEATURE_TAG_TRADITIONAL_NAME_FORMS = 0x6d616e74, // 'tnam' DWRITE_FONT_FEATURE_TAG_TRADITIONAL_NAME_FORMS = 0x6d616e74, // 'tnam'
DWRITE_FONT_FEATURE_TAG_TABULAR_FIGURES = 0x6d756e74, // 'tnum' DWRITE_FONT_FEATURE_TAG_TABULAR_FIGURES = 0x6d756e74, // 'tnum'
DWRITE_FONT_FEATURE_TAG_TRADITIONAL_FORMS = 0x64617274, // 'trad' DWRITE_FONT_FEATURE_TAG_TRADITIONAL_FORMS = 0x64617274, // 'trad'
DWRITE_FONT_FEATURE_TAG_THIRD_WIDTHS = 0x64697774, // 'twid' DWRITE_FONT_FEATURE_TAG_THIRD_WIDTHS = 0x64697774, // 'twid'
DWRITE_FONT_FEATURE_TAG_UNICASE = 0x63696e75, // 'unic' DWRITE_FONT_FEATURE_TAG_UNICASE = 0x63696e75, // 'unic'
DWRITE_FONT_FEATURE_TAG_VERTICAL_WRITING = 0x74726576, //
'vert'
DWRITE_FONT_FEATURE_TAG_VERTICAL_ALTERNATES_AND_ROTATION = 0x32747276, //
'vrt2'
DWRITE_FONT_FEATURE_TAG_SLASHED_ZERO = 0x6f72657a, // 'zero' DWRITE_FONT_FEATURE_TAG_SLASHED_ZERO = 0x6f72657a, // 'zero'
}; };
/// <summary> /// <summary>
/// The DWRITE_TEXT_RANGE structure specifies a range of text positions where fo rmat is applied. /// The DWRITE_TEXT_RANGE structure specifies a range of text positions where fo rmat is applied.
/// </summary> /// </summary>
struct DWRITE_TEXT_RANGE struct DWRITE_TEXT_RANGE
{ {
/// <summary> /// <summary>
/// The start text position of the range. /// The start text position of the range.
skipping to change at line 1877 skipping to change at line 1966
/// <summary> /// <summary>
/// Defines a set of typographic features to be applied during shaping. /// Defines a set of typographic features to be applied during shaping.
/// Notice the character range which this feature list spans is specified /// Notice the character range which this feature list spans is specified
/// as a separate parameter to GetGlyphs. /// as a separate parameter to GetGlyphs.
/// </summary> /// </summary>
struct DWRITE_TYPOGRAPHIC_FEATURES struct DWRITE_TYPOGRAPHIC_FEATURES
{ {
/// <summary> /// <summary>
/// Array of font features. /// Array of font features.
/// </summary> /// </summary>
__field_ecount(featureCount) DWRITE_FONT_FEATURE* features; _Field_size_(featureCount) DWRITE_FONT_FEATURE* features;
/// <summary> /// <summary>
/// The number of features. /// The number of features.
/// </summary> /// </summary>
UINT32 featureCount; UINT32 featureCount;
}; };
/// <summary> /// <summary>
/// The DWRITE_TRIMMING structure specifies the trimming option for text overflo wing the layout box. /// The DWRITE_TRIMMING structure specifies the trimming option for text overflo wing the layout box.
/// </summary> /// </summary>
struct DWRITE_TRIMMING struct DWRITE_TRIMMING
{ {
/// <summary> /// <summary>
/// Text granularity of which trimming applies. /// Text granularity of which trimming applies.
/// </summary> /// </summary>
DWRITE_TRIMMING_GRANULARITY granularity; DWRITE_TRIMMING_GRANULARITY granularity;
/// <summary> /// <summary>
/// Character code used as the delimiter signaling the beginning of the port ion of text to be preserved, /// Character code used as the delimiter signaling the beginning of the port ion of text to be preserved,
/// most useful for path ellipsis, where the delimeter would be a slash. /// most useful for path ellipsis, where the delimiter would be a slash.
/// </summary> /// </summary>
UINT32 delimiter; UINT32 delimiter;
/// <summary> /// <summary>
/// How many occurences of the delimiter to step back. /// How many occurrences of the delimiter to step back.
/// </summary> /// </summary>
UINT32 delimiterCount; UINT32 delimiterCount;
}; };
interface IDWriteTypography; interface IDWriteTypography;
interface IDWriteInlineObject; interface IDWriteInlineObject;
/// <summary> /// <summary>
/// The format of text used for text layout purpose. /// The format of text used for text layout.
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// This object may not be thread-safe and it may carry the state of text format change. /// This object may not be thread-safe and it may carry the state of text format change.
/// </remarks> /// </remarks>
interface DWRITE_DECLARE_INTERFACE("9c906818-31d7-4fd3-a151-7c5e225db55a") IDWri teTextFormat : public IUnknown interface DWRITE_DECLARE_INTERFACE("9c906818-31d7-4fd3-a151-7c5e225db55a") IDWri teTextFormat : public IUnknown
{ {
/// <summary> /// <summary>
/// Set alignment option of text relative to layout box's leading and traili ng edge. /// Set alignment option of text relative to layout box's leading and traili ng edge.
/// </summary> /// </summary>
/// <param name="textAlignment">Text alignment option</param> /// <param name="textAlignment">Text alignment option</param>
skipping to change at line 1958 skipping to change at line 2047
DWRITE_WORD_WRAPPING wordWrapping DWRITE_WORD_WRAPPING wordWrapping
) PURE; ) PURE;
/// <summary> /// <summary>
/// Set paragraph reading direction. /// Set paragraph reading direction.
/// </summary> /// </summary>
/// <param name="readingDirection">Text reading direction</param> /// <param name="readingDirection">Text reading direction</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
/// <remarks>
/// The flow direction must be perpendicular to the reading direction.
/// Setting both to a vertical direction or both to horizontal yields
/// DWRITE_E_FLOWDIRECTIONCONFLICTS when calling GetMetrics or Draw.
/// </remark>
STDMETHOD(SetReadingDirection)( STDMETHOD(SetReadingDirection)(
DWRITE_READING_DIRECTION readingDirection DWRITE_READING_DIRECTION readingDirection
) PURE; ) PURE;
/// <summary> /// <summary>
/// Set paragraph flow direction. /// Set paragraph flow direction.
/// </summary> /// </summary>
/// <param name="flowDirection">Paragraph flow direction</param> /// <param name="flowDirection">Paragraph flow direction</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
/// <remarks>
/// The flow direction must be perpendicular to the reading direction.
/// Setting both to a vertical direction or both to horizontal yields
/// DWRITE_E_FLOWDIRECTIONCONFLICTS when calling GetMetrics or Draw.
/// </remark>
STDMETHOD(SetFlowDirection)( STDMETHOD(SetFlowDirection)(
DWRITE_FLOW_DIRECTION flowDirection DWRITE_FLOW_DIRECTION flowDirection
) PURE; ) PURE;
/// <summary> /// <summary>
/// Set incremental tab stop position. /// Set incremental tab stop position.
/// </summary> /// </summary>
/// <param name="incrementalTabStop">The incremental tab stop value</param> /// <param name="incrementalTabStop">The incremental tab stop value</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
skipping to change at line 1999 skipping to change at line 2098
/// <param name="trimmingSign">Application-defined omission sign. This param eter may be NULL if no trimming sign is desired.</param> /// <param name="trimmingSign">Application-defined omission sign. This param eter may be NULL if no trimming sign is desired.</param>
/// <remarks> /// <remarks>
/// Any inline object can be used for the trimming sign, but CreateEllipsisT rimmingSign /// Any inline object can be used for the trimming sign, but CreateEllipsisT rimmingSign
/// provides a typical ellipsis symbol. Trimming is also useful vertically f or hiding /// provides a typical ellipsis symbol. Trimming is also useful vertically f or hiding
/// partial lines. /// partial lines.
/// </remarks> /// </remarks>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(SetTrimming)( STDMETHOD(SetTrimming)(
__in DWRITE_TRIMMING const* trimmingOptions, _In_ DWRITE_TRIMMING const* trimmingOptions,
IDWriteInlineObject* trimmingSign _In_opt_ IDWriteInlineObject* trimmingSign
) PURE; ) PURE;
/// <summary> /// <summary>
/// Set line spacing. /// Set line spacing.
/// </summary> /// </summary>
/// <param name="lineSpacingMethod">How to determine line height.</param> /// <param name="lineSpacingMethod">How to determine line height.</param>
/// <param name="lineSpacing">The line height, or rather distance between on e baseline to another.</param> /// <param name="lineSpacing">The line height, or rather distance between on e baseline to another.</param>
/// <param name="baseline">Distance from top of line to baseline. A reasonab le ratio to lineSpacing is 80%.</param> /// <param name="baseline">Distance from top of line to baseline. A reasonab le ratio to lineSpacing is 80%.</param>
/// <remarks> /// <remarks>
/// For the default method, spacing depends solely on the content. /// For the default method, spacing depends solely on the content.
skipping to change at line 2061 skipping to change at line 2160
/// <summary> /// <summary>
/// Get trimming options for text overflowing the layout width. /// Get trimming options for text overflowing the layout width.
/// </summary> /// </summary>
/// <param name="trimmingOptions">Text trimming options.</param> /// <param name="trimmingOptions">Text trimming options.</param>
/// <param name="trimmingSign">Trimming omission sign. This parameter may be NULL.</param> /// <param name="trimmingSign">Trimming omission sign. This parameter may be NULL.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetTrimming)( STDMETHOD(GetTrimming)(
__out DWRITE_TRIMMING* trimmingOptions, _Out_ DWRITE_TRIMMING* trimmingOptions,
__out IDWriteInlineObject** trimmingSign _COM_Outptr_ IDWriteInlineObject** trimmingSign
) PURE; ) PURE;
/// <summary> /// <summary>
/// Get line spacing. /// Get line spacing.
/// </summary> /// </summary>
/// <param name="lineSpacingMethod">How line height is determined.</param> /// <param name="lineSpacingMethod">How line height is determined.</param>
/// <param name="lineSpacing">The line height, or rather distance between on e baseline to another.</param> /// <param name="lineSpacing">The line height, or rather distance between on e baseline to another.</param>
/// <param name="baseline">Distance from top of line to baseline.</param> /// <param name="baseline">Distance from top of line to baseline.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetLineSpacing)( STDMETHOD(GetLineSpacing)(
__out DWRITE_LINE_SPACING_METHOD* lineSpacingMethod, _Out_ DWRITE_LINE_SPACING_METHOD* lineSpacingMethod,
__out FLOAT* lineSpacing, _Out_ FLOAT* lineSpacing,
__out FLOAT* baseline _Out_ FLOAT* baseline
) PURE; ) PURE;
/// <summary> /// <summary>
/// Get the font collection. /// Get the font collection.
/// </summary> /// </summary>
/// <param name="fontCollection">The current font collection.</param> /// <param name="fontCollection">The current font collection.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetFontCollection)( STDMETHOD(GetFontCollection)(
__out IDWriteFontCollection** fontCollection _COM_Outptr_ IDWriteFontCollection** fontCollection
) PURE; ) PURE;
/// <summary> /// <summary>
/// Get the length of the font family name, in characters, not including the terminating NULL character. /// Get the length of the font family name, in characters, not including the terminating NULL character.
/// </summary> /// </summary>
STDMETHOD_(UINT32, GetFontFamilyNameLength)() PURE; STDMETHOD_(UINT32, GetFontFamilyNameLength)() PURE;
/// <summary> /// <summary>
/// Get a copy of the font family name. /// Get a copy of the font family name.
/// </summary> /// </summary>
/// <param name="fontFamilyName">Character array that receives the current f ont family name</param> /// <param name="fontFamilyName">Character array that receives the current f ont family name</param>
/// <param name="nameSize">Size of the character array in character count in cluding the terminated NULL character.</param> /// <param name="nameSize">Size of the character array in character count in cluding the terminated NULL character.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetFontFamilyName)( STDMETHOD(GetFontFamilyName)(
__out_ecount_z(nameSize) WCHAR* fontFamilyName, _Out_writes_z_(nameSize) WCHAR* fontFamilyName,
UINT32 nameSize UINT32 nameSize
) PURE; ) PURE;
/// <summary> /// <summary>
/// Get the font weight. /// Get the font weight.
/// </summary> /// </summary>
STDMETHOD_(DWRITE_FONT_WEIGHT, GetFontWeight)() PURE; STDMETHOD_(DWRITE_FONT_WEIGHT, GetFontWeight)() PURE;
/// <summary> /// <summary>
/// Get the font style. /// Get the font style.
skipping to change at line 2143 skipping to change at line 2242
/// <summary> /// <summary>
/// Get a copy of the locale name. /// Get a copy of the locale name.
/// </summary> /// </summary>
/// <param name="localeName">Character array that receives the current local e name</param> /// <param name="localeName">Character array that receives the current local e name</param>
/// <param name="nameSize">Size of the character array in character count in cluding the terminated NULL character.</param> /// <param name="nameSize">Size of the character array in character count in cluding the terminated NULL character.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetLocaleName)( STDMETHOD(GetLocaleName)(
__out_ecount_z(nameSize) WCHAR* localeName, _Out_writes_z_(nameSize) WCHAR* localeName,
UINT32 nameSize UINT32 nameSize
) PURE; ) PURE;
}; };
/// <summary> /// <summary>
/// Font typography setting. /// Font typography setting.
/// </summary> /// </summary>
interface DWRITE_DECLARE_INTERFACE("55f1112b-1dc2-4b3c-9541-f46894ed85b6") IDWri teTypography : public IUnknown interface DWRITE_DECLARE_INTERFACE("55f1112b-1dc2-4b3c-9541-f46894ed85b6") IDWri teTypography : public IUnknown
{ {
/// <summary> /// <summary>
skipping to change at line 2179 skipping to change at line 2278
/// <summary> /// <summary>
/// Get the font feature at the specified index. /// Get the font feature at the specified index.
/// </summary> /// </summary>
/// <param name="fontFeatureIndex">The zero-based index of the font feature to get.</param> /// <param name="fontFeatureIndex">The zero-based index of the font feature to get.</param>
/// <param name="fontFeature">The font feature.</param> /// <param name="fontFeature">The font feature.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetFontFeature)( STDMETHOD(GetFontFeature)(
UINT32 fontFeatureIndex, UINT32 fontFeatureIndex,
__out DWRITE_FONT_FEATURE* fontFeature _Out_ DWRITE_FONT_FEATURE* fontFeature
) PURE; ) PURE;
}; };
enum DWRITE_SCRIPT_SHAPES enum DWRITE_SCRIPT_SHAPES
{ {
/// <summary> /// <summary>
/// No additional shaping requirement. Text is shaped with the writing syste m default behavior. /// No additional shaping requirement. Text is shaped with the writing syste m default behavior.
/// </summary> /// </summary>
DWRITE_SCRIPT_SHAPES_DEFAULT = 0, DWRITE_SCRIPT_SHAPES_DEFAULT = 0,
skipping to change at line 2405 skipping to change at line 2504
/// </summary> /// </summary>
/// <param name="textPosition">First position of the piece to obtain. All /// <param name="textPosition">First position of the piece to obtain. All
/// positions are in UTF16 code-units, not whole characters, which /// positions are in UTF16 code-units, not whole characters, which
/// matters when supplementary characters are used.</param> /// matters when supplementary characters are used.</param>
/// <param name="textString">Address that receives a pointer to the text blo ck /// <param name="textString">Address that receives a pointer to the text blo ck
/// at the specified position.</param> /// at the specified position.</param>
/// <param name="textLength">Number of UTF16 units of the retrieved chunk. /// <param name="textLength">Number of UTF16 units of the retrieved chunk.
/// The returned length is not the length of the block, but the length /// The returned length is not the length of the block, but the length
/// remaining in the block, from the given position until its end. /// remaining in the block, from the given position until its end.
/// So querying for a position that is 75 positions into a 100 /// So querying for a position that is 75 positions into a 100
/// postition block would return 25.</param> /// position block would return 25.</param>
/// <returns>Pointer to the first character at the given text position. /// <returns>Pointer to the first character at the given text position.
/// NULL indicates no chunk available at the specified position, either /// NULL indicates no chunk available at the specified position, either
/// because textPosition >= the entire text content length or because the /// because textPosition >= the entire text content length or because the
/// queried position is not mapped into the app's backing store.</returns> /// queried position is not mapped into the app's backing store.</returns>
/// <remarks> /// <remarks>
/// Although apps can implement sparse textual content that only maps part o f /// Although apps can implement sparse textual content that only maps part o f
/// the backing store, the app must map any text that is in the range passed /// the backing store, the app must map any text that is in the range passed
/// to any analysis functions. /// to any analysis functions.
/// </remarks> /// </remarks>
STDMETHOD(GetTextAtPosition)( STDMETHOD(GetTextAtPosition)(
UINT32 textPosition, UINT32 textPosition,
__out WCHAR const** textString, _Outptr_result_buffer_(*textLength) WCHAR const** textString,
__out UINT32* textLength _Out_ UINT32* textLength
) PURE; ) PURE;
/// <summary> /// <summary>
/// Get a block of text immediately preceding the specified position. /// Get a block of text immediately preceding the specified position.
/// </summary> /// </summary>
/// <param name="textPosition">Position immediately after the last position of the chunk to obtain.</param> /// <param name="textPosition">Position immediately after the last position of the chunk to obtain.</param>
/// <param name="textString">Address that receives a pointer to the text blo ck /// <param name="textString">Address that receives a pointer to the text blo ck
/// at the specified position.</param> /// at the specified position.</param>
/// <param name="textLength">Number of UTF16 units of the retrieved block. /// <param name="textLength">Number of UTF16 units of the retrieved block.
/// The length returned is from the given position to the front of /// The length returned is from the given position to the front of
skipping to change at line 2442 skipping to change at line 2541
/// because textPosition == 0,the textPosition > the entire text content /// because textPosition == 0,the textPosition > the entire text content
/// length, or the queried position is not mapped into the app's backing /// length, or the queried position is not mapped into the app's backing
/// store.</returns> /// store.</returns>
/// <remarks> /// <remarks>
/// Although apps can implement sparse textual content that only maps part o f /// Although apps can implement sparse textual content that only maps part o f
/// the backing store, the app must map any text that is in the range passed /// the backing store, the app must map any text that is in the range passed
/// to any analysis functions. /// to any analysis functions.
/// </remarks> /// </remarks>
STDMETHOD(GetTextBeforePosition)( STDMETHOD(GetTextBeforePosition)(
UINT32 textPosition, UINT32 textPosition,
__out WCHAR const** textString, _Outptr_result_buffer_(*textLength) WCHAR const** textString,
__out UINT32* textLength _Out_ UINT32* textLength
) PURE; ) PURE;
/// <summary> /// <summary>
/// Get paragraph reading direction. /// Get paragraph reading direction.
/// </summary> /// </summary>
STDMETHOD_(DWRITE_READING_DIRECTION, GetParagraphReadingDirection)() PURE; STDMETHOD_(DWRITE_READING_DIRECTION, GetParagraphReadingDirection)() PURE;
/// <summary> /// <summary>
/// Get locale name on the range affected by it. /// Get locale name on the range affected by it.
/// </summary> /// </summary>
skipping to change at line 2465 skipping to change at line 2564
/// <param name="textLength">Receives the length from the given position up to the /// <param name="textLength">Receives the length from the given position up to the
/// next differing locale.</param> /// next differing locale.</param>
/// <param name="localeName">Address that receives a pointer to the locale /// <param name="localeName">Address that receives a pointer to the locale
/// at the specified position.</param> /// at the specified position.</param>
/// <remarks> /// <remarks>
/// The localeName pointer must remain valid until the next call or until /// The localeName pointer must remain valid until the next call or until
/// the analysis returns. /// the analysis returns.
/// </remarks> /// </remarks>
STDMETHOD(GetLocaleName)( STDMETHOD(GetLocaleName)(
UINT32 textPosition, UINT32 textPosition,
__out UINT32* textLength, _Out_ UINT32* textLength,
__out_z WCHAR const** localeName _Outptr_result_z_ WCHAR const** localeName
) PURE; ) PURE;
/// <summary> /// <summary>
/// Get number substitution on the range affected by it. /// Get number substitution on the range affected by it.
/// </summary> /// </summary>
/// <param name="textPosition">Position to get the number substitution of.</ param> /// <param name="textPosition">Position to get the number substitution of.</ param>
/// <param name="textLength">Receives the length from the given position up to the /// <param name="textLength">Receives the length from the given position up to the
/// next differing number substitution.</param> /// next differing number substitution.</param>
/// <param name="numberSubstitution">Address that receives a pointer to the number substitution /// <param name="numberSubstitution">Address that receives a pointer to the number substitution
/// at the specified position.</param> /// at the specified position.</param>
/// <remarks> /// <remarks>
/// Any implementation should return the number substitution with an /// Any implementation should return the number substitution with an
/// incremented ref count, and the analysis will release when finished /// incremented ref count, and the analysis will release when finished
/// with it (either before the next call or before it returns). However, /// with it (either before the next call or before it returns). However,
/// the sink callback may hold onto it after that. /// the sink callback may hold onto it after that.
/// </remarks> /// </remarks>
STDMETHOD(GetNumberSubstitution)( STDMETHOD(GetNumberSubstitution)(
UINT32 textPosition, UINT32 textPosition,
__out UINT32* textLength, _Out_ UINT32* textLength,
__out IDWriteNumberSubstitution** numberSubstitution _Outptr_ IDWriteNumberSubstitution** numberSubstitution
) PURE; ) PURE;
}; };
/// <summary> /// <summary>
/// The interface implemented by the text analyzer's client to receive the /// The interface implemented by the text analyzer's client to receive the
/// output of a given text analysis. The Text analyzer disregards any current /// output of a given text analysis. The Text analyzer disregards any current
/// state of the analysis sink, therefore a Set method call on a range /// state of the analysis sink, therefore a Set method call on a range
/// overwrites the previously set analysis result of the same range. /// overwrites the previously set analysis result of the same range.
/// </summary> /// </summary>
interface DECLSPEC_UUID("5810cd44-0ca0-4701-b3fa-bec5182ae4f6") DECLSPEC_NOVTABL E IDWriteTextAnalysisSink : public IUnknown interface DECLSPEC_UUID("5810cd44-0ca0-4701-b3fa-bec5182ae4f6") DECLSPEC_NOVTABL E IDWriteTextAnalysisSink : public IUnknown
skipping to change at line 2510 skipping to change at line 2609
/// </summary> /// </summary>
/// <param name="textPosition">Starting position to report from.</param> /// <param name="textPosition">Starting position to report from.</param>
/// <param name="textLength">Number of UTF16 units of the reported range.</p aram> /// <param name="textLength">Number of UTF16 units of the reported range.</p aram>
/// <param name="scriptAnalysis">Script analysis of characters in range.</pa ram> /// <param name="scriptAnalysis">Script analysis of characters in range.</pa ram>
/// <returns> /// <returns>
/// A successful code or error code to abort analysis. /// A successful code or error code to abort analysis.
/// </returns> /// </returns>
STDMETHOD(SetScriptAnalysis)( STDMETHOD(SetScriptAnalysis)(
UINT32 textPosition, UINT32 textPosition,
UINT32 textLength, UINT32 textLength,
__in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis _In_ DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis
) PURE; ) PURE;
/// <summary> /// <summary>
/// Repport line-break opportunities for each character, starting from /// Report line-break opportunities for each character, starting from
/// the specified position. /// the specified position.
/// </summary> /// </summary>
/// <param name="textPosition">Starting position to report from.</param> /// <param name="textPosition">Starting position to report from.</param>
/// <param name="textLength">Number of UTF16 units of the reported range.</p aram> /// <param name="textLength">Number of UTF16 units of the reported range.</p aram>
/// <param name="lineBreakpoints">Breaking conditions for each character.</p aram> /// <param name="lineBreakpoints">Breaking conditions for each character.</p aram>
/// <returns> /// <returns>
/// A successful code or error code to abort analysis. /// A successful code or error code to abort analysis.
/// </returns> /// </returns>
STDMETHOD(SetLineBreakpoints)( STDMETHOD(SetLineBreakpoints)(
UINT32 textPosition, UINT32 textPosition,
UINT32 textLength, UINT32 textLength,
__in_ecount(textLength) DWRITE_LINE_BREAKPOINT const* lineBreakpoints _In_reads_(textLength) DWRITE_LINE_BREAKPOINT const* lineBreakpoints
) PURE; ) PURE;
/// <summary> /// <summary>
/// Set bidirectional level on the range, called once per each /// Set bidirectional level on the range, called once per each
/// level run change (either explicit or resolved implicit). /// level run change (either explicit or resolved implicit).
/// </summary> /// </summary>
/// <param name="textPosition">Starting position to report from.</param> /// <param name="textPosition">Starting position to report from.</param>
/// <param name="textLength">Number of UTF16 units of the reported range.</p aram> /// <param name="textLength">Number of UTF16 units of the reported range.</p aram>
/// <param name="explicitLevel">Explicit level from embedded control codes /// <param name="explicitLevel">Explicit level from embedded control codes
/// RLE/RLO/LRE/LRO/PDF, determined before any additional rules.</param> /// RLE/RLO/LRE/LRO/PDF, determined before any additional rules.</param>
skipping to change at line 2570 skipping to change at line 2669
/// </returns> /// </returns>
/// <remark> /// <remark>
/// Unlike script and bidi analysis, where every character passed to the /// Unlike script and bidi analysis, where every character passed to the
/// analyzer has a result, this will only be called for those ranges where /// analyzer has a result, this will only be called for those ranges where
/// substitution is applicable. For any other range, you will simply not /// substitution is applicable. For any other range, you will simply not
/// be called. /// be called.
/// </remark> /// </remark>
STDMETHOD(SetNumberSubstitution)( STDMETHOD(SetNumberSubstitution)(
UINT32 textPosition, UINT32 textPosition,
UINT32 textLength, UINT32 textLength,
__notnull IDWriteNumberSubstitution* numberSubstitution _In_ IDWriteNumberSubstitution* numberSubstitution
) PURE; ) PURE;
}; };
/// <summary> /// <summary>
/// Analyzes various text properties for complex script processing. /// Analyzes various text properties for complex script processing.
/// </summary> /// </summary>
interface DWRITE_DECLARE_INTERFACE("b7e6163e-7f46-43b4-84b3-e4e6249c365d") IDWri teTextAnalyzer : public IUnknown interface DWRITE_DECLARE_INTERFACE("b7e6163e-7f46-43b4-84b3-e4e6249c365d") IDWri teTextAnalyzer : public IUnknown
{ {
/// <summary> /// <summary>
/// Analyzes a text range for script boundaries, reading text attributes /// Analyzes a text range for script boundaries, reading text attributes
skipping to change at line 2592 skipping to change at line 2691
/// callback SetScript. /// callback SetScript.
/// </summary> /// </summary>
/// <param name="analysisSource">Source object to analyze.</param> /// <param name="analysisSource">Source object to analyze.</param>
/// <param name="textPosition">Starting position within the source object.</ param> /// <param name="textPosition">Starting position within the source object.</ param>
/// <param name="textLength">Length to analyze.</param> /// <param name="textLength">Length to analyze.</param>
/// <param name="analysisSink">Callback object.</param> /// <param name="analysisSink">Callback object.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(AnalyzeScript)( STDMETHOD(AnalyzeScript)(
IDWriteTextAnalysisSource* analysisSource, _In_ IDWriteTextAnalysisSource* analysisSource,
UINT32 textPosition, UINT32 textPosition,
UINT32 textLength, UINT32 textLength,
IDWriteTextAnalysisSink* analysisSink _In_ IDWriteTextAnalysisSink* analysisSink
) PURE; ) PURE;
/// <summary> /// <summary>
/// Analyzes a text range for script directionality, reading attributes /// Analyzes a text range for script directionality, reading attributes
/// from the source and reporting levels to the sink callback SetBidiLevel. /// from the source and reporting levels to the sink callback SetBidiLevel.
/// </summary> /// </summary>
/// <param name="analysisSource">Source object to analyze.</param> /// <param name="analysisSource">Source object to analyze.</param>
/// <param name="textPosition">Starting position within the source object.</ param> /// <param name="textPosition">Starting position within the source object.</ param>
/// <param name="textLength">Length to analyze.</param> /// <param name="textLength">Length to analyze.</param>
/// <param name="analysisSink">Callback object.</param> /// <param name="analysisSink">Callback object.</param>
skipping to change at line 2619 skipping to change at line 2718
/// <remarks> /// <remarks>
/// While the function can handle multiple paragraphs, the text range /// While the function can handle multiple paragraphs, the text range
/// should not arbitrarily split the middle of paragraphs. Otherwise the /// should not arbitrarily split the middle of paragraphs. Otherwise the
/// returned levels may be wrong, since the Bidi algorithm is meant to /// returned levels may be wrong, since the Bidi algorithm is meant to
/// apply to the paragraph as a whole. /// apply to the paragraph as a whole.
/// </remarks> /// </remarks>
/// <remarks> /// <remarks>
/// Embedded control codes (LRE/LRO/RLE/RLO/PDF) are taken into account. /// Embedded control codes (LRE/LRO/RLE/RLO/PDF) are taken into account.
/// </remarks> /// </remarks>
STDMETHOD(AnalyzeBidi)( STDMETHOD(AnalyzeBidi)(
IDWriteTextAnalysisSource* analysisSource, _In_ IDWriteTextAnalysisSource* analysisSource,
UINT32 textPosition, UINT32 textPosition,
UINT32 textLength, UINT32 textLength,
IDWriteTextAnalysisSink* analysisSink _In_ IDWriteTextAnalysisSink* analysisSink
) PURE; ) PURE;
/// <summary> /// <summary>
/// Analyzes a text range for spans where number substitution is applicable, /// Analyzes a text range for spans where number substitution is applicable,
/// reading attributes from the source and reporting substitutable ranges /// reading attributes from the source and reporting substitutable ranges
/// to the sink callback SetNumberSubstitution. /// to the sink callback SetNumberSubstitution.
/// </summary> /// </summary>
/// <param name="analysisSource">Source object to analyze.</param> /// <param name="analysisSource">Source object to analyze.</param>
/// <param name="textPosition">Starting position within the source object.</ param> /// <param name="textPosition">Starting position within the source object.</ param>
/// <param name="textLength">Length to analyze.</param> /// <param name="textLength">Length to analyze.</param>
skipping to change at line 2647 skipping to change at line 2746
/// <remarks> /// <remarks>
/// While the function can handle multiple ranges of differing number /// While the function can handle multiple ranges of differing number
/// substitutions, the text ranges should not arbitrarily split the /// substitutions, the text ranges should not arbitrarily split the
/// middle of numbers. Otherwise it will treat the numbers separately /// middle of numbers. Otherwise it will treat the numbers separately
/// and will not translate any intervening punctuation. /// and will not translate any intervening punctuation.
/// </remarks> /// </remarks>
/// <remarks> /// <remarks>
/// Embedded control codes (LRE/LRO/RLE/RLO/PDF) are taken into account. /// Embedded control codes (LRE/LRO/RLE/RLO/PDF) are taken into account.
/// </remarks> /// </remarks>
STDMETHOD(AnalyzeNumberSubstitution)( STDMETHOD(AnalyzeNumberSubstitution)(
IDWriteTextAnalysisSource* analysisSource, _In_ IDWriteTextAnalysisSource* analysisSource,
UINT32 textPosition, UINT32 textPosition,
UINT32 textLength, UINT32 textLength,
IDWriteTextAnalysisSink* analysisSink _In_ IDWriteTextAnalysisSink* analysisSink
) PURE; ) PURE;
/// <summary> /// <summary>
/// Analyzes a text range for potential breakpoint opportunities, reading /// Analyzes a text range for potential breakpoint opportunities, reading
/// attributes from the source and reporting breakpoint opportunities to /// attributes from the source and reporting breakpoint opportunities to
/// the sink callback SetLineBreakpoints. /// the sink callback SetLineBreakpoints.
/// </summary> /// </summary>
/// <param name="analysisSource">Source object to analyze.</param> /// <param name="analysisSource">Source object to analyze.</param>
/// <param name="textPosition">Starting position within the source object.</ param> /// <param name="textPosition">Starting position within the source object.</ param>
/// <param name="textLength">Length to analyze.</param> /// <param name="textLength">Length to analyze.</param>
skipping to change at line 2682 skipping to change at line 2781
/// <remarks> /// <remarks>
/// Special cases include the first, last, and surrogate characters. Any /// Special cases include the first, last, and surrogate characters. Any
/// text span is treated as if adjacent to inline objects on either side. /// text span is treated as if adjacent to inline objects on either side.
/// So the rules with contingent-break opportunities are used, where the /// So the rules with contingent-break opportunities are used, where the
/// edge between text and inline objects is always treated as a potential /// edge between text and inline objects is always treated as a potential
/// break opportunity, dependent on any overriding rules of the adjacent /// break opportunity, dependent on any overriding rules of the adjacent
/// objects to prohibit or force the break (see Unicode TR #14). /// objects to prohibit or force the break (see Unicode TR #14).
/// Surrogate pairs never break between. /// Surrogate pairs never break between.
/// </remarks> /// </remarks>
STDMETHOD(AnalyzeLineBreakpoints)( STDMETHOD(AnalyzeLineBreakpoints)(
IDWriteTextAnalysisSource* analysisSource, _In_ IDWriteTextAnalysisSource* analysisSource,
UINT32 textPosition, UINT32 textPosition,
UINT32 textLength, UINT32 textLength,
IDWriteTextAnalysisSink* analysisSink _In_ IDWriteTextAnalysisSink* analysisSink
) PURE; ) PURE;
/// <summary> /// <summary>
/// Parses the input text string and maps it to the set of glyphs and associ ated glyph data /// Parses the input text string and maps it to the set of glyphs and associ ated glyph data
/// according to the font and the writing system's rendering rules. /// according to the font and the writing system's rendering rules.
/// </summary> /// </summary>
/// <param name="textString">The string to convert to glyphs.</param> /// <param name="textString">The string to convert to glyphs.</param>
/// <param name="textLength">The length of textString.</param> /// <param name="textLength">The length of textString.</param>
/// <param name="fontFace">The font face to get glyphs from.</param> /// <param name="fontFace">The font face to get glyphs from.</param>
/// <param name="isSideways">Set to true if the text is intended to be /// <param name="isSideways">Set to true if the text is intended to be
skipping to change at line 2735 skipping to change at line 2834
/// Note that the mapping from characters to glyphs is, in general, many- /// Note that the mapping from characters to glyphs is, in general, many-
/// to-many. The recommended estimate for the per-glyph output buffers is /// to-many. The recommended estimate for the per-glyph output buffers is
/// (3 * textLength / 2 + 16). This is not guaranteed to be sufficient. /// (3 * textLength / 2 + 16). This is not guaranteed to be sufficient.
/// ///
/// The value of the actualGlyphCount parameter is only valid if the call /// The value of the actualGlyphCount parameter is only valid if the call
/// succeeds. In the event that maxGlyphCount is not big enough /// succeeds. In the event that maxGlyphCount is not big enough
/// E_NOT_SUFFICIENT_BUFFER, which is equivalent to HRESULT_FROM_WIN32(ERROR _INSUFFICIENT_BUFFER), /// E_NOT_SUFFICIENT_BUFFER, which is equivalent to HRESULT_FROM_WIN32(ERROR _INSUFFICIENT_BUFFER),
/// will be returned. The application should allocate a larger buffer and t ry again. /// will be returned. The application should allocate a larger buffer and t ry again.
/// </remarks> /// </remarks>
STDMETHOD(GetGlyphs)( STDMETHOD(GetGlyphs)(
__in_ecount(textLength) WCHAR const* textString, _In_reads_(textLength) WCHAR const* textString,
UINT32 textLength, UINT32 textLength,
IDWriteFontFace* fontFace, _In_ IDWriteFontFace* fontFace,
BOOL isSideways, BOOL isSideways,
BOOL isRightToLeft, BOOL isRightToLeft,
__in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis, _In_ DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis,
__in_z_opt WCHAR const* localeName, _In_opt_z_ WCHAR const* localeName,
__maybenull IDWriteNumberSubstitution* numberSubstitution, _In_opt_ IDWriteNumberSubstitution* numberSubstitution,
__in_ecount_opt(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** featu _In_reads_opt_(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** featur
res, es,
__in_ecount_opt(featureRanges) UINT32 const* featureRangeLengths, _In_reads_opt_(featureRanges) UINT32 const* featureRangeLengths,
UINT32 featureRanges, UINT32 featureRanges,
UINT32 maxGlyphCount, UINT32 maxGlyphCount,
__out_ecount(textLength) UINT16* clusterMap, _Out_writes_(textLength) UINT16* clusterMap,
__out_ecount(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps, _Out_writes_(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps,
__out_ecount(maxGlyphCount) UINT16* glyphIndices, _Out_writes_(maxGlyphCount) UINT16* glyphIndices,
__out_ecount(maxGlyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES* glyphProps, _Out_writes_(maxGlyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES* glyphProps,
__out UINT32* actualGlyphCount _Out_ UINT32* actualGlyphCount
) PURE; ) PURE;
/// <summary> /// <summary>
/// Place glyphs output from the GetGlyphs method according to the font /// Place glyphs output from the GetGlyphs method according to the font
/// and the writing system's rendering rules. /// and the writing system's rendering rules.
/// </summary> /// </summary>
/// <param name="textString">The original string the glyphs came from.</para m> /// <param name="textString">The original string the glyphs came from.</para m>
/// <param name="clusterMap">The mapping from character ranges to glyph /// <param name="clusterMap">The mapping from character ranges to glyph
/// ranges. Returned by GetGlyphs.</param> /// ranges. Returned by GetGlyphs.</param>
/// <param name="textProps">Per-character properties. Returned by /// <param name="textProps">Per-character properties. Returned by
skipping to change at line 2787 skipping to change at line 2886
/// features to use in each feature range.</param> /// features to use in each feature range.</param>
/// <param name="featureRangeLengths">The length of each feature range, in c haracters. /// <param name="featureRangeLengths">The length of each feature range, in c haracters.
/// The sum of all lengths should be equal to textLength.</param> /// The sum of all lengths should be equal to textLength.</param>
/// <param name="featureRanges">The number of feature ranges.</param> /// <param name="featureRanges">The number of feature ranges.</param>
/// <param name="glyphAdvances">The advance width of each glyph.</param> /// <param name="glyphAdvances">The advance width of each glyph.</param>
/// <param name="glyphOffsets">The offset of the origin of each glyph.</para m> /// <param name="glyphOffsets">The offset of the origin of each glyph.</para m>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetGlyphPlacements)( STDMETHOD(GetGlyphPlacements)(
__in_ecount(textLength) WCHAR const* textString, _In_reads_(textLength) WCHAR const* textString,
__in_ecount(textLength) UINT16 const* clusterMap, _In_reads_(textLength) UINT16 const* clusterMap,
__in_ecount(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps, _In_reads_(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps,
UINT32 textLength, UINT32 textLength,
__in_ecount(glyphCount) UINT16 const* glyphIndices, _In_reads_(glyphCount) UINT16 const* glyphIndices,
__in_ecount(glyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES const* glyphProp _In_reads_(glyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES const* glyphProps
s, ,
UINT32 glyphCount, UINT32 glyphCount,
IDWriteFontFace * fontFace, _In_ IDWriteFontFace * fontFace,
FLOAT fontEmSize, FLOAT fontEmSize,
BOOL isSideways, BOOL isSideways,
BOOL isRightToLeft, BOOL isRightToLeft,
__in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis, _In_ DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis,
__in_z_opt WCHAR const* localeName, _In_opt_z_ WCHAR const* localeName,
__in_ecount_opt(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** featu _In_reads_opt_(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** featur
res, es,
__in_ecount_opt(featureRanges) UINT32 const* featureRangeLengths, _In_reads_opt_(featureRanges) UINT32 const* featureRangeLengths,
UINT32 featureRanges, UINT32 featureRanges,
__out_ecount(glyphCount) FLOAT* glyphAdvances, _Out_writes_(glyphCount) FLOAT* glyphAdvances,
__out_ecount(glyphCount) DWRITE_GLYPH_OFFSET* glyphOffsets _Out_writes_(glyphCount) DWRITE_GLYPH_OFFSET* glyphOffsets
) PURE; ) PURE;
/// <summary> /// <summary>
/// Place glyphs output from the GetGlyphs method according to the font /// Place glyphs output from the GetGlyphs method according to the font
/// and the writing system's rendering rules. /// and the writing system's rendering rules.
/// </summary> /// </summary>
/// <param name="textString">The original string the glyphs came from.</para m> /// <param name="textString">The original string the glyphs came from.</para m>
/// <param name="clusterMap">The mapping from character ranges to glyph /// <param name="clusterMap">The mapping from character ranges to glyph
/// ranges. Returned by GetGlyphs.</param> /// ranges. Returned by GetGlyphs.</param>
/// <param name="textProps">Per-character properties. Returned by /// <param name="textProps">Per-character properties. Returned by
skipping to change at line 2849 skipping to change at line 2948
/// features to use in each feature range.</param> /// features to use in each feature range.</param>
/// <param name="featureRangeLengths">The length of each feature range, in c haracters. /// <param name="featureRangeLengths">The length of each feature range, in c haracters.
/// The sum of all lengths should be equal to textLength.</param> /// The sum of all lengths should be equal to textLength.</param>
/// <param name="featureRanges">The number of feature ranges.</param> /// <param name="featureRanges">The number of feature ranges.</param>
/// <param name="glyphAdvances">The advance width of each glyph.</param> /// <param name="glyphAdvances">The advance width of each glyph.</param>
/// <param name="glyphOffsets">The offset of the origin of each glyph.</para m> /// <param name="glyphOffsets">The offset of the origin of each glyph.</para m>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetGdiCompatibleGlyphPlacements)( STDMETHOD(GetGdiCompatibleGlyphPlacements)(
__in_ecount(textLength) WCHAR const* textString, _In_reads_(textLength) WCHAR const* textString,
__in_ecount(textLength) UINT16 const* clusterMap, _In_reads_(textLength) UINT16 const* clusterMap,
__in_ecount(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps, _In_reads_(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps,
UINT32 textLength, UINT32 textLength,
__in_ecount(glyphCount) UINT16 const* glyphIndices, _In_reads_(glyphCount) UINT16 const* glyphIndices,
__in_ecount(glyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES const* glyphProp _In_reads_(glyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES const* glyphProps
s, ,
UINT32 glyphCount, UINT32 glyphCount,
IDWriteFontFace * fontFace, _In_ IDWriteFontFace * fontFace,
FLOAT fontEmSize, FLOAT fontEmSize,
FLOAT pixelsPerDip, FLOAT pixelsPerDip,
__in_opt DWRITE_MATRIX const* transform, _In_opt_ DWRITE_MATRIX const* transform,
BOOL useGdiNatural, BOOL useGdiNatural,
BOOL isSideways, BOOL isSideways,
BOOL isRightToLeft, BOOL isRightToLeft,
__in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis, _In_ DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis,
__in_z_opt WCHAR const* localeName, _In_opt_z_ WCHAR const* localeName,
__in_ecount_opt(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** featu _In_reads_opt_(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** featur
res, es,
__in_ecount_opt(featureRanges) UINT32 const* featureRangeLengths, _In_reads_opt_(featureRanges) UINT32 const* featureRangeLengths,
UINT32 featureRanges, UINT32 featureRanges,
__out_ecount(glyphCount) FLOAT* glyphAdvances, _Out_writes_(glyphCount) FLOAT* glyphAdvances,
__out_ecount(glyphCount) DWRITE_GLYPH_OFFSET* glyphOffsets _Out_writes_(glyphCount) DWRITE_GLYPH_OFFSET* glyphOffsets
) PURE; ) PURE;
}; };
/// <summary> /// <summary>
/// The DWRITE_GLYPH_RUN structure contains the information needed by renderers /// The DWRITE_GLYPH_RUN structure contains the information needed by renderers
/// to draw glyph runs. All coordinates are in device independent pixels (DIPs). /// to draw glyph runs. All coordinates are in device independent pixels (DIPs).
/// </summary> /// </summary>
struct DWRITE_GLYPH_RUN struct DWRITE_GLYPH_RUN
{ {
/// <summary> /// <summary>
/// The physical font face to draw with. /// The physical font face to draw with.
/// </summary> /// </summary>
__notnull IDWriteFontFace* fontFace; _Notnull_ IDWriteFontFace* fontFace;
/// <summary> /// <summary>
/// Logical size of the font in DIPs, not points (equals 1/96 inch). /// Logical size of the font in DIPs, not points (equals 1/96 inch).
/// </summary> /// </summary>
FLOAT fontEmSize; FLOAT fontEmSize;
/// <summary> /// <summary>
/// The number of glyphs. /// The number of glyphs.
/// </summary> /// </summary>
UINT32 glyphCount; UINT32 glyphCount;
/// <summary> /// <summary>
/// The indices to render. /// The indices to render.
/// </summary> /// </summary>
__field_ecount(glyphCount) UINT16 const* glyphIndices; _Field_size_(glyphCount) UINT16 const* glyphIndices;
/// <summary> /// <summary>
/// Glyph advance widths. /// Glyph advance widths.
/// </summary> /// </summary>
__field_ecount_opt(glyphCount) FLOAT const* glyphAdvances; _Field_size_opt_(glyphCount) FLOAT const* glyphAdvances;
/// <summary> /// <summary>
/// Glyph offsets. /// Glyph offsets.
/// </summary> /// </summary>
__field_ecount_opt(glyphCount) DWRITE_GLYPH_OFFSET const* glyphOffsets; _Field_size_opt_(glyphCount) DWRITE_GLYPH_OFFSET const* glyphOffsets;
/// <summary> /// <summary>
/// If true, specifies that glyphs are rotated 90 degrees to the left and /// If true, specifies that glyphs are rotated 90 degrees to the left and
/// vertical metrics are used. Vertical writing is achieved by specifying /// vertical metrics are used. Vertical writing is achieved by specifying
/// isSideways = true and rotating the entire run 90 degrees to the right /// isSideways = true and rotating the entire run 90 degrees to the right
/// via a rotate transform. /// via a rotate transform.
/// </summary> /// </summary>
BOOL isSideways; BOOL isSideways;
/// <summary> /// <summary>
skipping to change at line 2936 skipping to change at line 3035
/// <summary> /// <summary>
/// The DWRITE_GLYPH_RUN_DESCRIPTION structure contains additional properties /// The DWRITE_GLYPH_RUN_DESCRIPTION structure contains additional properties
/// related to those in DWRITE_GLYPH_RUN. /// related to those in DWRITE_GLYPH_RUN.
/// </summary> /// </summary>
struct DWRITE_GLYPH_RUN_DESCRIPTION struct DWRITE_GLYPH_RUN_DESCRIPTION
{ {
/// <summary> /// <summary>
/// The locale name associated with this run. /// The locale name associated with this run.
/// </summary> /// </summary>
__nullterminated WCHAR const* localeName; _Field_z_ WCHAR const* localeName;
/// <summary> /// <summary>
/// The text associated with the glyphs. /// The text associated with the glyphs.
/// </summary> /// </summary>
__field_ecount(stringLength) WCHAR const* string; _Field_size_(stringLength) WCHAR const* string;
/// <summary> /// <summary>
/// The number of characters (UTF16 code-units). /// The number of characters (UTF16 code-units).
/// Note that this may be different than the number of glyphs. /// Note that this may be different than the number of glyphs.
/// </summary> /// </summary>
UINT32 stringLength; UINT32 stringLength;
/// <summary> /// <summary>
/// An array of indices to the glyph indices array, of the first glyphs of /// An array of indices to the glyph indices array, of the first glyphs of
/// all the glyph clusters of the glyphs to render. /// all the glyph clusters of the glyphs to render.
/// </summary> /// </summary>
__field_ecount(stringLength) UINT16 const* clusterMap; _Field_size_opt_(stringLength) UINT16 const* clusterMap;
/// <summary> /// <summary>
/// Corresponding text position in the original string /// Corresponding text position in the original string
/// this glyph run came from. /// this glyph run came from.
/// </summary> /// </summary>
UINT32 textPosition; UINT32 textPosition;
}; };
/// <summary> /// <summary>
/// The DWRITE_UNDERLINE structure contains about the size and placement of /// The DWRITE_UNDERLINE structure contains information about the size and
/// underlines. All coordinates are in device independent pixels (DIPs). /// placement of underlines. All coordinates are in device independent
/// pixels (DIPs).
/// </summary> /// </summary>
struct DWRITE_UNDERLINE struct DWRITE_UNDERLINE
{ {
/// <summary> /// <summary>
/// Width of the underline, measured parallel to the baseline. /// Width of the underline, measured parallel to the baseline.
/// </summary> /// </summary>
FLOAT width; FLOAT width;
/// <summary> /// <summary>
/// Thickness of the underline, measured perpendicular to the /// Thickness of the underline, measured perpendicular to the
skipping to change at line 3012 skipping to change at line 3112
/// </summary> /// </summary>
DWRITE_FLOW_DIRECTION flowDirection; DWRITE_FLOW_DIRECTION flowDirection;
/// <summary> /// <summary>
/// Locale of the text the underline is being drawn under. Can be /// Locale of the text the underline is being drawn under. Can be
/// pertinent where the locale affects how the underline is drawn. /// pertinent where the locale affects how the underline is drawn.
/// For example, in vertical text, the underline belongs on the /// For example, in vertical text, the underline belongs on the
/// left for Chinese but on the right for Japanese. /// left for Chinese but on the right for Japanese.
/// This choice is completely left up to higher levels. /// This choice is completely left up to higher levels.
/// </summary> /// </summary>
__nullterminated WCHAR const* localeName; _Field_z_ WCHAR const* localeName;
/// <summary> /// <summary>
/// The measuring mode can be useful to the renderer to determine how /// The measuring mode can be useful to the renderer to determine how
/// underlines are rendered, e.g. rounding the thickness to a whole pixel /// underlines are rendered, e.g. rounding the thickness to a whole pixel
/// in GDI-compatible modes. /// in GDI-compatible modes.
/// </summary> /// </summary>
DWRITE_MEASURING_MODE measuringMode; DWRITE_MEASURING_MODE measuringMode;
}; };
/// <summary> /// <summary>
/// The DWRITE_STRIKETHROUGH structure contains about the size and placement of /// The DWRITE_STRIKETHROUGH structure contains information about the size and
/// strickthroughs. All coordinates are in device independent pixels (DIPs). /// placement of strikethroughs. All coordinates are in device independent
/// pixels (DIPs).
/// </summary> /// </summary>
struct DWRITE_STRIKETHROUGH struct DWRITE_STRIKETHROUGH
{ {
/// <summary> /// <summary>
/// Width of the strikethrough, measured parallel to the baseline. /// Width of the strikethrough, measured parallel to the baseline.
/// </summary> /// </summary>
FLOAT width; FLOAT width;
/// <summary> /// <summary>
/// Thickness of the strikethrough, measured perpendicular to the /// Thickness of the strikethrough, measured perpendicular to the
/// baseline. /// baseline.
/// </summary> /// </summary>
FLOAT thickness; FLOAT thickness;
/// <summary> /// <summary>
/// Offset of the stikethrough from the baseline. /// Offset of the strikethrough from the baseline.
/// A positive offset represents a position below the baseline and /// A positive offset represents a position below the baseline and
/// a negative offset is above. /// a negative offset is above.
/// </summary> /// </summary>
FLOAT offset; FLOAT offset;
/// <summary> /// <summary>
/// Reading direction of the text associated with the strikethrough. This /// Reading direction of the text associated with the strikethrough. This
/// value is used to interpret whether the width value runs horizontally /// value is used to interpret whether the width value runs horizontally
/// or vertically. /// or vertically.
/// </summary> /// </summary>
skipping to change at line 3063 skipping to change at line 3164
/// <summary> /// <summary>
/// Flow direction of the text associated with the strikethrough. This /// Flow direction of the text associated with the strikethrough. This
/// value is used to interpret whether the thickness value advances top to /// value is used to interpret whether the thickness value advances top to
/// bottom, left to right, or right to left. /// bottom, left to right, or right to left.
/// </summary> /// </summary>
DWRITE_FLOW_DIRECTION flowDirection; DWRITE_FLOW_DIRECTION flowDirection;
/// <summary> /// <summary>
/// Locale of the range. Can be pertinent where the locale affects the style . /// Locale of the range. Can be pertinent where the locale affects the style .
/// </summary> /// </summary>
__nullterminated WCHAR const* localeName; _Field_z_ WCHAR const* localeName;
/// <summary> /// <summary>
/// The measuring mode can be useful to the renderer to determine how /// The measuring mode can be useful to the renderer to determine how
/// underlines are rendered, e.g. rounding the thickness to a whole pixel /// underlines are rendered, e.g. rounding the thickness to a whole pixel
/// in GDI-compatible modes. /// in GDI-compatible modes.
/// </summary> /// </summary>
DWRITE_MEASURING_MODE measuringMode; DWRITE_MEASURING_MODE measuringMode;
}; };
/// <summary> /// <summary>
skipping to change at line 3358 skipping to change at line 3459
/// <param name="renderer">The renderer passed to IDWriteTextLayout::Draw as the object's containing parent.</param> /// <param name="renderer">The renderer passed to IDWriteTextLayout::Draw as the object's containing parent.</param>
/// <param name="originX">X-coordinate at the top-left corner of the inline object.</param> /// <param name="originX">X-coordinate at the top-left corner of the inline object.</param>
/// <param name="originY">Y-coordinate at the top-left corner of the inline object.</param> /// <param name="originY">Y-coordinate at the top-left corner of the inline object.</param>
/// <param name="isSideways">The object should be drawn on its side.</param> /// <param name="isSideways">The object should be drawn on its side.</param>
/// <param name="isRightToLeft">The object is in an right-to-left context an d should be drawn flipped.</param> /// <param name="isRightToLeft">The object is in an right-to-left context an d should be drawn flipped.</param>
/// <param name="clientDrawingEffect">The drawing effect set in IDWriteTextL ayout::SetDrawingEffect.</param> /// <param name="clientDrawingEffect">The drawing effect set in IDWriteTextL ayout::SetDrawingEffect.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(Draw)( STDMETHOD(Draw)(
__maybenull void* clientDrawingContext, _In_opt_ void* clientDrawingContext,
IDWriteTextRenderer* renderer, _In_ IDWriteTextRenderer* renderer,
FLOAT originX, FLOAT originX,
FLOAT originY, FLOAT originY,
BOOL isSideways, BOOL isSideways,
BOOL isRightToLeft, BOOL isRightToLeft,
__maybenull IUnknown* clientDrawingEffect _In_opt_ IUnknown* clientDrawingEffect
) PURE; ) PURE;
/// <summary> /// <summary>
/// TextLayout calls this callback function to get the measurement of the in line object. /// TextLayout calls this callback function to get the measurement of the in line object.
/// </summary> /// </summary>
/// <param name="metrics">Returned metrics</param> /// <param name="metrics">Returned metrics</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetMetrics)( STDMETHOD(GetMetrics)(
__out DWRITE_INLINE_OBJECT_METRICS* metrics _Out_ DWRITE_INLINE_OBJECT_METRICS* metrics
) PURE; ) PURE;
/// <summary> /// <summary>
/// TextLayout calls this callback function to get the visible extents (in D IPs) of the inline object. /// TextLayout calls this callback function to get the visible extents (in D IPs) of the inline object.
/// In the case of a simple bitmap, with no padding and no overhang, all the overhangs will /// In the case of a simple bitmap, with no padding and no overhang, all the overhangs will
/// simply be zeroes. /// simply be zeroes.
/// </summary> /// </summary>
/// <param name="overhangs">Overshoot of visible extents (in DIPs) outside t he object.</param> /// <param name="overhangs">Overshoot of visible extents (in DIPs) outside t he object.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
/// <remarks> /// <remarks>
/// The overhangs should be returned relative to the reported size of the ob ject /// The overhangs should be returned relative to the reported size of the ob ject
/// (DWRITE_INLINE_OBJECT_METRICS::width/height), and should not be baseline /// (DWRITE_INLINE_OBJECT_METRICS::width/height), and should not be baseline
/// adjusted. If you have an image that is actually 100x100 DIPs, but you wa nt it /// adjusted. If you have an image that is actually 100x100 DIPs, but you wa nt it
/// slightly inset (perhaps it has a glow) by 20 DIPs on each side, you woul d /// slightly inset (perhaps it has a glow) by 20 DIPs on each side, you woul d
/// return a width/height of 60x60 and four overhangs of 20 DIPs. /// return a width/height of 60x60 and four overhangs of 20 DIPs.
/// </remarks> /// </remarks>
STDMETHOD(GetOverhangMetrics)( STDMETHOD(GetOverhangMetrics)(
__out DWRITE_OVERHANG_METRICS* overhangs _Out_ DWRITE_OVERHANG_METRICS* overhangs
) PURE; ) PURE;
/// <summary> /// <summary>
/// Layout uses this to determine the line breaking behavior of the inline o bject /// Layout uses this to determine the line breaking behavior of the inline o bject
/// amidst the text. /// amidst the text.
/// </summary> /// </summary>
/// <param name="breakConditionBefore">Line-breaking condition between the o bject and the content immediately preceding it.</param> /// <param name="breakConditionBefore">Line-breaking condition between the o bject and the content immediately preceding it.</param>
/// <param name="breakConditionAfter" >Line-breaking condition between the o bject and the content immediately following it.</param> /// <param name="breakConditionAfter" >Line-breaking condition between the o bject and the content immediately following it.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetBreakConditions)( STDMETHOD(GetBreakConditions)(
__out DWRITE_BREAK_CONDITION* breakConditionBefore, _Out_ DWRITE_BREAK_CONDITION* breakConditionBefore,
__out DWRITE_BREAK_CONDITION* breakConditionAfter _Out_ DWRITE_BREAK_CONDITION* breakConditionAfter
) PURE; ) PURE;
}; };
/// <summary> /// <summary>
/// The IDWritePixelSnapping interface defines the pixel snapping properties of a text renderer. /// The IDWritePixelSnapping interface defines the pixel snapping properties of a text renderer.
/// </summary> /// </summary>
interface DWRITE_DECLARE_INTERFACE("eaf3a2da-ecf4-4d24-b644-b34f6842024b") IDWri tePixelSnapping : public IUnknown interface DWRITE_DECLARE_INTERFACE("eaf3a2da-ecf4-4d24-b644-b34f6842024b") IDWri tePixelSnapping : public IUnknown
{ {
/// <summary> /// <summary>
/// Determines whether pixel snapping is disabled. The recommended default i s FALSE, /// Determines whether pixel snapping is disabled. The recommended default i s FALSE,
/// unless doing animation that requires subpixel vertical placement. /// unless doing animation that requires subpixel vertical placement.
/// </summary> /// </summary>
/// <param name="clientDrawingContext">The context passed to IDWriteTextLayo ut::Draw.</param> /// <param name="clientDrawingContext">The context passed to IDWriteTextLayo ut::Draw.</param>
/// <param name="isDisabled">Receives TRUE if pixel snapping is disabled or FALSE if it not.</param> /// <param name="isDisabled">Receives TRUE if pixel snapping is disabled or FALSE if it not.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(IsPixelSnappingDisabled)( STDMETHOD(IsPixelSnappingDisabled)(
__maybenull void* clientDrawingContext, _In_opt_ void* clientDrawingContext,
__out BOOL* isDisabled _Out_ BOOL* isDisabled
) PURE; ) PURE;
/// <summary> /// <summary>
/// Gets the current transform that maps abstract coordinates to DIPs, /// Gets the current transform that maps abstract coordinates to DIPs,
/// which may disable pixel snapping upon any rotation or shear. /// which may disable pixel snapping upon any rotation or shear.
/// </summary> /// </summary>
/// <param name="clientDrawingContext">The context passed to IDWriteTextLayo ut::Draw.</param> /// <param name="clientDrawingContext">The context passed to IDWriteTextLayo ut::Draw.</param>
/// <param name="transform">Receives the transform.</param> /// <param name="transform">Receives the transform.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetCurrentTransform)( STDMETHOD(GetCurrentTransform)(
__maybenull void* clientDrawingContext, _In_opt_ void* clientDrawingContext,
__out DWRITE_MATRIX* transform _Out_ DWRITE_MATRIX* transform
) PURE; ) PURE;
/// <summary> /// <summary>
/// Gets the number of physical pixels per DIP. A DIP (device-independent pi xel) is 1/96 inch, /// Gets the number of physical pixels per DIP. A DIP (device-independent pi xel) is 1/96 inch,
/// so the pixelsPerDip value is the number of logical pixels per inch divid ed by 96 (yielding /// so the pixelsPerDip value is the number of logical pixels per inch divid ed by 96 (yielding
/// a value of 1 for 96 DPI and 1.25 for 120). /// a value of 1 for 96 DPI and 1.25 for 120).
/// </summary> /// </summary>
/// <param name="clientDrawingContext">The context passed to IDWriteTextLayo ut::Draw.</param> /// <param name="clientDrawingContext">The context passed to IDWriteTextLayo ut::Draw.</param>
/// <param name="pixelsPerDip">Receives the number of physical pixels per DI P.</param> /// <param name="pixelsPerDip">Receives the number of physical pixels per DI P.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetPixelsPerDip)( STDMETHOD(GetPixelsPerDip)(
__maybenull void* clientDrawingContext, _In_opt_ void* clientDrawingContext,
__out FLOAT* pixelsPerDip _Out_ FLOAT* pixelsPerDip
) PURE; ) PURE;
}; };
/// <summary> /// <summary>
/// The IDWriteTextLayout interface represents a set of application-defined /// The IDWriteTextRenderer interface represents a set of application-defined
/// callbacks that perform rendering of text, inline objects, and decorations /// callbacks that perform rendering of text, inline objects, and decorations
/// such as underlines. /// such as underlines.
/// </summary> /// </summary>
interface DWRITE_DECLARE_INTERFACE("ef8a8135-5cc6-45fe-8825-c5a0724eb819") IDWri teTextRenderer : public IDWritePixelSnapping interface DWRITE_DECLARE_INTERFACE("ef8a8135-5cc6-45fe-8825-c5a0724eb819") IDWri teTextRenderer : public IDWritePixelSnapping
{ {
/// <summary> /// <summary>
/// IDWriteTextLayout::Draw calls this function to instruct the client to /// IDWriteTextLayout::Draw calls this function to instruct the client to
/// render a run of glyphs. /// render a run of glyphs.
/// </summary> /// </summary>
/// <param name="clientDrawingContext">The context passed to /// <param name="clientDrawingContext">The context passed to
/// IDWriteTextLayout::Draw.</param> /// IDWriteTextLayout::Draw.</param>
/// <param name="baselineOriginX">X-coordinate of the baseline.</param> /// <param name="baselineOriginX">X-coordinate of the baseline.</param>
/// <param name="baselineOriginY">Y-coordinate of the baseline.</param> /// <param name="baselineOriginY">Y-coordinate of the baseline.</param>
/// <param name="measuringMode">Specifies measuring method for glyphs in the /// <param name="measuringMode">Specifies measuring mode for glyphs in the r
run. un.
/// Renderer implementations may choose different rendering modes for given /// Renderer implementations may choose different rendering modes for given
measuring methods, measuring modes,
/// but best results are seen when the rendering mode matches the correspond ing measuring mode: /// but best results are seen when the rendering mode matches the correspond ing measuring mode:
/// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURA L /// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURA L
/// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GD I_CLASSIC /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GD I_CLASSIC
/// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GD I_NATURAL /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GD I_NATURAL
/// </param> /// </param>
/// <param name="glyphRun">The glyph run to draw.</param> /// <param name="glyphRun">The glyph run to draw.</param>
/// <param name="glyphRunDescription">Properties of the characters /// <param name="glyphRunDescription">Properties of the characters
/// associated with this run.</param> /// associated with this run.</param>
/// <param name="clientDrawingEffect">The drawing effect set in /// <param name="clientDrawingEffect">The drawing effect set in
/// IDWriteTextLayout::SetDrawingEffect.</param> /// IDWriteTextLayout::SetDrawingEffect.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(DrawGlyphRun)( STDMETHOD(DrawGlyphRun)(
__maybenull void* clientDrawingContext, _In_opt_ void* clientDrawingContext,
FLOAT baselineOriginX, FLOAT baselineOriginX,
FLOAT baselineOriginY, FLOAT baselineOriginY,
DWRITE_MEASURING_MODE measuringMode, DWRITE_MEASURING_MODE measuringMode,
__in DWRITE_GLYPH_RUN const* glyphRun, _In_ DWRITE_GLYPH_RUN const* glyphRun,
__in DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription, _In_ DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription,
__maybenull IUnknown* clientDrawingEffect _In_opt_ IUnknown* clientDrawingEffect
) PURE; ) PURE;
/// <summary> /// <summary>
/// IDWriteTextLayout::Draw calls this function to instruct the client to dr aw /// IDWriteTextLayout::Draw calls this function to instruct the client to dr aw
/// an underline. /// an underline.
/// </summary> /// </summary>
/// <param name="clientDrawingContext">The context passed to /// <param name="clientDrawingContext">The context passed to
/// IDWriteTextLayout::Draw.</param> /// IDWriteTextLayout::Draw.</param>
/// <param name="baselineOriginX">X-coordinate of the baseline.</param> /// <param name="baselineOriginX">X-coordinate of the baseline.</param>
/// <param name="baselineOriginY">Y-coordinate of the baseline.</param> /// <param name="baselineOriginY">Y-coordinate of the baseline.</param>
skipping to change at line 3530 skipping to change at line 3631
/// weighted according to characters. /// weighted according to characters.
/// To get the correct top coordinate of the underline rect, add underline:: offset /// To get the correct top coordinate of the underline rect, add underline:: offset
/// to the baseline's Y. Otherwise the underline will be immediately under t he text. /// to the baseline's Y. Otherwise the underline will be immediately under t he text.
/// The x coordinate will always be passed as the left side, regardless /// The x coordinate will always be passed as the left side, regardless
/// of text directionality. This simplifies drawing and reduces the /// of text directionality. This simplifies drawing and reduces the
/// problem of round-off that could potentially cause gaps or a double /// problem of round-off that could potentially cause gaps or a double
/// stamped alpha blend. To avoid alpha overlap, round the end points /// stamped alpha blend. To avoid alpha overlap, round the end points
/// to the nearest device pixel. /// to the nearest device pixel.
/// </remarks> /// </remarks>
STDMETHOD(DrawUnderline)( STDMETHOD(DrawUnderline)(
__maybenull void* clientDrawingContext, _In_opt_ void* clientDrawingContext,
FLOAT baselineOriginX, FLOAT baselineOriginX,
FLOAT baselineOriginY, FLOAT baselineOriginY,
__in DWRITE_UNDERLINE const* underline, _In_ DWRITE_UNDERLINE const* underline,
__maybenull IUnknown* clientDrawingEffect _In_opt_ IUnknown* clientDrawingEffect
) PURE; ) PURE;
/// <summary> /// <summary>
/// IDWriteTextLayout::Draw calls this function to instruct the client to dr aw /// IDWriteTextLayout::Draw calls this function to instruct the client to dr aw
/// a strikethrough. /// a strikethrough.
/// </summary> /// </summary>
/// <param name="clientDrawingContext">The context passed to /// <param name="clientDrawingContext">The context passed to
/// IDWriteTextLayout::Draw.</param> /// IDWriteTextLayout::Draw.</param>
/// <param name="baselineOriginX">X-coordinate of the baseline.</param> /// <param name="baselineOriginX">X-coordinate of the baseline.</param>
/// <param name="baselineOriginY">Y-coordinate of the baseline.</param> /// <param name="baselineOriginY">Y-coordinate of the baseline.</param>
skipping to change at line 3561 skipping to change at line 3662
/// <remarks> /// <remarks>
/// A single strikethrough can be broken into multiple calls, depending on /// A single strikethrough can be broken into multiple calls, depending on
/// how the formatting changes attributes. Strikethrough is not averaged /// how the formatting changes attributes. Strikethrough is not averaged
/// across font sizes/styles changes. /// across font sizes/styles changes.
/// To get the correct top coordinate of the strikethrough rect, /// To get the correct top coordinate of the strikethrough rect,
/// add strikethrough::offset to the baseline's Y. /// add strikethrough::offset to the baseline's Y.
/// Like underlines, the x coordinate will always be passed as the left side , /// Like underlines, the x coordinate will always be passed as the left side ,
/// regardless of text directionality. /// regardless of text directionality.
/// </remarks> /// </remarks>
STDMETHOD(DrawStrikethrough)( STDMETHOD(DrawStrikethrough)(
__maybenull void* clientDrawingContext, _In_opt_ void* clientDrawingContext,
FLOAT baselineOriginX, FLOAT baselineOriginX,
FLOAT baselineOriginY, FLOAT baselineOriginY,
__in DWRITE_STRIKETHROUGH const* strikethrough, _In_ DWRITE_STRIKETHROUGH const* strikethrough,
__maybenull IUnknown* clientDrawingEffect _In_opt_ IUnknown* clientDrawingEffect
) PURE; ) PURE;
/// <summary> /// <summary>
/// IDWriteTextLayout::Draw calls this application callback when it needs to /// IDWriteTextLayout::Draw calls this application callback when it needs to
/// draw an inline object. /// draw an inline object.
/// </summary> /// </summary>
/// <param name="clientDrawingContext">The context passed to IDWriteTextLayo ut::Draw.</param> /// <param name="clientDrawingContext">The context passed to IDWriteTextLayo ut::Draw.</param>
/// <param name="originX">X-coordinate at the top-left corner of the inline object.</param> /// <param name="originX">X-coordinate at the top-left corner of the inline object.</param>
/// <param name="originY">Y-coordinate at the top-left corner of the inline object.</param> /// <param name="originY">Y-coordinate at the top-left corner of the inline object.</param>
/// <param name="inlineObject">The object set using IDWriteTextLayout::SetIn lineObject.</param> /// <param name="inlineObject">The object set using IDWriteTextLayout::SetIn lineObject.</param>
skipping to change at line 3589 skipping to change at line 3690
/// IDWriteTextLayout::SetDrawingEffect.</param> /// IDWriteTextLayout::SetDrawingEffect.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
/// <remarks> /// <remarks>
/// The right-to-left flag is a hint for those cases where it would look /// The right-to-left flag is a hint for those cases where it would look
/// strange for the image to be shown normally (like an arrow pointing to /// strange for the image to be shown normally (like an arrow pointing to
/// right to indicate a submenu). /// right to indicate a submenu).
/// </remarks> /// </remarks>
STDMETHOD(DrawInlineObject)( STDMETHOD(DrawInlineObject)(
__maybenull void* clientDrawingContext, _In_opt_ void* clientDrawingContext,
FLOAT originX, FLOAT originX,
FLOAT originY, FLOAT originY,
IDWriteInlineObject* inlineObject, _In_ IDWriteInlineObject* inlineObject,
BOOL isSideways, BOOL isSideways,
BOOL isRightToLeft, BOOL isRightToLeft,
__maybenull IUnknown* clientDrawingEffect _In_opt_ IUnknown* clientDrawingEffect
) PURE; ) PURE;
}; };
/// <summary> /// <summary>
/// The IDWriteTextLayout interface represents a block of text after it has /// The IDWriteTextLayout interface represents a block of text after it has
/// been fully analyzed and formatted. /// been fully analyzed and formatted.
/// ///
/// All coordinates are in device independent pixels (DIPs). /// All coordinates are in device independent pixels (DIPs).
/// </summary> /// </summary>
interface DWRITE_DECLARE_INTERFACE("53737037-6d14-410b-9bfe-0b182bb70961") IDWri teTextLayout : public IDWriteTextFormat interface DWRITE_DECLARE_INTERFACE("53737037-6d14-410b-9bfe-0b182bb70961") IDWri teTextLayout : public IDWriteTextFormat
skipping to change at line 3638 skipping to change at line 3739
/// <summary> /// <summary>
/// Set the font collection. /// Set the font collection.
/// </summary> /// </summary>
/// <param name="fontCollection">The font collection to set</param> /// <param name="fontCollection">The font collection to set</param>
/// <param name="textRange">Text range to which this change applies.</param> /// <param name="textRange">Text range to which this change applies.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(SetFontCollection)( STDMETHOD(SetFontCollection)(
IDWriteFontCollection* fontCollection, _In_ IDWriteFontCollection* fontCollection,
DWRITE_TEXT_RANGE textRange DWRITE_TEXT_RANGE textRange
) PURE; ) PURE;
/// <summary> /// <summary>
/// Set null-terminated font family name. /// Set null-terminated font family name.
/// </summary> /// </summary>
/// <param name="fontFamilyName">Font family name</param> /// <param name="fontFamilyName">Font family name</param>
/// <param name="textRange">Text range to which this change applies.</param> /// <param name="textRange">Text range to which this change applies.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(SetFontFamilyName)( STDMETHOD(SetFontFamilyName)(
__in_z WCHAR const* fontFamilyName, _In_z_ WCHAR const* fontFamilyName,
DWRITE_TEXT_RANGE textRange DWRITE_TEXT_RANGE textRange
) PURE; ) PURE;
/// <summary> /// <summary>
/// Set font weight. /// Set font weight.
/// </summary> /// </summary>
/// <param name="fontWeight">Font weight</param> /// <param name="fontWeight">Font weight</param>
/// <param name="textRange">Text range to which this change applies.</param> /// <param name="textRange">Text range to which this change applies.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
skipping to change at line 3764 skipping to change at line 3865
/// <param name="textRange">Text range to which this change applies.</param> /// <param name="textRange">Text range to which this change applies.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
/// <remarks> /// <remarks>
/// This inline object applies to the specified range and will be passed bac k /// This inline object applies to the specified range and will be passed bac k
/// to the application via the DrawInlineObject callback when the range is d rawn. /// to the application via the DrawInlineObject callback when the range is d rawn.
/// Any text in that range will be suppressed. /// Any text in that range will be suppressed.
/// </remarks> /// </remarks>
STDMETHOD(SetInlineObject)( STDMETHOD(SetInlineObject)(
IDWriteInlineObject* inlineObject, _In_ IDWriteInlineObject* inlineObject,
DWRITE_TEXT_RANGE textRange DWRITE_TEXT_RANGE textRange
) PURE; ) PURE;
/// <summary> /// <summary>
/// Set font typography features. /// Set font typography features.
/// </summary> /// </summary>
/// <param name="typography">Pointer to font typography setting.</param> /// <param name="typography">Pointer to font typography setting.</param>
/// <param name="textRange">Text range to which this change applies.</param> /// <param name="textRange">Text range to which this change applies.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(SetTypography)( STDMETHOD(SetTypography)(
IDWriteTypography* typography, _In_ IDWriteTypography* typography,
DWRITE_TEXT_RANGE textRange DWRITE_TEXT_RANGE textRange
) PURE; ) PURE;
/// <summary> /// <summary>
/// Set locale name. /// Set locale name.
/// </summary> /// </summary>
/// <param name="localeName">Locale name</param> /// <param name="localeName">Locale name</param>
/// <param name="textRange">Text range to which this change applies.</param> /// <param name="textRange">Text range to which this change applies.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(SetLocaleName)( STDMETHOD(SetLocaleName)(
__in_z WCHAR const* localeName, _In_z_ WCHAR const* localeName,
DWRITE_TEXT_RANGE textRange DWRITE_TEXT_RANGE textRange
) PURE; ) PURE;
/// <summary> /// <summary>
/// Get layout maximum width /// Get layout maximum width
/// </summary> /// </summary>
STDMETHOD_(FLOAT, GetMaxWidth)() PURE; STDMETHOD_(FLOAT, GetMaxWidth)() PURE;
/// <summary> /// <summary>
/// Get layout maximum height /// Get layout maximum height
skipping to change at line 3815 skipping to change at line 3916
/// Get the font collection where the current position is at. /// Get the font collection where the current position is at.
/// </summary> /// </summary>
/// <param name="currentPosition">The current text position.</param> /// <param name="currentPosition">The current text position.</param>
/// <param name="fontCollection">The current font collection</param> /// <param name="fontCollection">The current font collection</param>
/// <param name="textRange">Text range to which this change applies.</param> /// <param name="textRange">Text range to which this change applies.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetFontCollection)( STDMETHOD(GetFontCollection)(
UINT32 currentPosition, UINT32 currentPosition,
__out IDWriteFontCollection** fontCollection, _COM_Outptr_ IDWriteFontCollection** fontCollection,
__out_opt DWRITE_TEXT_RANGE* textRange = NULL _Out_opt_ DWRITE_TEXT_RANGE* textRange = NULL
) PURE; ) PURE;
/// <summary> /// <summary>
/// Get the length of the font family name where the current position is at. /// Get the length of the font family name where the current position is at.
/// </summary> /// </summary>
/// <param name="currentPosition">The current text position.</param> /// <param name="currentPosition">The current text position.</param>
/// <param name="nameLength">Size of the character array in character count not including the terminated NULL character.</param> /// <param name="nameLength">Size of the character array in character count not including the terminated NULL character.</param>
/// <param name="textRange">The position range of the current format.</param > /// <param name="textRange">The position range of the current format.</param >
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetFontFamilyNameLength)( STDMETHOD(GetFontFamilyNameLength)(
UINT32 currentPosition, UINT32 currentPosition,
__out UINT32* nameLength, _Out_ UINT32* nameLength,
__out_opt DWRITE_TEXT_RANGE* textRange = NULL _Out_opt_ DWRITE_TEXT_RANGE* textRange = NULL
) PURE; ) PURE;
/// <summary> /// <summary>
/// Copy the font family name where the current position is at. /// Copy the font family name where the current position is at.
/// </summary> /// </summary>
/// <param name="currentPosition">The current text position.</param> /// <param name="currentPosition">The current text position.</param>
/// <param name="fontFamilyName">Character array that receives the current f ont family name</param> /// <param name="fontFamilyName">Character array that receives the current f ont family name</param>
/// <param name="nameSize">Size of the character array in character count in cluding the terminated NULL character.</param> /// <param name="nameSize">Size of the character array in character count in cluding the terminated NULL character.</param>
/// <param name="textRange">The position range of the current format.</param > /// <param name="textRange">The position range of the current format.</param >
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetFontFamilyName)( STDMETHOD(GetFontFamilyName)(
UINT32 currentPosition, UINT32 currentPosition,
__out_ecount_z(nameSize) WCHAR* fontFamilyName, _Out_writes_z_(nameSize) WCHAR* fontFamilyName,
UINT32 nameSize, UINT32 nameSize,
__out_opt DWRITE_TEXT_RANGE* textRange = NULL _Out_opt_ DWRITE_TEXT_RANGE* textRange = NULL
) PURE; ) PURE;
/// <summary> /// <summary>
/// Get the font weight where the current position is at. /// Get the font weight where the current position is at.
/// </summary> /// </summary>
/// <param name="currentPosition">The current text position.</param> /// <param name="currentPosition">The current text position.</param>
/// <param name="fontWeight">The current font weight</param> /// <param name="fontWeight">The current font weight</param>
/// <param name="textRange">The position range of the current format.</param > /// <param name="textRange">The position range of the current format.</param >
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetFontWeight)( STDMETHOD(GetFontWeight)(
UINT32 currentPosition, UINT32 currentPosition,
__out DWRITE_FONT_WEIGHT* fontWeight, _Out_ DWRITE_FONT_WEIGHT* fontWeight,
__out_opt DWRITE_TEXT_RANGE* textRange = NULL _Out_opt_ DWRITE_TEXT_RANGE* textRange = NULL
) PURE; ) PURE;
/// <summary> /// <summary>
/// Get the font style where the current position is at. /// Get the font style where the current position is at.
/// </summary> /// </summary>
/// <param name="currentPosition">The current text position.</param> /// <param name="currentPosition">The current text position.</param>
/// <param name="fontStyle">The current font style</param> /// <param name="fontStyle">The current font style</param>
/// <param name="textRange">The position range of the current format.</param > /// <param name="textRange">The position range of the current format.</param >
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetFontStyle)( STDMETHOD(GetFontStyle)(
UINT32 currentPosition, UINT32 currentPosition,
__out DWRITE_FONT_STYLE* fontStyle, _Out_ DWRITE_FONT_STYLE* fontStyle,
__out_opt DWRITE_TEXT_RANGE* textRange = NULL _Out_opt_ DWRITE_TEXT_RANGE* textRange = NULL
) PURE; ) PURE;
/// <summary> /// <summary>
/// Get the font stretch where the current position is at. /// Get the font stretch where the current position is at.
/// </summary> /// </summary>
/// <param name="currentPosition">The current text position.</param> /// <param name="currentPosition">The current text position.</param>
/// <param name="fontStretch">The current font stretch</param> /// <param name="fontStretch">The current font stretch</param>
/// <param name="textRange">The position range of the current format.</param > /// <param name="textRange">The position range of the current format.</param >
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetFontStretch)( STDMETHOD(GetFontStretch)(
UINT32 currentPosition, UINT32 currentPosition,
__out DWRITE_FONT_STRETCH* fontStretch, _Out_ DWRITE_FONT_STRETCH* fontStretch,
__out_opt DWRITE_TEXT_RANGE* textRange = NULL _Out_opt_ DWRITE_TEXT_RANGE* textRange = NULL
) PURE; ) PURE;
/// <summary> /// <summary>
/// Get the font em height where the current position is at. /// Get the font em height where the current position is at.
/// </summary> /// </summary>
/// <param name="currentPosition">The current text position.</param> /// <param name="currentPosition">The current text position.</param>
/// <param name="fontSize">The current font em height</param> /// <param name="fontSize">The current font em height</param>
/// <param name="textRange">The position range of the current format.</param > /// <param name="textRange">The position range of the current format.</param >
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetFontSize)( STDMETHOD(GetFontSize)(
UINT32 currentPosition, UINT32 currentPosition,
__out FLOAT* fontSize, _Out_ FLOAT* fontSize,
__out_opt DWRITE_TEXT_RANGE* textRange = NULL _Out_opt_ DWRITE_TEXT_RANGE* textRange = NULL
) PURE; ) PURE;
/// <summary> /// <summary>
/// Get the underline presence where the current position is at. /// Get the underline presence where the current position is at.
/// </summary> /// </summary>
/// <param name="currentPosition">The current text position.</param> /// <param name="currentPosition">The current text position.</param>
/// <param name="hasUnderline">The Boolean flag indicates whether text is un derlined.</param> /// <param name="hasUnderline">The Boolean flag indicates whether text is un derlined.</param>
/// <param name="textRange">The position range of the current format.</param > /// <param name="textRange">The position range of the current format.</param >
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetUnderline)( STDMETHOD(GetUnderline)(
UINT32 currentPosition, UINT32 currentPosition,
__out BOOL* hasUnderline, _Out_ BOOL* hasUnderline,
__out_opt DWRITE_TEXT_RANGE* textRange = NULL _Out_opt_ DWRITE_TEXT_RANGE* textRange = NULL
) PURE; ) PURE;
/// <summary> /// <summary>
/// Get the strikethrough presence where the current position is at. /// Get the strikethrough presence where the current position is at.
/// </summary> /// </summary>
/// <param name="currentPosition">The current text position.</param> /// <param name="currentPosition">The current text position.</param>
/// <param name="hasStrikethrough">The Boolean flag indicates whether text h as strikethrough.</param> /// <param name="hasStrikethrough">The Boolean flag indicates whether text h as strikethrough.</param>
/// <param name="textRange">The position range of the current format.</param > /// <param name="textRange">The position range of the current format.</param >
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetStrikethrough)( STDMETHOD(GetStrikethrough)(
UINT32 currentPosition, UINT32 currentPosition,
__out BOOL* hasStrikethrough, _Out_ BOOL* hasStrikethrough,
__out_opt DWRITE_TEXT_RANGE* textRange = NULL _Out_opt_ DWRITE_TEXT_RANGE* textRange = NULL
) PURE; ) PURE;
/// <summary> /// <summary>
/// Get the application-defined drawing effect where the current position is at. /// Get the application-defined drawing effect where the current position is at.
/// </summary> /// </summary>
/// <param name="currentPosition">The current text position.</param> /// <param name="currentPosition">The current text position.</param>
/// <param name="drawingEffect">The current application-defined drawing effe ct.</param> /// <param name="drawingEffect">The current application-defined drawing effe ct.</param>
/// <param name="textRange">The position range of the current format.</param > /// <param name="textRange">The position range of the current format.</param >
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetDrawingEffect)( STDMETHOD(GetDrawingEffect)(
UINT32 currentPosition, UINT32 currentPosition,
__out IUnknown** drawingEffect, _COM_Outptr_ IUnknown** drawingEffect,
__out_opt DWRITE_TEXT_RANGE* textRange = NULL _Out_opt_ DWRITE_TEXT_RANGE* textRange = NULL
) PURE; ) PURE;
/// <summary> /// <summary>
/// Get the inline object at the given position. /// Get the inline object at the given position.
/// </summary> /// </summary>
/// <param name="currentPosition">The given text position.</param> /// <param name="currentPosition">The given text position.</param>
/// <param name="inlineObject">The inline object.</param> /// <param name="inlineObject">The inline object.</param>
/// <param name="textRange">The position range of the current format.</param > /// <param name="textRange">The position range of the current format.</param >
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetInlineObject)( STDMETHOD(GetInlineObject)(
UINT32 currentPosition, UINT32 currentPosition,
__out IDWriteInlineObject** inlineObject, _COM_Outptr_ IDWriteInlineObject** inlineObject,
__out_opt DWRITE_TEXT_RANGE* textRange = NULL _Out_opt_ DWRITE_TEXT_RANGE* textRange = NULL
) PURE; ) PURE;
/// <summary> /// <summary>
/// Get the typography setting where the current position is at. /// Get the typography setting where the current position is at.
/// </summary> /// </summary>
/// <param name="currentPosition">The current text position.</param> /// <param name="currentPosition">The current text position.</param>
/// <param name="typography">The current typography setting.</param> /// <param name="typography">The current typography setting.</param>
/// <param name="textRange">The position range of the current format.</param > /// <param name="textRange">The position range of the current format.</param >
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetTypography)( STDMETHOD(GetTypography)(
UINT32 currentPosition, UINT32 currentPosition,
__out IDWriteTypography** typography, _COM_Outptr_ IDWriteTypography** typography,
__out_opt DWRITE_TEXT_RANGE* textRange = NULL _Out_opt_ DWRITE_TEXT_RANGE* textRange = NULL
) PURE; ) PURE;
/// <summary> /// <summary>
/// Get the length of the locale name where the current position is at. /// Get the length of the locale name where the current position is at.
/// </summary> /// </summary>
/// <param name="currentPosition">The current text position.</param> /// <param name="currentPosition">The current text position.</param>
/// <param name="nameLength">Size of the character array in character count not including the terminated NULL character.</param> /// <param name="nameLength">Size of the character array in character count not including the terminated NULL character.</param>
/// <param name="textRange">The position range of the current format.</param > /// <param name="textRange">The position range of the current format.</param >
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetLocaleNameLength)( STDMETHOD(GetLocaleNameLength)(
UINT32 currentPosition, UINT32 currentPosition,
__out UINT32* nameLength, _Out_ UINT32* nameLength,
__out_opt DWRITE_TEXT_RANGE* textRange = NULL _Out_opt_ DWRITE_TEXT_RANGE* textRange = NULL
) PURE; ) PURE;
/// <summary> /// <summary>
/// Get the locale name where the current position is at. /// Get the locale name where the current position is at.
/// </summary> /// </summary>
/// <param name="currentPosition">The current text position.</param> /// <param name="currentPosition">The current text position.</param>
/// <param name="localeName">Character array that receives the current local e name</param> /// <param name="localeName">Character array that receives the current local e name</param>
/// <param name="nameSize">Size of the character array in character count in cluding the terminated NULL character.</param> /// <param name="nameSize">Size of the character array in character count in cluding the terminated NULL character.</param>
/// <param name="textRange">The position range of the current format.</param > /// <param name="textRange">The position range of the current format.</param >
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetLocaleName)( STDMETHOD(GetLocaleName)(
UINT32 currentPosition, UINT32 currentPosition,
__out_ecount_z(nameSize) WCHAR* localeName, _Out_writes_z_(nameSize) WCHAR* localeName,
UINT32 nameSize, UINT32 nameSize,
__out_opt DWRITE_TEXT_RANGE* textRange = NULL _Out_opt_ DWRITE_TEXT_RANGE* textRange = NULL
) PURE; ) PURE;
/// <summary> /// <summary>
/// Initiate drawing of the text. /// Initiate drawing of the text.
/// </summary> /// </summary>
/// <param name="clientDrawingContext">An application defined value /// <param name="clientDrawingContext">An application defined value
/// included in rendering callbacks.</param> /// included in rendering callbacks.</param>
/// <param name="renderer">The set of application-defined callbacks that do /// <param name="renderer">The set of application-defined callbacks that do
/// the actual rendering.</param> /// the actual rendering.</param>
/// <param name="originX">X-coordinate of the layout's left side.</param> /// <param name="originX">X-coordinate of the layout's left side.</param>
/// <param name="originY">Y-coordinate of the layout's top side.</param> /// <param name="originY">Y-coordinate of the layout's top side.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(Draw)( STDMETHOD(Draw)(
__maybenull void* clientDrawingContext, _In_opt_ void* clientDrawingContext,
IDWriteTextRenderer* renderer, _In_ IDWriteTextRenderer* renderer,
FLOAT originX, FLOAT originX,
FLOAT originY FLOAT originY
) PURE; ) PURE;
/// <summary> /// <summary>
/// GetLineMetrics returns properties of each line. /// GetLineMetrics returns properties of each line.
/// </summary> /// </summary>
/// <param name="lineMetrics">The array to fill with line information.</para m> /// <param name="lineMetrics">The array to fill with line information.</para m>
/// <param name="maxLineCount">The maximum size of the lineMetrics array.</p aram> /// <param name="maxLineCount">The maximum size of the lineMetrics array.</p aram>
/// <param name="actualLineCount">The actual size of the lineMetrics /// <param name="actualLineCount">The actual size of the lineMetrics
skipping to change at line 4054 skipping to change at line 4155
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
/// <remarks> /// <remarks>
/// If maxLineCount is not large enough E_NOT_SUFFICIENT_BUFFER, /// If maxLineCount is not large enough E_NOT_SUFFICIENT_BUFFER,
/// which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), /// which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER),
/// is returned and *actualLineCount is set to the number of lines /// is returned and *actualLineCount is set to the number of lines
/// needed. /// needed.
/// </remarks> /// </remarks>
STDMETHOD(GetLineMetrics)( STDMETHOD(GetLineMetrics)(
__out_ecount_opt(maxLineCount) DWRITE_LINE_METRICS* lineMetrics, _Out_writes_opt_(maxLineCount) DWRITE_LINE_METRICS* lineMetrics,
UINT32 maxLineCount, UINT32 maxLineCount,
__out UINT32* actualLineCount _Out_ UINT32* actualLineCount
) PURE; ) PURE;
/// <summary> /// <summary>
/// GetMetrics retrieves overall metrics for the formatted string. /// GetMetrics retrieves overall metrics for the formatted string.
/// </summary> /// </summary>
/// <param name="textMetrics">The returned metrics.</param> /// <param name="textMetrics">The returned metrics.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
/// <remarks> /// <remarks>
/// Drawing effects like underline and strikethrough do not contribute /// Drawing effects like underline and strikethrough do not contribute
/// to the text size, which is essentially the sum of advance widths and /// to the text size, which is essentially the sum of advance widths and
/// line heights. Additionally, visible swashes and other graphic /// line heights. Additionally, visible swashes and other graphic
/// adornments may extend outside the returned width and height. /// adornments may extend outside the returned width and height.
/// </remarks> /// </remarks>
STDMETHOD(GetMetrics)( STDMETHOD(GetMetrics)(
__out DWRITE_TEXT_METRICS* textMetrics _Out_ DWRITE_TEXT_METRICS* textMetrics
) PURE; ) PURE;
/// <summary> /// <summary>
/// GetOverhangMetrics returns the overhangs (in DIPs) of the layout and all /// GetOverhangMetrics returns the overhangs (in DIPs) of the layout and all
/// objects contained in it, including text glyphs and inline objects. /// objects contained in it, including text glyphs and inline objects.
/// </summary> /// </summary>
/// <param name="overhangs">Overshoots of visible extents (in DIPs) outside the layout.</param> /// <param name="overhangs">Overshoots of visible extents (in DIPs) outside the layout.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
/// <remarks> /// <remarks>
/// Any underline and strikethrough do not contribute to the black box /// Any underline and strikethrough do not contribute to the black box
/// determination, since these are actually drawn by the renderer, which /// determination, since these are actually drawn by the renderer, which
/// is allowed to draw them in any variety of styles. /// is allowed to draw them in any variety of styles.
/// </remarks> /// </remarks>
STDMETHOD(GetOverhangMetrics)( STDMETHOD(GetOverhangMetrics)(
__out DWRITE_OVERHANG_METRICS* overhangs _Out_ DWRITE_OVERHANG_METRICS* overhangs
) PURE; ) PURE;
/// <summary> /// <summary>
/// Retrieve logical properties and measurement of each cluster. /// Retrieve logical properties and measurement of each cluster.
/// </summary> /// </summary>
/// <param name="clusterMetrics">The array to fill with cluster information. </param> /// <param name="clusterMetrics">The array to fill with cluster information. </param>
/// <param name="maxClusterCount">The maximum size of the clusterMetrics arr ay.</param> /// <param name="maxClusterCount">The maximum size of the clusterMetrics arr ay.</param>
/// <param name="actualClusterCount">The actual size of the clusterMetrics a rray that is needed.</param> /// <param name="actualClusterCount">The actual size of the clusterMetrics a rray that is needed.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
/// <remarks> /// <remarks>
/// If maxClusterCount is not large enough E_NOT_SUFFICIENT_BUFFER, /// If maxClusterCount is not large enough E_NOT_SUFFICIENT_BUFFER,
/// which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), /// which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER),
/// is returned and *actualClusterCount is set to the number of clusters /// is returned and *actualClusterCount is set to the number of clusters
/// needed. /// needed.
/// </remarks> /// </remarks>
STDMETHOD(GetClusterMetrics)( STDMETHOD(GetClusterMetrics)(
__out_ecount_opt(maxClusterCount) DWRITE_CLUSTER_METRICS* clusterMetrics , _Out_writes_opt_(maxClusterCount) DWRITE_CLUSTER_METRICS* clusterMetrics ,
UINT32 maxClusterCount, UINT32 maxClusterCount,
__out UINT32* actualClusterCount _Out_ UINT32* actualClusterCount
) PURE; ) PURE;
/// <summary> /// <summary>
/// Determines the minimum possible width the layout can be set to without /// Determines the minimum possible width the layout can be set to without
/// emergency breaking between the characters of whole words. /// emergency breaking between the characters of whole words.
/// </summary> /// </summary>
/// <param name="minWidth">Minimum width.</param> /// <param name="minWidth">Minimum width.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(DetermineMinWidth)( STDMETHOD(DetermineMinWidth)(
__out FLOAT* minWidth _Out_ FLOAT* minWidth
) PURE; ) PURE;
/// <summary> /// <summary>
/// Given a coordinate (in DIPs) relative to the top-left of the layout box, /// Given a coordinate (in DIPs) relative to the top-left of the layout box,
/// this returns the corresponding hit-test metrics of the text string where /// this returns the corresponding hit-test metrics of the text string where
/// the hit-test has occurred. This is useful for mapping mouse clicks to ca ret /// the hit-test has occurred. This is useful for mapping mouse clicks to ca ret
/// positions. When the given coordinate is outside the text string, the fun ction /// positions. When the given coordinate is outside the text string, the fun ction
/// sets the output value *isInside to false but returns the nearest charact er /// sets the output value *isInside to false but returns the nearest charact er
/// position. /// position.
/// </summary> /// </summary>
skipping to change at line 4149 skipping to change at line 4250
/// <param name="isInside">Output flag indicating whether the hit-test locat ion is inside the text string. /// <param name="isInside">Output flag indicating whether the hit-test locat ion is inside the text string.
/// When false, the position nearest the text's edge is returned.</param > /// When false, the position nearest the text's edge is returned.</param >
/// <param name="hitTestMetrics">Output geometry fully enclosing the hit-tes t location. When the output *isInside value /// <param name="hitTestMetrics">Output geometry fully enclosing the hit-tes t location. When the output *isInside value
/// is set to false, this structure represents the geometry enclosing th e edge closest to the hit-test location.</param> /// is set to false, this structure represents the geometry enclosing th e edge closest to the hit-test location.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(HitTestPoint)( STDMETHOD(HitTestPoint)(
FLOAT pointX, FLOAT pointX,
FLOAT pointY, FLOAT pointY,
__out BOOL* isTrailingHit, _Out_ BOOL* isTrailingHit,
__out BOOL* isInside, _Out_ BOOL* isInside,
__out DWRITE_HIT_TEST_METRICS* hitTestMetrics _Out_ DWRITE_HIT_TEST_METRICS* hitTestMetrics
) PURE; ) PURE;
/// <summary> /// <summary>
/// Given a text position and whether the caret is on the leading or trailin g /// Given a text position and whether the caret is on the leading or trailin g
/// edge of that position, this returns the corresponding coordinate (in DIP s) /// edge of that position, this returns the corresponding coordinate (in DIP s)
/// relative to the top-left of the layout box. This is most useful for draw ing /// relative to the top-left of the layout box. This is most useful for draw ing
/// the caret's current position, but it could also be used to anchor an IME to the /// the caret's current position, but it could also be used to anchor an IME to the
/// typed text or attach a floating menu near the point of interest. It may also be /// typed text or attach a floating menu near the point of interest. It may also be
/// used to programmatically obtain the geometry of a particular text positi on /// used to programmatically obtain the geometry of a particular text positi on
/// for UI automation. /// for UI automation.
/// </summary> /// </summary>
/// <param name="textPosition">Text position to get the coordinate of.</para m> /// <param name="textPosition">Text position to get the coordinate of.</para m>
/// <param name="isTrailingHit">Flag indicating whether the location is of t he leading or the trailing side of the specified text position. </param> /// <param name="isTrailingHit">Flag indicating whether the location is of t he leading or the trailing side of the specified text position. </param>
/// <param name="pointX">Output caret X, relative to the top-left of the lay out box.</param> /// <param name="pointX">Output caret X, relative to the top-left of the lay out box.</param>
/// <param name="pointY">Output caret Y, relative to the top-left of the lay out box.</param> /// <param name="pointY">Output caret Y, relative to the top-left of the lay out box.</param>
/// <param name="hitTestMetrics">Output geometry fully enclosing the specifi ed text position.</param> /// <param name="hitTestMetrics">Output geometry fully enclosing the specifi ed text position.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
/// <remarks> /// <remarks>
/// When drawing a caret at the returned X,Y, it should should be centered o n X /// When drawing a caret at the returned X,Y, it should be centered on X
/// and drawn from the Y coordinate down. The height will be the size of the /// and drawn from the Y coordinate down. The height will be the size of the
/// hit-tested text (which can vary in size within a line). /// hit-tested text (which can vary in size within a line).
/// Reading direction also affects which side of the character the caret is drawn. /// Reading direction also affects which side of the character the caret is drawn.
/// However, the returned X coordinate will be correct for either case. /// However, the returned X coordinate will be correct for either case.
/// You can get a text length back that is larger than a single character. /// You can get a text length back that is larger than a single character.
/// This happens for complex scripts when multiple characters form a single cluster, /// This happens for complex scripts when multiple characters form a single cluster,
/// when diacritics join their base character, or when you test a surrogate pair. /// when diacritics join their base character, or when you test a surrogate pair.
/// </remarks> /// </remarks>
STDMETHOD(HitTestTextPosition)( STDMETHOD(HitTestTextPosition)(
UINT32 textPosition, UINT32 textPosition,
BOOL isTrailingHit, BOOL isTrailingHit,
__out FLOAT* pointX, _Out_ FLOAT* pointX,
__out FLOAT* pointY, _Out_ FLOAT* pointY,
__out DWRITE_HIT_TEST_METRICS* hitTestMetrics _Out_ DWRITE_HIT_TEST_METRICS* hitTestMetrics
) PURE; ) PURE;
/// <summary> /// <summary>
/// The application calls this function to get a set of hit-test metrics /// The application calls this function to get a set of hit-test metrics
/// corresponding to a range of text positions. The main usage for this /// corresponding to a range of text positions. The main usage for this
/// is to draw highlighted selection of the text string. /// is to draw highlighted selection of the text string.
/// ///
/// The function returns E_NOT_SUFFICIENT_BUFFER, which is equivalent to /// The function returns E_NOT_SUFFICIENT_BUFFER, which is equivalent to
/// HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), when the buffer size of /// HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), when the buffer size of
/// hitTestMetrics is too small to hold all the regions calculated by the /// hitTestMetrics is too small to hold all the regions calculated by the
skipping to change at line 4234 skipping to change at line 4335
/// depending on bidi ordering, each range is contiguous and reports all the text, /// depending on bidi ordering, each range is contiguous and reports all the text,
/// including any hidden characters and trimmed text. /// including any hidden characters and trimmed text.
/// The height of each returned range will be the same within each line, reg ardless /// The height of each returned range will be the same within each line, reg ardless
/// of how the font sizes vary. /// of how the font sizes vary.
/// </remarks> /// </remarks>
STDMETHOD(HitTestTextRange)( STDMETHOD(HitTestTextRange)(
UINT32 textPosition, UINT32 textPosition,
UINT32 textLength, UINT32 textLength,
FLOAT originX, FLOAT originX,
FLOAT originY, FLOAT originY,
__out_ecount_opt(maxHitTestMetricsCount) DWRITE_HIT_TEST_METRICS* hitTes tMetrics, _Out_writes_opt_(maxHitTestMetricsCount) DWRITE_HIT_TEST_METRICS* hitTes tMetrics,
UINT32 maxHitTestMetricsCount, UINT32 maxHitTestMetricsCount,
__out UINT32* actualHitTestMetricsCount _Out_ UINT32* actualHitTestMetricsCount
) PURE; ) PURE;
}; };
/// <summary> /// <summary>
/// Encapsulates a 32-bit device independent bitmap and device context, which ca n be used for rendering glyphs. /// Encapsulates a 32-bit device independent bitmap and device context, which ca n be used for rendering glyphs.
/// </summary> /// </summary>
interface DWRITE_DECLARE_INTERFACE("5e5a32a3-8dff-4773-9ff6-0696eab77267") IDWri teBitmapRenderTarget : public IUnknown interface DWRITE_DECLARE_INTERFACE("5e5a32a3-8dff-4773-9ff6-0696eab77267") IDWri teBitmapRenderTarget : public IUnknown
{ {
/// <summary> /// <summary>
/// Draws a run of glyphs to the bitmap. /// Draws a run of glyphs to the bitmap.
/// </summary> /// </summary>
/// <param name="baselineOriginX">Horizontal position of the baseline origin , in DIPs, relative to the upper-left corner of the DIB.</param> /// <param name="baselineOriginX">Horizontal position of the baseline origin , in DIPs, relative to the upper-left corner of the DIB.</param>
/// <param name="baselineOriginY">Vertical position of the baseline origin, in DIPs, relative to the upper-left corner of the DIB.</param> /// <param name="baselineOriginY">Vertical position of the baseline origin, in DIPs, relative to the upper-left corner of the DIB.</param>
/// <param name="measuringMode">Specifies measuring method for glyphs in the /// <param name="measuringMode">Specifies measuring mode for glyphs in the r
run. un.
/// Renderer implementations may choose different rendering modes for differ /// Renderer implementations may choose different rendering modes for differ
ent measuring methods, for example ent measuring modes, for example
/// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURA L, /// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURA L,
/// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GD I_CLASSIC, and /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GD I_CLASSIC, and
/// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GD I_NATURAL. /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GD I_NATURAL.
/// </param> /// </param>
/// <param name="glyphRun">Structure containing the properties of the glyph run.</param> /// <param name="glyphRun">Structure containing the properties of the glyph run.</param>
/// <param name="renderingParams">Object that controls rendering behavior.</ param> /// <param name="renderingParams">Object that controls rendering behavior.</ param>
/// <param name="textColor">Specifies the foreground color of the text.</par am> /// <param name="textColor">Specifies the foreground color of the text.</par am>
/// <param name="blackBoxRect">Optional rectangle that receives the bounding box (in pixels not DIPs) of all the pixels affected by /// <param name="blackBoxRect">Optional rectangle that receives the bounding box (in pixels not DIPs) of all the pixels affected by
/// drawing the glyph run. The black box rectangle may extend beyond the dim ensions of the bitmap.</param> /// drawing the glyph run. The black box rectangle may extend beyond the dim ensions of the bitmap.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(DrawGlyphRun)( STDMETHOD(DrawGlyphRun)(
FLOAT baselineOriginX, FLOAT baselineOriginX,
FLOAT baselineOriginY, FLOAT baselineOriginY,
DWRITE_MEASURING_MODE measuringMode, DWRITE_MEASURING_MODE measuringMode,
__in DWRITE_GLYPH_RUN const* glyphRun, _In_ DWRITE_GLYPH_RUN const* glyphRun,
IDWriteRenderingParams* renderingParams, _In_ IDWriteRenderingParams* renderingParams,
COLORREF textColor, COLORREF textColor,
__out_opt RECT* blackBoxRect = NULL _Out_opt_ RECT* blackBoxRect = NULL
) PURE; ) PURE;
/// <summary> /// <summary>
/// Gets a handle to the memory device context. /// Gets a handle to the memory device context.
/// </summary> /// </summary>
/// <returns> /// <returns>
/// Returns the device context handle. /// Returns the device context handle.
/// </returns> /// </returns>
/// <remarks> /// <remarks>
/// An application can use the device context to draw using GDI functions. A n application can obtain the bitmap handle /// An application can use the device context to draw using GDI functions. A n application can obtain the bitmap handle
skipping to change at line 4319 skipping to change at line 4420
/// <summary> /// <summary>
/// Gets the transform that maps abstract coordinate to DIPs. By default thi s is the identity /// Gets the transform that maps abstract coordinate to DIPs. By default thi s is the identity
/// transform. Note that this is unrelated to the world transform of the und erlying device /// transform. Note that this is unrelated to the world transform of the und erlying device
/// context. /// context.
/// </summary> /// </summary>
/// <param name="transform">Receives the transform.</param> /// <param name="transform">Receives the transform.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetCurrentTransform)( STDMETHOD(GetCurrentTransform)(
__out DWRITE_MATRIX* transform _Out_ DWRITE_MATRIX* transform
) PURE; ) PURE;
/// <summary> /// <summary>
/// Sets the transform that maps abstract coordinate to DIPs. This does not affect the world /// Sets the transform that maps abstract coordinate to DIPs. This does not affect the world
/// transform of the underlying device context. /// transform of the underlying device context.
/// </summary> /// </summary>
/// <param name="transform">Specifies the new transform. This parameter can be NULL, in which /// <param name="transform">Specifies the new transform. This parameter can be NULL, in which
/// case the identity transform is implied.</param> /// case the identity transform is implied.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(SetCurrentTransform)( STDMETHOD(SetCurrentTransform)(
__in_opt DWRITE_MATRIX const* transform _In_opt_ DWRITE_MATRIX const* transform
) PURE; ) PURE;
/// <summary> /// <summary>
/// Gets the dimensions of the bitmap. /// Gets the dimensions of the bitmap.
/// </summary> /// </summary>
/// <param name="size">Receives the size of the bitmap in pixels.</param> /// <param name="size">Receives the size of the bitmap in pixels.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetSize)( STDMETHOD(GetSize)(
__out SIZE* size _Out_ SIZE* size
) PURE; ) PURE;
/// <summary> /// <summary>
/// Resizes the bitmap. /// Resizes the bitmap.
/// </summary> /// </summary>
/// <param name="width">New bitmap width, in pixels.</param> /// <param name="width">New bitmap width, in pixels.</param>
/// <param name="height">New bitmap height, in pixels.</param> /// <param name="height">New bitmap height, in pixels.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
skipping to change at line 4374 skipping to change at line 4475
{ {
/// <summary> /// <summary>
/// Creates a font object that matches the properties specified by the LOGFO NT structure. /// Creates a font object that matches the properties specified by the LOGFO NT structure.
/// </summary> /// </summary>
/// <param name="logFont">Structure containing a GDI-compatible font descrip tion.</param> /// <param name="logFont">Structure containing a GDI-compatible font descrip tion.</param>
/// <param name="font">Receives a newly created font object if successful, o r NULL in case of error.</param> /// <param name="font">Receives a newly created font object if successful, o r NULL in case of error.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(CreateFontFromLOGFONT)( STDMETHOD(CreateFontFromLOGFONT)(
__in LOGFONTW const* logFont, _In_ LOGFONTW const* logFont,
__out IDWriteFont** font _COM_Outptr_ IDWriteFont** font
) PURE; ) PURE;
/// <summary> /// <summary>
/// Initializes a LOGFONT structure based on the GDI-compatible properties o f the specified font. /// Initializes a LOGFONT structure based on the GDI-compatible properties o f the specified font.
/// </summary> /// </summary>
/// <param name="font">Specifies a font in the system font collection.</para m> /// <param name="font">Specifies a font in the system font collection.</para m>
/// <param name="logFont">Structure that receives a GDI-compatible font desc ription.</param> /// <param name="logFont">Structure that receives a GDI-compatible font desc ription.</param>
/// <param name="isSystemFont">Contains TRUE if the specified font object is part of the system font collection /// <param name="isSystemFont">Contains TRUE if the specified font object is part of the system font collection
/// or FALSE otherwise.</param> /// or FALSE otherwise.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(ConvertFontToLOGFONT)( STDMETHOD(ConvertFontToLOGFONT)(
IDWriteFont* font, _In_ IDWriteFont* font,
__out LOGFONTW* logFont, _Out_ LOGFONTW* logFont,
__out BOOL* isSystemFont _Out_ BOOL* isSystemFont
) PURE; ) PURE;
/// <summary> /// <summary>
/// Initializes a LOGFONT structure based on the GDI-compatible properties o f the specified font. /// Initializes a LOGFONT structure based on the GDI-compatible properties o f the specified font.
/// </summary> /// </summary>
/// <param name="font">Specifies a font face.</param> /// <param name="font">Specifies a font face.</param>
/// <param name="logFont">Structure that receives a GDI-compatible font desc ription.</param> /// <param name="logFont">Structure that receives a GDI-compatible font desc ription.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(ConvertFontFaceToLOGFONT)( STDMETHOD(ConvertFontFaceToLOGFONT)(
IDWriteFontFace* font, _In_ IDWriteFontFace* font,
__out LOGFONTW* logFont _Out_ LOGFONTW* logFont
) PURE; ) PURE;
/// <summary> /// <summary>
/// Creates a font face object that corresponds to the currently selected HF ONT. /// Creates a font face object that corresponds to the currently selected HF ONT.
/// </summary> /// </summary>
/// <param name="hdc">Handle to a device context into which a font has been selected. It is assumed that the client /// <param name="hdc">Handle to a device context into which a font has been selected. It is assumed that the client
/// has already performed font mapping and that the font selected into the D C is the actual font that would be used /// has already performed font mapping and that the font selected into the D C is the actual font that would be used
/// for rendering glyphs.</param> /// for rendering glyphs.</param>
/// <param name="fontFace">Contains the newly created font face object, or N ULL in case of failure.</param> /// <param name="fontFace">Contains the newly created font face object, or N ULL in case of failure.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(CreateFontFaceFromHdc)( STDMETHOD(CreateFontFaceFromHdc)(
HDC hdc, HDC hdc,
__out IDWriteFontFace** fontFace _COM_Outptr_ IDWriteFontFace** fontFace
) PURE; ) PURE;
/// <summary> /// <summary>
/// Creates an object that encapsulates a bitmap and memory DC which can be used for rendering glyphs. /// Creates an object that encapsulates a bitmap and memory DC which can be used for rendering glyphs.
/// </summary> /// </summary>
/// <param name="hdc">Optional device context used to create a compatible me mory DC.</param> /// <param name="hdc">Optional device context used to create a compatible me mory DC.</param>
/// <param name="width">Width of the bitmap.</param> /// <param name="width">Width of the bitmap.</param>
/// <param name="height">Height of the bitmap.</param> /// <param name="height">Height of the bitmap.</param>
/// <param name="renderTarget">Receives a pointer to the newly created rende r target.</param> /// <param name="renderTarget">Receives a pointer to the newly created rende r target.</param>
STDMETHOD(CreateBitmapRenderTarget)( STDMETHOD(CreateBitmapRenderTarget)(
__in_opt HDC hdc, _In_opt_ HDC hdc,
UINT32 width, UINT32 width,
UINT32 height, UINT32 height,
__out IDWriteBitmapRenderTarget** renderTarget _COM_Outptr_ IDWriteBitmapRenderTarget** renderTarget
) PURE; ) PURE;
}; };
/// <summary> /// <summary>
/// The DWRITE_TEXTURE_TYPE enumeration identifies a type of alpha texture. An a lpha texture is a bitmap of alpha values, each /// The DWRITE_TEXTURE_TYPE enumeration identifies a type of alpha texture. An a lpha texture is a bitmap of alpha values, each
/// representing the darkness (i.e., opacity) of a pixel or subpixel. /// representing the darkness (i.e., opacity) of a pixel or subpixel.
/// </summary> /// </summary>
enum DWRITE_TEXTURE_TYPE enum DWRITE_TEXTURE_TYPE
{ {
/// <summary> /// <summary>
skipping to change at line 4479 skipping to change at line 4580
/// <param name="textureType">Specifies the type of texture requested. If a bi-level texture is requested, the /// <param name="textureType">Specifies the type of texture requested. If a bi-level texture is requested, the
/// bounding rectangle includes only bi-level glyphs. Otherwise, the boundin g rectangle includes only anti-aliased /// bounding rectangle includes only bi-level glyphs. Otherwise, the boundin g rectangle includes only anti-aliased
/// glyphs.</param> /// glyphs.</param>
/// <param name="textureBounds">Receives the bounding rectangle, or an empty rectangle if there are no glyphs /// <param name="textureBounds">Receives the bounding rectangle, or an empty rectangle if there are no glyphs
/// if the specified type.</param> /// if the specified type.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetAlphaTextureBounds)( STDMETHOD(GetAlphaTextureBounds)(
DWRITE_TEXTURE_TYPE textureType, DWRITE_TEXTURE_TYPE textureType,
__out RECT* textureBounds _Out_ RECT* textureBounds
) PURE; ) PURE;
/// <summary> /// <summary>
/// Creates an alpha texture of the specified type. /// Creates an alpha texture of the specified type.
/// </summary> /// </summary>
/// <param name="textureType">Specifies the type of texture requested. If a bi-level texture is requested, the /// <param name="textureType">Specifies the type of texture requested. If a bi-level texture is requested, the
/// texture contains only bi-level glyphs. Otherwise, the texture contains o nly anti-aliased glyphs.</param> /// texture contains only bi-level glyphs. Otherwise, the texture contains o nly anti-aliased glyphs.</param>
/// <param name="textureBounds">Specifies the bounding rectangle of the text ure, which can be different than /// <param name="textureBounds">Specifies the bounding rectangle of the text ure, which can be different than
/// the bounding rectangle returned by GetAlphaTextureBounds.</param> /// the bounding rectangle returned by GetAlphaTextureBounds.</param>
/// <param name="alphaValues">Receives the array of alpha values.</param> /// <param name="alphaValues">Receives the array of alpha values.</param>
/// <param name="bufferSize">Size of the alphaValues array. The minimum size depends on the dimensions of the /// <param name="bufferSize">Size of the alphaValues array. The minimum size depends on the dimensions of the
/// rectangle and the type of texture requested.</param> /// rectangle and the type of texture requested.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(CreateAlphaTexture)( STDMETHOD(CreateAlphaTexture)(
DWRITE_TEXTURE_TYPE textureType, DWRITE_TEXTURE_TYPE textureType,
__in RECT const* textureBounds, _In_ RECT const* textureBounds,
__out_bcount(bufferSize) BYTE* alphaValues, _Out_writes_bytes_(bufferSize) BYTE* alphaValues,
UINT32 bufferSize UINT32 bufferSize
) PURE; ) PURE;
/// <summary> /// <summary>
/// Gets properties required for ClearType blending. /// Gets properties required for ClearType blending.
/// </summary> /// </summary>
/// <param name="renderingParams">Rendering parameters object. In most cases , the values returned in the output /// <param name="renderingParams">Rendering parameters object. In most cases , the values returned in the output
/// parameters are based on the properties of this object. The exception is if a GDI-compatible rendering mode /// parameters are based on the properties of this object. The exception is if a GDI-compatible rendering mode
/// is specified.</param> /// is specified.</param>
/// <param name="blendGamma">Receives the gamma value to use for gamma corre ction.</param> /// <param name="blendGamma">Receives the gamma value to use for gamma corre ction.</param>
/// <param name="blendEnhancedContrast">Receives the enhanced contrast value .</param> /// <param name="blendEnhancedContrast">Receives the enhanced contrast value .</param>
/// <param name="blendClearTypeLevel">Receives the ClearType level.</param> /// <param name="blendClearTypeLevel">Receives the ClearType level.</param>
STDMETHOD(GetAlphaBlendParams)( STDMETHOD(GetAlphaBlendParams)(
IDWriteRenderingParams* renderingParams, _In_ IDWriteRenderingParams* renderingParams,
__out FLOAT* blendGamma, _Out_ FLOAT* blendGamma,
__out FLOAT* blendEnhancedContrast, _Out_ FLOAT* blendEnhancedContrast,
__out FLOAT* blendClearTypeLevel _Out_ FLOAT* blendClearTypeLevel
) PURE; ) PURE;
}; };
/// <summary> /// <summary>
/// The root factory interface for all DWrite objects. /// The root factory interface for all DWrite objects.
/// </summary> /// </summary>
interface DWRITE_DECLARE_INTERFACE("b859ee5a-d838-4b5b-a2e8-1adc7d93db48") IDWri teFactory : public IUnknown interface DWRITE_DECLARE_INTERFACE("b859ee5a-d838-4b5b-a2e8-1adc7d93db48") IDWri teFactory : public IUnknown
{ {
/// <summary> /// <summary>
/// Gets a font collection representing the set of installed fonts. /// Gets a font collection representing the set of installed fonts.
/// </summary> /// </summary>
/// <param name="fontCollection">Receives a pointer to the system font colle ction object, or NULL in case of failure.</param> /// <param name="fontCollection">Receives a pointer to the system font colle ction object, or NULL in case of failure.</param>
/// <param name="checkForUpdates">If this parameter is nonzero, the function performs an immediate check for changes to the set of /// <param name="checkForUpdates">If this parameter is nonzero, the function performs an immediate check for changes to the set of
/// installed fonts. If this parameter is FALSE, the function will still det ect changes if the font cache service is running, but /// installed fonts. If this parameter is FALSE, the function will still det ect changes if the font cache service is running, but
/// there may be some latency. For example, an application might specify TRU E if it has itself just installed a font and wants to /// there may be some latency. For example, an application might specify TRU E if it has itself just installed a font and wants to
/// be sure the font collection contains that font.</param> /// be sure the font collection contains that font.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetSystemFontCollection)( STDMETHOD(GetSystemFontCollection)(
__out IDWriteFontCollection** fontCollection, _COM_Outptr_ IDWriteFontCollection** fontCollection,
BOOL checkForUpdates = FALSE BOOL checkForUpdates = FALSE
) PURE; ) PURE;
/// <summary> /// <summary>
/// Creates a font collection using a custom font collection loader. /// Creates a font collection using a custom font collection loader.
/// </summary> /// </summary>
/// <param name="collectionLoader">Application-defined font collection loade r, which must have been previously /// <param name="collectionLoader">Application-defined font collection loade r, which must have been previously
/// registered using RegisterFontCollectionLoader.</param> /// registered using RegisterFontCollectionLoader.</param>
/// <param name="collectionKey">Key used by the loader to identify a collect ion of font files.</param> /// <param name="collectionKey">Key used by the loader to identify a collect ion of font files.</param>
/// <param name="collectionKeySize">Size in bytes of the collection key.</pa ram> /// <param name="collectionKeySize">Size in bytes of the collection key.</pa ram>
/// <param name="fontCollection">Receives a pointer to the system font colle ction object, or NULL in case of failure.</param> /// <param name="fontCollection">Receives a pointer to the system font colle ction object, or NULL in case of failure.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(CreateCustomFontCollection)( STDMETHOD(CreateCustomFontCollection)(
IDWriteFontCollectionLoader* collectionLoader, _In_ IDWriteFontCollectionLoader* collectionLoader,
__in_bcount(collectionKeySize) void const* collectionKey, _In_reads_bytes_(collectionKeySize) void const* collectionKey,
UINT32 collectionKeySize, UINT32 collectionKeySize,
__out IDWriteFontCollection** fontCollection _COM_Outptr_ IDWriteFontCollection** fontCollection
) PURE; ) PURE;
/// <summary> /// <summary>
/// Registers a custom font collection loader with the factory object. /// Registers a custom font collection loader with the factory object.
/// </summary> /// </summary>
/// <param name="fontCollectionLoader">Application-defined font collection l oader.</param> /// <param name="fontCollectionLoader">Application-defined font collection l oader.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(RegisterFontCollectionLoader)( STDMETHOD(RegisterFontCollectionLoader)(
IDWriteFontCollectionLoader* fontCollectionLoader _In_ IDWriteFontCollectionLoader* fontCollectionLoader
) PURE; ) PURE;
/// <summary> /// <summary>
/// Unregisters a custom font collection loader that was previously register ed using RegisterFontCollectionLoader. /// Unregisters a custom font collection loader that was previously register ed using RegisterFontCollectionLoader.
/// </summary> /// </summary>
/// <param name="fontCollectionLoader">Application-defined font collection l oader.</param> /// <param name="fontCollectionLoader">Application-defined font collection l oader.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(UnregisterFontCollectionLoader)( STDMETHOD(UnregisterFontCollectionLoader)(
IDWriteFontCollectionLoader* fontCollectionLoader _In_ IDWriteFontCollectionLoader* fontCollectionLoader
) PURE; ) PURE;
/// <summary> /// <summary>
/// CreateFontFileReference creates a font file reference object from a loca l font file. /// CreateFontFileReference creates a font file reference object from a loca l font file.
/// </summary> /// </summary>
/// <param name="filePath">Absolute file path. Subsequent operations on the constructed object may fail /// <param name="filePath">Absolute file path. Subsequent operations on the constructed object may fail
/// if the user provided filePath doesn't correspond to a valid file on the disk.</param> /// if the user provided filePath doesn't correspond to a valid file on the disk.</param>
/// <param name="lastWriteTime">Last modified time of the input file path. I f the parameter is omitted, /// <param name="lastWriteTime">Last modified time of the input file path. I f the parameter is omitted,
/// the function will access the font file to obtain its last write time, so the clients are encouraged to specify this value /// the function will access the font file to obtain its last write time, so the clients are encouraged to specify this value
/// to avoid extra disk access. Subsequent operations on the constructed obj ect may fail /// to avoid extra disk access. Subsequent operations on the constructed obj ect may fail
/// if the user provided lastWriteTime doesn't match the file on the disk.</ param> /// if the user provided lastWriteTime doesn't match the file on the disk.</ param>
/// <param name="fontFile">Contains newly created font file reference object , or NULL in case of failure.</param> /// <param name="fontFile">Contains newly created font file reference object , or NULL in case of failure.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(CreateFontFileReference)( STDMETHOD(CreateFontFileReference)(
__in_z WCHAR const* filePath, _In_z_ WCHAR const* filePath,
__in_opt FILETIME const* lastWriteTime, _In_opt_ FILETIME const* lastWriteTime,
__out IDWriteFontFile** fontFile _COM_Outptr_ IDWriteFontFile** fontFile
) PURE; ) PURE;
/// <summary> /// <summary>
/// CreateCustomFontFileReference creates a reference to an application spec ific font file resource. /// CreateCustomFontFileReference creates a reference to an application spec ific font file resource.
/// This function enables an application or a document to use a font without having to install it on the system. /// This function enables an application or a document to use a font without having to install it on the system.
/// The fontFileReferenceKey has to be unique only in the scope of the fontF ileLoader used in this call. /// The fontFileReferenceKey has to be unique only in the scope of the fontF ileLoader used in this call.
/// </summary> /// </summary>
/// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the font file resource /// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the font file resource
/// during the lifetime of fontFileLoader.</param> /// during the lifetime of fontFileLoader.</param>
/// <param name="fontFileReferenceKeySize">Size of font file reference key i n bytes.</param> /// <param name="fontFileReferenceKeySize">Size of font file reference key i n bytes.</param>
skipping to change at line 4619 skipping to change at line 4720
/// <param name="fontFile">Contains the newly created font file object, or N ULL in case of failure.</param> /// <param name="fontFile">Contains the newly created font file object, or N ULL in case of failure.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
/// <remarks> /// <remarks>
/// This function is provided for cases when an application or a document ne eds to use a font /// This function is provided for cases when an application or a document ne eds to use a font
/// without having to install it on the system. fontFileReferenceKey has to be unique only in the scope /// without having to install it on the system. fontFileReferenceKey has to be unique only in the scope
/// of the fontFileLoader used in this call. /// of the fontFileLoader used in this call.
/// </remarks> /// </remarks>
STDMETHOD(CreateCustomFontFileReference)( STDMETHOD(CreateCustomFontFileReference)(
__in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey, _In_reads_bytes_(fontFileReferenceKeySize) void const* fontFileReference Key,
UINT32 fontFileReferenceKeySize, UINT32 fontFileReferenceKeySize,
IDWriteFontFileLoader* fontFileLoader, _In_ IDWriteFontFileLoader* fontFileLoader,
__out IDWriteFontFile** fontFile _COM_Outptr_ IDWriteFontFile** fontFile
) PURE; ) PURE;
/// <summary> /// <summary>
/// Creates a font face object. /// Creates a font face object.
/// </summary> /// </summary>
/// <param name="fontFaceType">The file format of the font face.</param> /// <param name="fontFaceType">The file format of the font face.</param>
/// <param name="numberOfFiles">The number of font files require to represen t the font face.</param> /// <param name="numberOfFiles">The number of font files required to represe nt the font face.</param>
/// <param name="fontFiles">Font files representing the font face. Since IDW riteFontFace maintains its own references /// <param name="fontFiles">Font files representing the font face. Since IDW riteFontFace maintains its own references
/// to the input font file objects, it's OK to release them after this call. </param> /// to the input font file objects, it's OK to release them after this call. </param>
/// <param name="faceIndex">The zero based index of a font face in cases whe n the font files contain a collection of font faces. /// <param name="faceIndex">The zero based index of a font face in cases whe n the font files contain a collection of font faces.
/// If the font files contain a single face, this value should be zero.</par am> /// If the font files contain a single face, this value should be zero.</par am>
/// <param name="fontFaceSimulationFlags">Font face simulation flags for alg orithmic emboldening and italicization.</param> /// <param name="fontFaceSimulationFlags">Font face simulation flags for alg orithmic emboldening and italicization.</param>
/// <param name="fontFace">Contains the newly created font face object, or N ULL in case of failure.</param> /// <param name="fontFace">Contains the newly created font face object, or N ULL in case of failure.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(CreateFontFace)( STDMETHOD(CreateFontFace)(
DWRITE_FONT_FACE_TYPE fontFaceType, DWRITE_FONT_FACE_TYPE fontFaceType,
UINT32 numberOfFiles, UINT32 numberOfFiles,
__in_ecount(numberOfFiles) IDWriteFontFile* const* fontFiles, _In_reads_(numberOfFiles) IDWriteFontFile* const* fontFiles,
UINT32 faceIndex, UINT32 faceIndex,
DWRITE_FONT_SIMULATIONS fontFaceSimulationFlags, DWRITE_FONT_SIMULATIONS fontFaceSimulationFlags,
__out IDWriteFontFace** fontFace _COM_Outptr_ IDWriteFontFace** fontFace
) PURE; ) PURE;
/// <summary> /// <summary>
/// Creates a rendering parameters object with default settings for the prim ary monitor. /// Creates a rendering parameters object with default settings for the prim ary monitor.
/// </summary> /// </summary>
/// <param name="renderingParams">Holds the newly created rendering paramete rs object, or NULL in case of failure.</param> /// <param name="renderingParams">Holds the newly created rendering paramete rs object, or NULL in case of failure.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(CreateRenderingParams)( STDMETHOD(CreateRenderingParams)(
__out IDWriteRenderingParams** renderingParams _COM_Outptr_ IDWriteRenderingParams** renderingParams
) PURE; ) PURE;
/// <summary> /// <summary>
/// Creates a rendering parameters object with default settings for the spec ified monitor. /// Creates a rendering parameters object with default settings for the spec ified monitor.
/// </summary> /// </summary>
/// <param name="monitor">The monitor to read the default values from.</para m> /// <param name="monitor">The monitor to read the default values from.</para m>
/// <param name="renderingParams">Holds the newly created rendering paramete rs object, or NULL in case of failure.</param> /// <param name="renderingParams">Holds the newly created rendering paramete rs object, or NULL in case of failure.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(CreateMonitorRenderingParams)( STDMETHOD(CreateMonitorRenderingParams)(
HMONITOR monitor, HMONITOR monitor,
__out IDWriteRenderingParams** renderingParams _COM_Outptr_ IDWriteRenderingParams** renderingParams
) PURE; ) PURE;
/// <summary> /// <summary>
/// Creates a rendering parameters object with the specified properties. /// Creates a rendering parameters object with the specified properties.
/// </summary> /// </summary>
/// <param name="gamma">The gamma value used for gamma correction, which mus t be greater than zero and cannot exceed 256.</param> /// <param name="gamma">The gamma value used for gamma correction, which mus t be greater than zero and cannot exceed 256.</param>
/// <param name="enhancedContrast">The amount of contrast enhancement, zero or greater.</param> /// <param name="enhancedContrast">The amount of contrast enhancement, zero or greater.</param>
/// <param name="clearTypeLevel">The degree of ClearType level, from 0.0f (n o ClearType) to 1.0f (full ClearType).</param> /// <param name="clearTypeLevel">The degree of ClearType level, from 0.0f (n o ClearType) to 1.0f (full ClearType).</param>
/// <param name="pixelGeometry">The geometry of a device pixel.</param> /// <param name="pixelGeometry">The geometry of a device pixel.</param>
/// <param name="renderingMode">Method of rendering glyphs. In most cases, t his should be DWRITE_RENDERING_MODE_DEFAULT to automatically use an appropriate mode.</param> /// <param name="renderingMode">Method of rendering glyphs. In most cases, t his should be DWRITE_RENDERING_MODE_DEFAULT to automatically use an appropriate mode.</param>
/// <param name="renderingParams">Holds the newly created rendering paramete rs object, or NULL in case of failure.</param> /// <param name="renderingParams">Holds the newly created rendering paramete rs object, or NULL in case of failure.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(CreateCustomRenderingParams)( STDMETHOD(CreateCustomRenderingParams)(
FLOAT gamma, FLOAT gamma,
FLOAT enhancedContrast, FLOAT enhancedContrast,
FLOAT clearTypeLevel, FLOAT clearTypeLevel,
DWRITE_PIXEL_GEOMETRY pixelGeometry, DWRITE_PIXEL_GEOMETRY pixelGeometry,
DWRITE_RENDERING_MODE renderingMode, DWRITE_RENDERING_MODE renderingMode,
__out IDWriteRenderingParams** renderingParams _COM_Outptr_ IDWriteRenderingParams** renderingParams
) PURE; ) PURE;
/// <summary> /// <summary>
/// Registers a font file loader with DirectWrite. /// Registers a font file loader with DirectWrite.
/// </summary> /// </summary>
/// <param name="fontFileLoader">Pointer to the implementation of the IDWrit eFontFileLoader for a particular file resource type.</param> /// <param name="fontFileLoader">Pointer to the implementation of the IDWrit eFontFileLoader for a particular file resource type.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
/// <remarks> /// <remarks>
/// This function registers a font file loader with DirectWrite. /// This function registers a font file loader with DirectWrite.
/// Font file loader interface handles loading font file resources of a part icular type from a key. /// Font file loader interface handles loading font file resources of a part icular type from a key.
/// The font file loader interface is recommended to be implemented by a sin gleton object. /// The font file loader interface is recommended to be implemented by a sin gleton object.
/// A given instance can only be registered once. /// A given instance can only be registered once.
/// Succeeding attempts will return an error that it has already been regist ered. /// Succeeding attempts will return an error that it has already been regist ered.
/// IMPORTANT: font file loader implementations must not register themselves with DirectWrite /// IMPORTANT: font file loader implementations must not register themselves with DirectWrite
/// inside their constructors and must not unregister themselves in their de structors, because /// inside their constructors and must not unregister themselves in their de structors, because
/// registration and unregistraton operations increment and decrement the ob ject reference count respectively. /// registration and unregistration operations increment and decrement the o bject reference count respectively.
/// Instead, registration and unregistration of font file loaders with Direc tWrite should be performed /// Instead, registration and unregistration of font file loaders with Direc tWrite should be performed
/// outside of the font file loader implementation as a separate step. /// outside of the font file loader implementation as a separate step.
/// </remarks> /// </remarks>
STDMETHOD(RegisterFontFileLoader)( STDMETHOD(RegisterFontFileLoader)(
IDWriteFontFileLoader* fontFileLoader _In_ IDWriteFontFileLoader* fontFileLoader
) PURE; ) PURE;
/// <summary> /// <summary>
/// Unregisters a font file loader that was previously registered with the D irectWrite font system using RegisterFontFileLoader. /// Unregisters a font file loader that was previously registered with the D irectWrite font system using RegisterFontFileLoader.
/// </summary> /// </summary>
/// <param name="fontFileLoader">Pointer to the file loader that was previou sly registered with the DirectWrite font system using RegisterFontFileLoader.</p aram> /// <param name="fontFileLoader">Pointer to the file loader that was previou sly registered with the DirectWrite font system using RegisterFontFileLoader.</p aram>
/// <returns> /// <returns>
/// This function will succeed if the user loader is requested to be removed . /// This function will succeed if the user loader is requested to be removed .
/// It will fail if the pointer to the file loader identifies a standard Dir ectWrite loader, /// It will fail if the pointer to the file loader identifies a standard Dir ectWrite loader,
/// or a loader that is never registered or has already been unregistered. /// or a loader that is never registered or has already been unregistered.
/// </returns> /// </returns>
/// <remarks> /// <remarks>
/// This function unregisters font file loader callbacks with the DirectWrit e font system. /// This function unregisters font file loader callbacks with the DirectWrit e font system.
/// The font file loader interface is recommended to be implemented by a sin gleton object. /// The font file loader interface is recommended to be implemented by a sin gleton object.
/// IMPORTANT: font file loader implementations must not register themselves with DirectWrite /// IMPORTANT: font file loader implementations must not register themselves with DirectWrite
/// inside their constructors and must not unregister themselves in their de structors, because /// inside their constructors and must not unregister themselves in their de structors, because
/// registration and unregistraton operations increment and decrement the ob ject reference count respectively. /// registration and unregistration operations increment and decrement the o bject reference count respectively.
/// Instead, registration and unregistration of font file loaders with Direc tWrite should be performed /// Instead, registration and unregistration of font file loaders with Direc tWrite should be performed
/// outside of the font file loader implementation as a separate step. /// outside of the font file loader implementation as a separate step.
/// </remarks> /// </remarks>
STDMETHOD(UnregisterFontFileLoader)( STDMETHOD(UnregisterFontFileLoader)(
IDWriteFontFileLoader* fontFileLoader _In_ IDWriteFontFileLoader* fontFileLoader
) PURE; ) PURE;
/// <summary> /// <summary>
/// Create a text format object used for text layout. /// Create a text format object used for text layout.
/// </summary> /// </summary>
/// <param name="fontFamilyName">Name of the font family</param> /// <param name="fontFamilyName">Name of the font family</param>
/// <param name="fontCollection">Font collection. NULL indicates the system font collection.</param> /// <param name="fontCollection">Font collection. NULL indicates the system font collection.</param>
/// <param name="fontWeight">Font weight</param> /// <param name="fontWeight">Font weight</param>
/// <param name="fontStyle">Font style</param> /// <param name="fontStyle">Font style</param>
/// <param name="fontStretch">Font stretch</param> /// <param name="fontStretch">Font stretch</param>
/// <param name="fontSize">Logical size of the font in DIP units. A DIP ("de vice-independent pixel") equals 1/96 inch.</param> /// <param name="fontSize">Logical size of the font in DIP units. A DIP ("de vice-independent pixel") equals 1/96 inch.</param>
/// <param name="localeName">Locale name</param> /// <param name="localeName">Locale name</param>
/// <param name="textFormat">Contains newly created text format object, or N ULL in case of failure.</param> /// <param name="textFormat">Contains newly created text format object, or N ULL in case of failure.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(CreateTextFormat)( STDMETHOD(CreateTextFormat)(
__in_z WCHAR const* fontFamilyName, _In_z_ WCHAR const* fontFamilyName,
__maybenull IDWriteFontCollection* fontCollection, _In_opt_ IDWriteFontCollection* fontCollection,
DWRITE_FONT_WEIGHT fontWeight, DWRITE_FONT_WEIGHT fontWeight,
DWRITE_FONT_STYLE fontStyle, DWRITE_FONT_STYLE fontStyle,
DWRITE_FONT_STRETCH fontStretch, DWRITE_FONT_STRETCH fontStretch,
FLOAT fontSize, FLOAT fontSize,
__in_z WCHAR const* localeName, _In_z_ WCHAR const* localeName,
__out IDWriteTextFormat** textFormat _COM_Outptr_ IDWriteTextFormat** textFormat
) PURE; ) PURE;
/// <summary> /// <summary>
/// Create a typography object used in conjunction with text format for text layout. /// Create a typography object used in conjunction with text format for text layout.
/// </summary> /// </summary>
/// <param name="typography">Contains newly created typography object, or NU LL in case of failure.</param> /// <param name="typography">Contains newly created typography object, or NU LL in case of failure.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(CreateTypography)( STDMETHOD(CreateTypography)(
__out IDWriteTypography** typography _COM_Outptr_ IDWriteTypography** typography
) PURE; ) PURE;
/// <summary> /// <summary>
/// Create an object used for interoperability with GDI. /// Create an object used for interoperability with GDI.
/// </summary> /// </summary>
/// <param name="gdiInterop">Receives the GDI interop object if successful, or NULL in case of failure.</param> /// <param name="gdiInterop">Receives the GDI interop object if successful, or NULL in case of failure.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(GetGdiInterop)( STDMETHOD(GetGdiInterop)(
__out IDWriteGdiInterop** gdiInterop _COM_Outptr_ IDWriteGdiInterop** gdiInterop
) PURE; ) PURE;
/// <summary> /// <summary>
/// CreateTextLayout takes a string, format, and associated constraints /// CreateTextLayout takes a string, format, and associated constraints
/// and produces and object representing the fully analyzed /// and produces an object representing the fully analyzed
/// and formatted result. /// and formatted result.
/// </summary> /// </summary>
/// <param name="string">The string to layout.</param> /// <param name="string">The string to layout.</param>
/// <param name="stringLength">The length of the string.</param> /// <param name="stringLength">The length of the string.</param>
/// <param name="textFormat">The format to apply to the string.</param> /// <param name="textFormat">The format to apply to the string.</param>
/// <param name="maxWidth">Width of the layout box.</param> /// <param name="maxWidth">Width of the layout box.</param>
/// <param name="maxHeight">Height of the layout box.</param> /// <param name="maxHeight">Height of the layout box.</param>
/// <param name="textLayout">The resultant object.</param> /// <param name="textLayout">The resultant object.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(CreateTextLayout)( STDMETHOD(CreateTextLayout)(
__in_ecount(stringLength) WCHAR const* string, _In_reads_(stringLength) WCHAR const* string,
UINT32 stringLength, UINT32 stringLength,
IDWriteTextFormat* textFormat, _In_ IDWriteTextFormat* textFormat,
FLOAT maxWidth, FLOAT maxWidth,
FLOAT maxHeight, FLOAT maxHeight,
__out IDWriteTextLayout** textLayout _COM_Outptr_ IDWriteTextLayout** textLayout
) PURE; ) PURE;
/// <summary> /// <summary>
/// CreateGdiCompatibleTextLayout takes a string, format, and associated con straints /// CreateGdiCompatibleTextLayout takes a string, format, and associated con straints
/// and produces and object representing the result formatted for a particul ar display resolution /// and produces and object representing the result formatted for a particul ar display resolution
/// and measuring method. The resulting text layout should only be used for the intended resolution, /// and measuring mode. The resulting text layout should only be used for th e intended resolution,
/// and for cases where text scalability is desired, CreateTextLayout should be used instead. /// and for cases where text scalability is desired, CreateTextLayout should be used instead.
/// </summary> /// </summary>
/// <param name="string">The string to layout.</param> /// <param name="string">The string to layout.</param>
/// <param name="stringLength">The length of the string.</param> /// <param name="stringLength">The length of the string.</param>
/// <param name="textFormat">The format to apply to the string.</param> /// <param name="textFormat">The format to apply to the string.</param>
/// <param name="layoutWidth">Width of the layout box.</param> /// <param name="layoutWidth">Width of the layout box.</param>
/// <param name="layoutHeight">Height of the layout box.</param> /// <param name="layoutHeight">Height of the layout box.</param>
/// <param name="pixelsPerDip">Number of physical pixels per DIP. For exampl e, if rendering onto a 96 DPI device then pixelsPerDip /// <param name="pixelsPerDip">Number of physical pixels per DIP. For exampl e, if rendering onto a 96 DPI device then pixelsPerDip
/// is 1. If rendering onto a 120 DPI device then pixelsPerDip is 120/96.</p aram> /// is 1. If rendering onto a 120 DPI device then pixelsPerDip is 120/96.</p aram>
/// <param name="transform">Optional transform applied to the glyphs and the ir positions. This transform is applied after the /// <param name="transform">Optional transform applied to the glyphs and the ir positions. This transform is applied after the
skipping to change at line 4833 skipping to change at line 4934
/// <param name="useGdiNatural"> /// <param name="useGdiNatural">
/// When set to FALSE, instructs the text layout to use the same metrics as GDI aliased text. /// When set to FALSE, instructs the text layout to use the same metrics as GDI aliased text.
/// When set to TRUE, instructs the text layout to use the same metrics as t ext measured by GDI using a font /// When set to TRUE, instructs the text layout to use the same metrics as t ext measured by GDI using a font
/// created with CLEARTYPE_NATURAL_QUALITY. /// created with CLEARTYPE_NATURAL_QUALITY.
/// </param> /// </param>
/// <param name="textLayout">The resultant object.</param> /// <param name="textLayout">The resultant object.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(CreateGdiCompatibleTextLayout)( STDMETHOD(CreateGdiCompatibleTextLayout)(
__in_ecount(stringLength) WCHAR const* string, _In_reads_(stringLength) WCHAR const* string,
UINT32 stringLength, UINT32 stringLength,
IDWriteTextFormat* textFormat, _In_ IDWriteTextFormat* textFormat,
FLOAT layoutWidth, FLOAT layoutWidth,
FLOAT layoutHeight, FLOAT layoutHeight,
FLOAT pixelsPerDip, FLOAT pixelsPerDip,
__in_opt DWRITE_MATRIX const* transform, _In_opt_ DWRITE_MATRIX const* transform,
BOOL useGdiNatural, BOOL useGdiNatural,
__out IDWriteTextLayout** textLayout _COM_Outptr_ IDWriteTextLayout** textLayout
) PURE; ) PURE;
/// <summary> /// <summary>
/// The application may call this function to create an inline object for tr imming, using an ellipsis as the omission sign. /// The application may call this function to create an inline object for tr imming, using an ellipsis as the omission sign.
/// The ellipsis will be created using the current settings of the format, i ncluding base font, style, and any effects. /// The ellipsis will be created using the current settings of the format, i ncluding base font, style, and any effects.
/// Alternate omission signs can be created by the application by implementi ng IDWriteInlineObject. /// Alternate omission signs can be created by the application by implementi ng IDWriteInlineObject.
/// </summary> /// </summary>
/// <param name="textFormat">Text format used as a template for the omission sign.</param> /// <param name="textFormat">Text format used as a template for the omission sign.</param>
/// <param name="trimmingSign">Created omission sign.</param> /// <param name="trimmingSign">Created omission sign.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(CreateEllipsisTrimmingSign)( STDMETHOD(CreateEllipsisTrimmingSign)(
IDWriteTextFormat* textFormat, _In_ IDWriteTextFormat* textFormat,
__out IDWriteInlineObject** trimmingSign _COM_Outptr_ IDWriteInlineObject** trimmingSign
) PURE; ) PURE;
/// <summary> /// <summary>
/// Return an interface to perform text analysis with. /// Return an interface to perform text analysis with.
/// </summary> /// </summary>
/// <param name="textAnalyzer">The resultant object.</param> /// <param name="textAnalyzer">The resultant object.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(CreateTextAnalyzer)( STDMETHOD(CreateTextAnalyzer)(
__out IDWriteTextAnalyzer** textAnalyzer _COM_Outptr_ IDWriteTextAnalyzer** textAnalyzer
) PURE; ) PURE;
/// <summary> /// <summary>
/// Creates a number substitution object using a locale name, /// Creates a number substitution object using a locale name,
/// substitution method, and whether to ignore user overrides (uses NLS /// substitution method, and whether to ignore user overrides (uses NLS
/// defaults for the given culture instead). /// defaults for the given culture instead).
/// </summary> /// </summary>
/// <param name="substitutionMethod">Method of number substitution to use.</ param> /// <param name="substitutionMethod">Method of number substitution to use.</ param>
/// <param name="localeName">Which locale to obtain the digits from.</param> /// <param name="localeName">Which locale to obtain the digits from.</param>
/// <param name="ignoreUserOverride">Ignore the user's settings and use the locale defaults</param> /// <param name="ignoreUserOverride">Ignore the user's settings and use the locale defaults</param>
/// <param name="numberSubstitution">Receives a pointer to the newly created object.</param> /// <param name="numberSubstitution">Receives a pointer to the newly created object.</param>
STDMETHOD(CreateNumberSubstitution)( STDMETHOD(CreateNumberSubstitution)(
__in DWRITE_NUMBER_SUBSTITUTION_METHOD substitutionMethod, _In_ DWRITE_NUMBER_SUBSTITUTION_METHOD substitutionMethod,
__in_z WCHAR const* localeName, _In_z_ WCHAR const* localeName,
__in BOOL ignoreUserOverride, _In_ BOOL ignoreUserOverride,
__out IDWriteNumberSubstitution** numberSubstitution _COM_Outptr_ IDWriteNumberSubstitution** numberSubstitution
) PURE; ) PURE;
/// <summary> /// <summary>
/// Creates a glyph run analysis object, which encapsulates information /// Creates a glyph run analysis object, which encapsulates information
/// used to render a glyph run. /// used to render a glyph run.
/// </summary> /// </summary>
/// <param name="glyphRun">Structure specifying the properties of the glyph run.</param> /// <param name="glyphRun">Structure specifying the properties of the glyph run.</param>
/// <param name="pixelsPerDip">Number of physical pixels per DIP. For exampl e, if rendering onto a 96 DPI bitmap then pixelsPerDip /// <param name="pixelsPerDip">Number of physical pixels per DIP. For exampl e, if rendering onto a 96 DPI bitmap then pixelsPerDip
/// is 1. If rendering onto a 120 DPI bitmap then pixelsPerDip is 120/96.</p aram> /// is 1. If rendering onto a 120 DPI bitmap then pixelsPerDip is 120/96.</p aram>
/// <param name="transform">Optional transform applied to the glyphs and the ir positions. This transform is applied after the /// <param name="transform">Optional transform applied to the glyphs and the ir positions. This transform is applied after the
skipping to change at line 4905 skipping to change at line 5006
/// <param name="renderingMode">Specifies the rendering mode, which must be one of the raster rendering modes (i.e., not default /// <param name="renderingMode">Specifies the rendering mode, which must be one of the raster rendering modes (i.e., not default
/// and not outline).</param> /// and not outline).</param>
/// <param name="measuringMode">Specifies the method to measure glyphs.</par am> /// <param name="measuringMode">Specifies the method to measure glyphs.</par am>
/// <param name="baselineOriginX">Horizontal position of the baseline origin , in DIPs.</param> /// <param name="baselineOriginX">Horizontal position of the baseline origin , in DIPs.</param>
/// <param name="baselineOriginY">Vertical position of the baseline origin, in DIPs.</param> /// <param name="baselineOriginY">Vertical position of the baseline origin, in DIPs.</param>
/// <param name="glyphRunAnalysis">Receives a pointer to the newly created o bject.</param> /// <param name="glyphRunAnalysis">Receives a pointer to the newly created o bject.</param>
/// <returns> /// <returns>
/// Standard HRESULT error code. /// Standard HRESULT error code.
/// </returns> /// </returns>
STDMETHOD(CreateGlyphRunAnalysis)( STDMETHOD(CreateGlyphRunAnalysis)(
__in DWRITE_GLYPH_RUN const* glyphRun, _In_ DWRITE_GLYPH_RUN const* glyphRun,
FLOAT pixelsPerDip, FLOAT pixelsPerDip,
__in_opt DWRITE_MATRIX const* transform, _In_opt_ DWRITE_MATRIX const* transform,
DWRITE_RENDERING_MODE renderingMode, DWRITE_RENDERING_MODE renderingMode,
DWRITE_MEASURING_MODE measuringMode, DWRITE_MEASURING_MODE measuringMode,
FLOAT baselineOriginX, FLOAT baselineOriginX,
FLOAT baselineOriginY, FLOAT baselineOriginY,
__out IDWriteGlyphRunAnalysis** glyphRunAnalysis _COM_Outptr_ IDWriteGlyphRunAnalysis** glyphRunAnalysis
) PURE; ) PURE;
}; // interface IDWriteFactory }; // interface IDWriteFactory
/// <summary> /// <summary>
/// Creates a DirectWrite factory object that is used for subsequent creation of individual DirectWrite objects. /// Creates a DirectWrite factory object that is used for subsequent creation of individual DirectWrite objects.
/// </summary> /// </summary>
/// <param name="factoryType">Identifies whether the factory object will be shar ed or isolated.</param> /// <param name="factoryType">Identifies whether the factory object will be shar ed or isolated.</param>
/// <param name="iid">Identifies the DirectWrite factory interface, such as __uu idof(IDWriteFactory).</param> /// <param name="iid">Identifies the DirectWrite factory interface, such as __uu idof(IDWriteFactory).</param>
/// <param name="factory">Receives the DirectWrite factory object.</param> /// <param name="factory">Receives the DirectWrite factory object.</param>
skipping to change at line 4937 skipping to change at line 5038
/// Obtains DirectWrite factory object that is used for subsequent creation of i ndividual DirectWrite classes. /// Obtains DirectWrite factory object that is used for subsequent creation of i ndividual DirectWrite classes.
/// DirectWrite factory contains internal state such as font loader registration and cached font data. /// DirectWrite factory contains internal state such as font loader registration and cached font data.
/// In most cases it is recommended to use the shared factory object, because it allows multiple components /// In most cases it is recommended to use the shared factory object, because it allows multiple components
/// that use DirectWrite to share internal DirectWrite state and reduce memory u sage. /// that use DirectWrite to share internal DirectWrite state and reduce memory u sage.
/// However, there are cases when it is desirable to reduce the impact of a comp onent, /// However, there are cases when it is desirable to reduce the impact of a comp onent,
/// such as a plug-in from an untrusted source, on the rest of the process by sa ndboxing and isolating it /// such as a plug-in from an untrusted source, on the rest of the process by sa ndboxing and isolating it
/// from the rest of the process components. In such cases, it is recommended to use an isolated factory for the sandboxed /// from the rest of the process components. In such cases, it is recommended to use an isolated factory for the sandboxed
/// component. /// component.
/// </remarks> /// </remarks>
EXTERN_C HRESULT DWRITE_EXPORT DWriteCreateFactory( EXTERN_C HRESULT DWRITE_EXPORT DWriteCreateFactory(
__in DWRITE_FACTORY_TYPE factoryType, _In_ DWRITE_FACTORY_TYPE factoryType,
__in REFIID iid, _In_ REFIID iid,
__out IUnknown **factory _COM_Outptr_ IUnknown **factory
); );
// Macros used to define DirectWrite error codes. // Macros used to define DirectWrite error codes.
#define FACILITY_DWRITE 0x898 #define FACILITY_DWRITE 0x898
#define DWRITE_ERR_BASE 0x5000 #define DWRITE_ERR_BASE 0x5000
#define MAKE_DWRITE_HR(severity, code) MAKE_HRESULT(severity, FACILITY_DWRITE, ( DWRITE_ERR_BASE + code)) #define MAKE_DWRITE_HR(severity, code) MAKE_HRESULT(severity, FACILITY_DWRITE, ( DWRITE_ERR_BASE + code))
#define MAKE_DWRITE_HR_ERR(code) MAKE_DWRITE_HR(SEVERITY_ERROR, code) #define MAKE_DWRITE_HR_ERR(code) MAKE_DWRITE_HR(SEVERITY_ERROR, code)
/// <summary> // DWrite errors have moved to winerror.h
/// Indicates an error in an input file such as a font file.
/// </summary>
#define DWRITE_E_FILEFORMAT MAKE_DWRITE_HR_ERR(0x000)
/// <summary>
/// Indicates an error originating in DirectWrite code, which is not expected to
occur but is safe to recover from.
/// </summary>
#define DWRITE_E_UNEXPECTED MAKE_DWRITE_HR_ERR(0x001)
/// <summary>
/// Indicates the specified font does not exist.
/// </summary>
#define DWRITE_E_NOFONT MAKE_DWRITE_HR_ERR(0x002)
/// <summary>
/// A font file could not be opened because the file, directory, network locatio
n, drive, or other storage
/// location does not exist or is unavailable.
/// </summary>
#define DWRITE_E_FILENOTFOUND MAKE_DWRITE_HR_ERR(0x003)
/// <summary>
/// A font file exists but could not be opened due to access denied, sharing vio
lation, or similar error.
/// </summary>
#define DWRITE_E_FILEACCESS MAKE_DWRITE_HR_ERR(0x004)
/// <summary>
/// A font collection is obsolete due to changes in the system.
/// </summary>
#define DWRITE_E_FONTCOLLECTIONOBSOLETE MAKE_DWRITE_HR_ERR(0x005)
/// <summary>
/// The given interface is already registered.
/// </summary>
#define DWRITE_E_ALREADYREGISTERED MAKE_DWRITE_HR_ERR(0x006)
#endif /* DWRITE_H_INCLUDED */ #endif /* DWRITE_H_INCLUDED */
 End of changes. 252 change blocks. 
415 lines changed or deleted 496 lines changed or added

This html diff was produced by rfcdiff 1.41.