Compartilhar via


ScriptGetCMap (Windows Embedded CE 6.0)

1/6/2010

This function takes a string and returns the glyph indices of the Unicode characters according to the TrueType cmap table or the standard cmap table implemented for old style fonts.

Syntax

HRESULT WINAPI ScriptGetCMap(
  HDC hdc, 
  SCRIPT_CACHE *psc, 
  const WCHAR *pwcInChars, 
  int cChars, 
  DWORD dwFlags, 
  WORD *pwOutGlyphs 
);

Parameters

  • hdc
    [in] Handle to the device context. This parameter is optional.
  • pwcInChars
    [in] Pointer to a string of Unicode characters.
  • cChars
    [in] Number of Unicode characters in pwcInChars.
  • dwFlags
    [in] Flag that specifies any special handling of the glyphs. By default, the glyphs of the buffer are given in logical order with no special handling. This parameter can be set to SGCM_RTL, which indicates that the glyph array pwOutGlyps should contain mirrored glyphs for those glyphs that have a mirrored equivalent.
  • pwOutGlyphs
    [out] Pointer to an array that receives the glyph indexes.

Return Value

If all Unicode code points are present in the font, the return value is S_OK.

If the function fails, it may return one of the following nonzero values.

Value Description

E_HANDLE

The font or the system does not support glyph indices.

S_FALSE

Some of the Unicode code points were mapped to the default glyph.

If any other unrecoverable error is encountered, it is returned as an HRESULT.

Remarks

ScriptGetCMap may be used to determine which characters in a run are supported by the selected font. The caller may scan the returned glyph buffer looking for the default glyph to determine which characters are not available. The default glyph index for the selected font should be determined by calling ScriptGetFontProperties.

The return value indicates the presence of any missing glyphs.

Note that some code points can be rendered by a combination of glyphs as well as by a single glyph — for example, 00C9; LATIN CAPITAL LETTER E WITH ACUTE. In this case, if the font supports the capital E glyph and the acute glyph but not a single glyph for 00C9, ScriptGetCMap will show 00C9 is unsupported. To determine the font support for a string that contains these kinds of code points, call ScriptShape. If it returns S_OK, check the output for missing glyphs.

Requirements

Header usp10.h
Library Uspce.lib
Windows Embedded CE Windows CE 5.0 and later

See Also

Reference

ScriptGetFontProperties
ScriptShape
SCRIPT_CACHE

Other Resources

Uniscribe Functions