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:dwrite_1.IDWriteFontFace1.GetKerningPairAdjustments |
IDWriteFontFace1::GetKerningPairAdjustments (dwrite_1.h) |
Retrieves the kerning pair adjustments from the font's kern table. |
|
directwrite\idwritefontface1_getkerningpairadjustments.htm |
DirectWrite |
DA837B04-85BC-4A3B-A6FE-24D5AFD21B14 |
12/05/2018 |
GetKerningPairAdjustments, GetKerningPairAdjustments method [Direct Write], GetKerningPairAdjustments method [Direct Write],IDWriteFontFace1 interface, IDWriteFontFace1 interface [Direct Write],GetKerningPairAdjustments method, IDWriteFontFace1.GetKerningPairAdjustments, IDWriteFontFace1::GetKerningPairAdjustments, directwrite.idwritefontface1_getkerningpairadjustments, dwrite_1/IDWriteFontFace1::GetKerningPairAdjustments |
dwrite_1.h |
Windows |
Windows 8 and Platform Update for Windows 7 [desktop apps \| UWP apps] |
Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps \| UWP apps] |
Dwrite_1.lib |
Dwrite_1.dll |
Windows |
19H1 |
|
|
|
|
|
|
Retrieves the kerning pair adjustments from the font's kern table.
Type: UINT32
Number of glyphs to retrieve adjustments for.
Type: const UINT16*
An array of glyph id's to retrieve adjustments for.
Type: INT32*
The advances, returned in font design units, for each glyph. The last glyph adjustment is zero.
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
GetKerningPairAdjustments isn't a direct replacement for GDI's character based GetKerningPairs, but it serves the same role, without the client needing to cache them locally. GetKerningPairAdjustments also uses glyph id's directly rather than UCS-2 characters (how the kern table actually stores them), which avoids glyph collapse and ambiguity, such as the dash and hyphen, or space and non-breaking space.
Newer fonts may have only GPOS kerning instead of the legacy pair-table kerning. Such fonts, like Gabriola, will only return 0's for adjustments. GetKerningPairAdjustments doesn't virtualize and flatten these GPOS entries into kerning pairs.
You can realize a performance benefit by calling IDWriteFontFace1::HasKerningPairs to determine whether you need to call GetKerningPairAdjustments. If you previously called IDWriteFontFace1::HasKerningPairs and it returned FALSE, you can avoid calling GetKerningPairAdjustments because the font has no kerning pair-table entries. That is, in this situation, a call to GetKerningPairAdjustments would be a no-op.