The information in this article applies to:
SYMPTOMSThe GetCharacterPlacement function retrieves information about a character string, such as character widths and caret positioning. You can calculate the widths with kerning pairs if you use the GCP_USEKERNING flag when calling GetCharacterPlacement. On Windows 95, when calling GetCharacterPlacement with GCP_USEKERNING to kern a "repetitive" string (for example, "AVAVAVAVAVA"), the string correctly kerns the first two gaps (that is, "AVA") but nothing else. This happens with a range of repetitive strings. CAUSEOn Windows 95, the GetCharacterPlacement function is not properly calculating the "lpDx" array in the GCP_RESULTS structure when filling in the distances between adjacent character cells for some strings. RESOLUTIONTo reliably calculate the correct character placement (with kerning) for all strings, call GetKerningPairs and calculate the character spacing yourself. STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. MORE INFORMATION
Most TrueType fonts have a kerning table, but you do not have to use it. To
find out whether the current font supports kerning pairs, call
GetFontLanguageInfo. When you call GetCharacterPlacement with
GCP_USEKERNING to kern the string "AVAVAVAVAVAV", the GetCharacterPlacement function correctly
kerns the first two character widths only. If you examine the lpDx array
filled by the GetCharacterPlacement API, it confirms this. The first two
values are different from and slightly smaller than the rest of the values
(which are all identical). Only the first two gaps between characters are
kerned. The values should all be the same.
Steps to Reproduce BehaviorThe following code demonstrates the problem. After executing the code, observe the dx[] array. The first two values are different from the rest:Sample Code
Additional query words:
Keywords : kbSDKWin32 kbWinOS95 kbDSupport |
Last Reviewed: June 25, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |