gdi32: Implement GetCharWidthI.

oldstable
Hans Leidekker 2007-01-02 14:18:31 +01:00 committed by Alexandre Julliard
parent b3d018f99b
commit 80e30f3d1b
2 changed files with 37 additions and 3 deletions

View File

@ -3186,11 +3186,44 @@ BOOL WINAPI EnableEUDC(BOOL fEnableEUDC)
/***********************************************************************
* 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);
return FALSE;
ABC *abc;
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;
}
/***********************************************************************

View File

@ -3423,6 +3423,7 @@ BOOL WINAPI GetCharWidth32A(HDC,UINT,UINT,LPINT);
BOOL WINAPI GetCharWidth32W(HDC,UINT,UINT,LPINT);
#define GetCharWidth32 WINELIB_NAME_AW(GetCharWidth32)
BOOL WINAPI GetCharWidthA(HDC,UINT,UINT,LPINT);
BOOL WINAPI GetCharWidthI(HDC,UINT,UINT,LPWORD,LPINT);
BOOL WINAPI GetCharWidthW(HDC,UINT,UINT,LPINT);
#define GetCharWidth WINELIB_NAME_AW(GetCharWidth)
BOOL WINAPI GetCharWidthFloatA(HDC,UINT,UINT,PFLOAT);