ScriptSubstituteSingleGlyph function (usp10.h)

Enables substitution of a single glyph with one alternate form of the same glyph for OpenType processing.

Syntax

HRESULT ScriptSubstituteSingleGlyph(
  [in, optional] HDC             hdc,
  [in, out]      SCRIPT_CACHE    *psc,
  [in, optional] SCRIPT_ANALYSIS *psa,
  [in]           OPENTYPE_TAG    tagScript,
  [in]           OPENTYPE_TAG    tagLangSys,
  [in]           OPENTYPE_TAG    tagFeature,
  [in]           LONG            lParameter,
  [in]           WORD            wGlyphId,
  [out]          WORD            *pwOutGlyphId
);

Parameters

[in, optional] hdc

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

[in, out] psc

Pointer to a SCRIPT_CACHE structure indicating the script cache.

[in, optional] psa

Pointer to a SCRIPT_ANALYSIS structure obtained from a previous call to ScriptItemizeOpenType. This parameter identifies the shaping engine so that the correct substitute glyph is used.

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

[in] tagScript

An OPENTYPE_TAG structure defining the script tag for shaping.

[in] tagLangSys

An OPENTYPE_TAG structure defining the language tag for shaping.

[in] tagFeature

An OPENTYPE_TAG structure defining the feature tag to use for shaping the alternate glyph.

[in] lParameter

Reference to the alternate glyph to substitute. This reference is an index to an array that contains all the alternate glyphs defined in the feature, as illustrated for OPENTYPE_FEATURE_RECORD. The alternate glyph array is one of the items retrieved by ScriptGetFontAlternateGlyphs.

[in] wGlyphId

Identifier of the original glyph.

[out] pwOutGlyphId

Pointer to the location in which this function retrieves the identifier of the alternate glyph.

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.

Remarks

This function uses one-to-one substitution in which the application can substitute one glyph with one alternate form. Most often, applications use this function to set a bullet or an alternate glyph at the beginning or end of a line.

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.
 

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header usp10.h
Library Usp10.lib
DLL Usp10.dll
Redistributable Usp10.dll version 1.600 or greater on Windows XP

See also

Caching

OPENTYPE_TAG

SCRIPT_ANALYSIS

SCRIPT_CACHE

ScriptGetFontAlternateGlyphs

ScriptItemizeOpenType

Uniscribe

Uniscribe Functions