[PATCH 1/2] gdi32: Add support for GCP_LIGATE to GetCharacterPlacement.
Dmitry Timoshkov
dmitry at baikal.ru
Thu Jun 18 04:46:36 CDT 2020
Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
dlls/gdi32/font.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c
index 8788426a2c..cc366eb4d7 100644
--- a/dlls/gdi32/font.c
+++ b/dlls/gdi32/font.c
@@ -3309,6 +3309,7 @@ GetCharacterPlacementW(
DWORD ret=0;
SIZE size;
UINT i, nSet;
+ WCHAR *norm = NULL;
TRACE("%s, %d, %d, 0x%08x\n",
debugstr_wn(lpString, uCount), uCount, nMaxExtent, dwFlags);
@@ -3325,13 +3326,32 @@ GetCharacterPlacementW(
lpResults->lpDx, lpResults->lpCaretPos, lpResults->lpClass,
lpResults->lpGlyphs, lpResults->nGlyphs, lpResults->nMaxFit);
- if(dwFlags&(~GCP_REORDER))
+ if (dwFlags & ~(GCP_REORDER | GCP_LIGATE))
FIXME("flags 0x%08x ignored\n", dwFlags);
if(lpResults->lpClass)
FIXME("classes not implemented\n");
if (lpResults->lpCaretPos && (dwFlags & GCP_REORDER))
FIXME("Caret positions for complex scripts not implemented\n");
+ if (dwFlags & GCP_LIGATE)
+ {
+ nSet = NormalizeString(NormalizationC, lpString, uCount, NULL, 0);
+ if (!nSet) return 0;
+ norm = heap_alloc(nSet * sizeof(WCHAR));
+ if (!norm)
+ {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+ return 0;
+ }
+ if (!NormalizeString(NormalizationC, lpString, uCount, norm, nSet))
+ {
+ heap_free(norm);
+ return 0;
+ }
+ lpString = norm;
+ uCount = nSet;
+ }
+
nSet = (UINT)uCount;
if(nSet > lpResults->nGlyphs)
nSet = lpResults->nGlyphs;
@@ -3385,6 +3405,8 @@ GetCharacterPlacementW(
if (GetTextExtentPoint32W(hdc, lpString, uCount, &size))
ret = MAKELONG(size.cx, size.cy);
+ heap_free(norm);
+
return ret;
}
--
2.26.2
More information about the wine-devel
mailing list