ScriptGetFontFeatureTags function

Retrieves a list of typographic features for the defined writing system for OpenType processing. The typographic feature tags comprising the list are retrieved from the font in the supplied device context or cache.


HRESULT ScriptGetFontFeatureTags(
  _In_opt_ HDC             hdc,
  _Inout_  SCRIPT_CACHE    *psc,
  _In_opt_ SCRIPT_ANALYSIS *psa,
  _In_     OPENTYPE_TAG    tagScript,
  _In_     OPENTYPE_TAG    tagLangSys,
  _In_     int             cMaxTags,
  _Out_    OPENTYPE_TAG    *pFeatureTags,
  _Out_    int             *pcTags


hdc [in, optional]

Handle to the device context. For more information, see Caching.

psc [in, out]

Pointer to a SCRIPT_CACHE structure identifying the script cache.

psa [in, optional]

Pointer to a SCRIPT_ANALYSIS structure obtained from a previous call to ScriptItemizeOpenType. This parameter identifies the shaping engine, so that the font feature tags for the appropriate font and scripts can be retrieved.

Alternatively, the application can set this parameter to NULL to retrieve unfiltered results.

tagScript [in]

An OPENTYPE_TAG structure defining the script tag associated with the specified feature tags.

tagLangSys [in]

An OPENTYPE_TAG structure defining the language tag associated with the specified feature tags.

cMaxTags [in]

The length of the array specified by pFeatureTags.

pFeatureTags [out]

Pointer to a buffer in which this function retrieves an array of OPENTYPE_TAG structures defining the typographic feature tags supported by the font in the device context or cache for the defined writing system.

pcTags [out]

Pointer to the number of elements in the feature tag array.

Return value

Returns 0 if successful. The function returns a nonzero HRESULT value if it does not succeed. The application can test the return value with the SUCCEEDED and FAILED macros.

If the number of matching tags exceeds the value of cMaxTags, the function fails with E_OUTOFMEMORY. The application can try calling again with larger buffers.


While formally declared as a ULONG type, an OPENTYPE_TAG structure contains a 4-byte array that contains four 8-bit ASCII values of space, A-Z, or a-z. For example, the feature tag for the Ligature feature is "liga".

This function hides script-required or language-required features because the shaping engine controls these features. The application has no control over the shaping engine handling for language-required features. For example, ScriptGetFontFeatureTags hides the Arabic script features for initial, medial, and final forms.

Important  Starting with Windows 8: To maintain the ability to run on Windows 7, a module that uses Uniscribe must specify Usp10.lib before gdi32.lib in its library list.


Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]


Usp10.dll version 1.600 or greater on Windows XP







See also

Uniscribe Functions