[PATCH] gdi32: Add support for GCP_USEKERNING to GetCharacterPlacement.

Huw Davies huw at codeweavers.com
Fri Jun 19 03:28:31 CDT 2020


Hi Dmitry,

On Fri, Jun 19, 2020 at 11:13:02AM +0800, Dmitry Timoshkov wrote:
> @@ -3325,7 +3375,7 @@ GetCharacterPlacementW(
>            lpResults->lpDx, lpResults->lpCaretPos, lpResults->lpClass,
>            lpResults->lpGlyphs, lpResults->nGlyphs, lpResults->nMaxFit);
>  
> -    if(dwFlags&(~GCP_REORDER))
> +    if (dwFlags & ~(GCP_REORDER | GCP_USEKERNING))
>          FIXME("flags 0x%08x ignored\n", dwFlags);
>      if(lpResults->lpClass)

Not an issue, but could you sneak in a space after "if" here too?

>          FIXME("classes not implemented\n");

> @@ -3375,15 +3439,22 @@ GetCharacterPlacementW(
>  
>          lpResults->lpCaretPos[0] = 0;
>          for (i = 1; i < nSet; i++)
> +        {
> +            if (dwFlags & GCP_USEKERNING)
> +                pos += kern[i];

This should be kern[i - 1], right?   It might be clearer to
rewrite the loop to start at 0 and run for i < nSet - 1 --- up to you.

Also, and I should have asked this yesterday, could you add
some tests?  One possible way is to call GetKerningPairs()
first, generate a string from the pairs (perhaps a two letter
word for each pair).  Then call GetCharacterPlacement() with and
without GCP_USEKERNING and use the kerning pairs to compare
them.

Huw.



More information about the wine-devel mailing list