mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +00:00
[Win32k]
- Create a Gre function for GetKerningPairs. svn path=/trunk/; revision=44541
This commit is contained in:
parent
68a499842a
commit
e3ba837e2e
1 changed files with 62 additions and 0 deletions
|
@ -13,8 +13,69 @@
|
|||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
DWORD FASTCALL GreGetGlyphIndicesW(HDC,LPWSTR,INT,LPWORD,DWORD,DWORD);
|
||||
|
||||
/** Internal ******************************************************************/
|
||||
|
||||
DWORD
|
||||
FASTCALL
|
||||
GreGetKerningPairs(
|
||||
HDC hDC,
|
||||
ULONG NumPairs,
|
||||
LPKERNINGPAIR krnpair)
|
||||
{
|
||||
PDC dc;
|
||||
PDC_ATTR pdcattr;
|
||||
PTEXTOBJ TextObj;
|
||||
PFONTGDI FontGDI;
|
||||
DWORD Count;
|
||||
KERNINGPAIR *pKP;
|
||||
|
||||
dc = DC_LockDc(hDC);
|
||||
if (!dc)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
pdcattr = dc->pdcattr;
|
||||
TextObj = RealizeFontInit(pdcattr->hlfntNew);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
if (!TextObj)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
FontGDI = ObjToGDI(TextObj->Font, FONT);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
|
||||
Count = ftGdiGetKerningPairs(FontGDI,0,NULL);
|
||||
|
||||
if ( Count && krnpair )
|
||||
{
|
||||
if (Count > NumPairs)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INSUFFICIENT_BUFFER);
|
||||
return 0;
|
||||
}
|
||||
pKP = ExAllocatePoolWithTag(PagedPool, Count * sizeof(KERNINGPAIR), TAG_GDITEXT);
|
||||
if (!pKP)
|
||||
{
|
||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return 0;
|
||||
}
|
||||
ftGdiGetKerningPairs(FontGDI,Count,pKP);
|
||||
|
||||
RtlCopyMemory(krnpair, pKP, Count * sizeof(KERNINGPAIR));
|
||||
|
||||
ExFreePoolWithTag(pKP,TAG_GDITEXT);
|
||||
}
|
||||
return Count;
|
||||
}
|
||||
|
||||
|
||||
DWORD
|
||||
FASTCALL
|
||||
GreGetCharacterPlacementW(
|
||||
|
@ -31,6 +92,7 @@ GreGetCharacterPlacementW(
|
|||
{
|
||||
if (GreGetTextExtentW( hdc, pwsz, nCount, &Size, 1))
|
||||
return MAKELONG(Size.cx, Size.cy);
|
||||
return 0;
|
||||
}
|
||||
UNIMPLEMENTED;
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue