Skip to content

Latest commit

 

History

History
152 lines (95 loc) · 6.18 KB

nf-usp10-scriptpositionsingleglyph.md

File metadata and controls

152 lines (95 loc) · 6.18 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:usp10.ScriptPositionSingleGlyph
ScriptPositionSingleGlyph function (usp10.h)
Positions a single glyph with a single adjustment using a specified feature provided in the font for OpenType processing. Most often, applications use this function to align a glyph optically at the beginning or end of a line.
ScriptPositionSingleGlyph
ScriptPositionSingleGlyph function [Internationalization for Windows Applications]
_win32_ScriptPositionSingleGlyph
intl.scriptpositionsingleglyph
usp10/ScriptPositionSingleGlyph
intl\scriptpositionsingleglyph.htm
Intl
8dc776a9-fdde-4982-a2ca-e4384615bc47
12/05/2018
ScriptPositionSingleGlyph, ScriptPositionSingleGlyph function [Internationalization for Windows Applications], _win32_ScriptPositionSingleGlyph, intl.scriptpositionsingleglyph, usp10/ScriptPositionSingleGlyph
usp10.h
Windows
Windows Vista [desktop apps only]
Windows Server 2008 [desktop apps only]
Usp10.lib
Usp10.dll
Windows
Usp10.dll version 1.600 or greater on Windows XP
19H1
ScriptPositionSingleGlyph
usp10/ScriptPositionSingleGlyph
c++
APIRef
kbSyntax
DllExport
Usp10.dll
Ext-MS-Win-GDI-Internal-Desktop-L1-1-0.dll
GDI32.dll
GDI32Full.dll
ScriptPositionSingleGlyph

ScriptPositionSingleGlyph function

-description

Positions a single glyph with a single adjustment using a specified feature provided in the font for OpenType processing. Most often, applications use this function to align a glyph optically at the beginning or end of a line.

-parameters

-param hdc [in, optional]

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

-param psc [in, out]

Pointer to a SCRIPT_CACHE structure identifying the script cache.

-param psa [in, optional]

Pointer to a SCRIPT_ANALYSIS structure obtained from a previous call to ScriptItemizeOpenType. This structure identifies the shaping engine, so that the advance widths can be retrieved.

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

-param tagScript [in]

An OPENTYPE_TAG structure defining the script tag for shaping.

-param tagLangSys [in]

An OPENTYPE_TAG structure defining the language tag for shaping.

-param tagFeature [in]

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

-param lParameter [in]

A flag specifying if single substitution should be applied to the identifier specified in wGlyphId. The application sets this parameter to 1 to apply the single substitution feature to the identifier. The application sets the parameter to 0 if the function should not apply the feature.

-param wGlyphId [in]

The identifier of the original glyph being shaped.

-param iAdvance [in]

The original glyph advance width.

-param GOffset [in]

The original glyph offset. Typically, this value is an output of ScriptPlaceOpenType or ScriptPlace.

-param piOutAdvance [out]

Pointer to the location in which this function retrieves the new advance width adjusted for the alternate glyph.

-param pOutGoffset [out]

Pointer to the location in which this function retrieves the new glyph offset adjusted for the alternate glyph.

-returns

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 positions an individual glyph by adjusting the advance width and/or the offset of the given glyph. The function assumes that the font requires only one adjustment.

A typical use of this function is the slight adjustment of the margin to account for the visual impression made by certain characters. In Latin script, for example, at the beginning of a line it is common to make a slight adjustment to the left for an initial capital (such as "T" or "O") that does not have a vertical line on the left part of the glyph. Although doing this breaks the strict linear margin, the eye perceives the margin as more even.

The following examples demonstrate this effect. The first example shows strict alignment; the next two examples show an adjustment of the initial "T" to the left. The adjustments are by one pixel and two pixels, respectively. The magnified images to the right show how the "T" pushes slightly farther into the left margin in each successive case.

Illustration showing the same block of text three times, with enlargements of each showing slightly different alignment

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.
 

-see-also

Caching

OPENTYPE_TAG

SCRIPT_ANALYSIS

SCRIPT_CACHE

ScriptItemizeOpenType

Uniscribe

Uniscribe Functions