IDWriteFontSet::GetMatchingFonts(DWRITE_FONT_PROPERTYconst*,UINT32,IDWriteFontSet**) method (dwrite_3.h)

Returns a subset of fonts filtered by the given properties.

Syntax

HRESULT GetMatchingFonts(
  DWRITE_FONT_PROPERTY const *properties,
  UINT32                     propertyCount,
  IDWriteFontSet             **filteredSet
);

Parameters

properties

Type: [in] const DWRITE_FONT_PROPERTY*

List of properties to filter using.

propertyCount

Type: UINT32

The number of properties to filter.

filteredSet

Type: [out] IDWriteFontSet**

The subset of fonts that match the properties, or nullptr on failure.

Return value

Type: HRESULT

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

Remarks

If no fonts matched the filter, the subset will be empty (GetFontCount returns 0), but the function does not return an error. The subset will always be equal to or less than the original set. If you only want to filter out remote fonts, you may pass null in properties and zero in propertyCount.

Requirements

Requirement Value
Minimum supported client Windows 10 [desktop apps only]
Minimum supported server Windows Server 2016 [desktop apps only]
Target Platform Windows
Header dwrite_3.h
Library Dwrite.lib
DLL Dwrite.dll

See also

IDWriteFontSet