ScriptGetLogicalWidths function (usp10.h)

Converts the glyph advance widths for a specific font into logical widths.

Syntax

HRESULT ScriptGetLogicalWidths(
  const SCRIPT_ANALYSIS *psa,
  int                   cChars,
  int                   cGlyphs,
  const int             *piGlyphWidth,
  const WORD            *pwLogClust,
  const SCRIPT_VISATTR  *psva,
  int                   *piDx
);

Parameters

psa

Pointer to a SCRIPT_ANALYSIS structure.

cChars

Count of the logical code points in the run.

cGlyphs

Count of the glyphs in the run.

piGlyphWidth

Pointer to an array of glyph advance widths.

pwLogClust

Pointer to an array of logical clusters.

psva

Pointer to a SCRIPT_VISATTR structure defining visual attributes.

piDx

Pointer to an array of logical widths.

Return value

Currently returns S_OK in all cases.

Remarks

This function is useful for recording widths in a font-independent manner. It converts the glyph advance widths calculated for a specific font into logical widths, one per code point, in the same order as the code points. If the same string is then displayed on a different device using a different font, the logical widths can be applied by using ScriptApplyLogicalWidth to approximate the original placement. This mechanism is useful when implementing print preview. On the preview screen, it is important to match the layout and placement of the final printed result.

Note  Ligature glyph widths are divided evenly among the characters they represent.
 
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

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header usp10.h
Library Usp10.lib
DLL Usp10.dll
Redistributable Internet Explorer 5 or later on Windows Me/98/95

See also

SCRIPT_ANALYSIS

SCRIPT_VISATTR

ScriptApplyLogicalWidth

Uniscribe

Uniscribe Functions