Commit 80e30f3d authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

gdi32: Implement GetCharWidthI.

parent b3d018f9
...@@ -3186,11 +3186,44 @@ BOOL WINAPI EnableEUDC(BOOL fEnableEUDC) ...@@ -3186,11 +3186,44 @@ BOOL WINAPI EnableEUDC(BOOL fEnableEUDC)
/*********************************************************************** /***********************************************************************
* GetCharWidthI (GDI32.@) * GetCharWidthI (GDI32.@)
*
* Retrieve widths of characters.
*
* PARAMS
* hdc [I] Handle to a device context.
* first [I] First glyph in range to query.
* count [I] Number of glyph indices to query.
* glyphs [I] Array of glyphs to query.
* buffer [O] Buffer to receive character widths.
*
* NOTES
* Only works with TrueType fonts.
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*/ */
BOOL WINAPI GetCharWidthI(HDC hdc, UINT giFirst, UINT cgi, LPWORD pgi, LPINT lpBuffer) BOOL WINAPI GetCharWidthI(HDC hdc, UINT first, UINT count, LPWORD glyphs, LPINT buffer)
{ {
FIXME("(%p, %d, %d, %p, %p): stub\n", hdc, giFirst, cgi, pgi, lpBuffer); ABC *abc;
return FALSE; unsigned int i;
TRACE("(%p, %d, %d, %p, %p)\n", hdc, first, count, glyphs, buffer);
if (!(abc = HeapAlloc(GetProcessHeap(), 0, count * sizeof(ABC))))
return FALSE;
if (!GetCharABCWidthsI(hdc, first, count, glyphs, abc))
{
HeapFree(GetProcessHeap(), 0, abc);
return FALSE;
}
for (i = 0; i < count; i++)
buffer[i] = abc->abcA + abc->abcB + abc->abcC;
HeapFree(GetProcessHeap(), 0, abc);
return TRUE;
} }
/*********************************************************************** /***********************************************************************
......
...@@ -3423,6 +3423,7 @@ BOOL WINAPI GetCharWidth32A(HDC,UINT,UINT,LPINT); ...@@ -3423,6 +3423,7 @@ BOOL WINAPI GetCharWidth32A(HDC,UINT,UINT,LPINT);
BOOL WINAPI GetCharWidth32W(HDC,UINT,UINT,LPINT); BOOL WINAPI GetCharWidth32W(HDC,UINT,UINT,LPINT);
#define GetCharWidth32 WINELIB_NAME_AW(GetCharWidth32) #define GetCharWidth32 WINELIB_NAME_AW(GetCharWidth32)
BOOL WINAPI GetCharWidthA(HDC,UINT,UINT,LPINT); BOOL WINAPI GetCharWidthA(HDC,UINT,UINT,LPINT);
BOOL WINAPI GetCharWidthI(HDC,UINT,UINT,LPWORD,LPINT);
BOOL WINAPI GetCharWidthW(HDC,UINT,UINT,LPINT); BOOL WINAPI GetCharWidthW(HDC,UINT,UINT,LPINT);
#define GetCharWidth WINELIB_NAME_AW(GetCharWidth) #define GetCharWidth WINELIB_NAME_AW(GetCharWidth)
BOOL WINAPI GetCharWidthFloatA(HDC,UINT,UINT,PFLOAT); BOOL WINAPI GetCharWidthFloatA(HDC,UINT,UINT,PFLOAT);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment