Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ScriptGetLogicalWidths function

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

Syntax


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

Parameters

psa [in]

Pointer to a SCRIPT_ANALYSIS structure.

cChars [in]

Count of the logical code points in the run.

cGlyphs [in]

Count of the glyphs in the run.

piGlyphWidth [in]

Pointer to an array of glyph advance widths.

pwLogClust [in]

Pointer to an array of logical clusters.

psva [in]

Pointer to a SCRIPT_VISATTR structure defining visual attributes.

piDx [out]

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]

Redistributable

Internet Explorer 5 or later on Windows Me/98/95

Header

Usp10.h

Library

Usp10.lib

DLL

Usp10.dll

See also

Uniscribe
Uniscribe Functions
ScriptApplyLogicalWidth
SCRIPT_ANALYSIS
SCRIPT_VISATTR

 

 

Community Additions

ADD
Show:
© 2015 Microsoft