mirror of
https://github.com/reactos/reactos.git
synced 2024-09-08 19:59:49 +00:00
- Implement GetCharWidthA/W()
- Fix memory overwrite in NtGdiGetCharWidth32() Fixes bug #258 svn path=/trunk/; revision=8845
This commit is contained in:
parent
c718f507e9
commit
75543614da
|
@ -104,7 +104,6 @@ NtGdiGetBrushOrgEx 2
|
||||||
NtGdiGetCharABCWidths 4
|
NtGdiGetCharABCWidths 4
|
||||||
NtGdiGetCharABCWidthsFloat 4
|
NtGdiGetCharABCWidthsFloat 4
|
||||||
NtGdiGetCharacterPlacement 6
|
NtGdiGetCharacterPlacement 6
|
||||||
NtGdiGetCharWidth 4
|
|
||||||
NtGdiGetCharWidth32 4
|
NtGdiGetCharWidth32 4
|
||||||
NtGdiGetCharWidthFloat 4
|
NtGdiGetCharWidthFloat 4
|
||||||
NtGdiGetClipBox 2
|
NtGdiGetClipBox 2
|
||||||
|
|
|
@ -99,13 +99,6 @@ NtGdiGetCharacterPlacement(HDC hDC,
|
||||||
LPGCP_RESULTSW Results,
|
LPGCP_RESULTSW Results,
|
||||||
DWORD Flags);
|
DWORD Flags);
|
||||||
|
|
||||||
BOOL
|
|
||||||
STDCALL
|
|
||||||
NtGdiGetCharWidth(HDC hDC,
|
|
||||||
UINT FirstChar,
|
|
||||||
UINT LastChar,
|
|
||||||
LPINT Buffer);
|
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
STDCALL
|
STDCALL
|
||||||
NtGdiGetCharWidth32(HDC hDC,
|
NtGdiGetCharWidth32(HDC hDC,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: stubsa.c,v 1.28 2004/03/23 00:18:54 gvg Exp $
|
/* $Id: stubsa.c,v 1.29 2004/03/23 07:59:47 gvg Exp $
|
||||||
*
|
*
|
||||||
* reactos/lib/gdi32/misc/stubs.c
|
* reactos/lib/gdi32/misc/stubs.c
|
||||||
*
|
*
|
||||||
|
@ -208,40 +208,6 @@ EnumFontsA (
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
BOOL
|
|
||||||
STDCALL
|
|
||||||
GetCharWidthA (
|
|
||||||
HDC hdc,
|
|
||||||
UINT iFirstChar,
|
|
||||||
UINT iLastChar,
|
|
||||||
LPINT lpBuffer
|
|
||||||
)
|
|
||||||
{
|
|
||||||
/* FIXME what to do with iFirstChar and iLastChar ??? */
|
|
||||||
return NtGdiGetCharWidth ( hdc, iFirstChar, iLastChar, lpBuffer );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
BOOL
|
|
||||||
STDCALL
|
|
||||||
GetCharWidth32A(
|
|
||||||
HDC hdc,
|
|
||||||
UINT iFirstChar,
|
|
||||||
UINT iLastChar,
|
|
||||||
LPINT lpBuffer
|
|
||||||
)
|
|
||||||
{
|
|
||||||
/* FIXME what to do with iFirstChar and iLastChar ??? */
|
|
||||||
return NtGdiGetCharWidth32 ( hdc, iFirstChar, iLastChar, lpBuffer );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: stubsw.c,v 1.25 2004/03/23 00:18:54 gvg Exp $
|
/* $Id: stubsw.c,v 1.26 2004/03/23 07:59:47 gvg Exp $
|
||||||
*
|
*
|
||||||
* reactos/lib/gdi32/misc/stubs.c
|
* reactos/lib/gdi32/misc/stubs.c
|
||||||
*
|
*
|
||||||
|
@ -133,38 +133,6 @@ EnumFontsW(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
BOOL
|
|
||||||
STDCALL
|
|
||||||
GetCharWidthW (
|
|
||||||
HDC hdc,
|
|
||||||
UINT iFirstChar,
|
|
||||||
UINT iLastChar,
|
|
||||||
LPINT lpBuffer
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return NtGdiGetCharWidth ( hdc, iFirstChar, iLastChar, lpBuffer );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
BOOL
|
|
||||||
STDCALL
|
|
||||||
GetCharWidth32W(
|
|
||||||
HDC hdc,
|
|
||||||
UINT iFirstChar,
|
|
||||||
UINT iLastChar,
|
|
||||||
LPINT lpBuffer
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return NtGdiGetCharWidth32 ( hdc, iFirstChar, iLastChar, lpBuffer );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: font.c,v 1.1 2004/03/23 00:18:54 gvg Exp $
|
/* $Id: font.c,v 1.2 2004/03/23 07:59:47 gvg Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
|
@ -15,6 +15,7 @@
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <rosrtl/logfont.h>
|
#include <rosrtl/logfont.h>
|
||||||
#include <win32k/font.h>
|
#include <win32k/font.h>
|
||||||
|
#include <win32k/text.h>
|
||||||
#include <internal/font.h>
|
#include <internal/font.h>
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
|
@ -330,3 +331,69 @@ EnumFontFamiliesA(HDC Dc, LPCSTR Family, FONTENUMPROCA EnumFontFamProc,
|
||||||
|
|
||||||
return IntEnumFontFamilies(Dc, &LogFont, EnumFontFamProc, lParam, FALSE);
|
return IntEnumFontFamilies(Dc, &LogFont, EnumFontFamProc, lParam, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
BOOL
|
||||||
|
STDCALL
|
||||||
|
GetCharWidthA (
|
||||||
|
HDC hdc,
|
||||||
|
UINT iFirstChar,
|
||||||
|
UINT iLastChar,
|
||||||
|
LPINT lpBuffer
|
||||||
|
)
|
||||||
|
{
|
||||||
|
/* FIXME what to do with iFirstChar and iLastChar ??? */
|
||||||
|
return NtGdiGetCharWidth32 ( hdc, iFirstChar, iLastChar, lpBuffer );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
BOOL
|
||||||
|
STDCALL
|
||||||
|
GetCharWidth32A(
|
||||||
|
HDC hdc,
|
||||||
|
UINT iFirstChar,
|
||||||
|
UINT iLastChar,
|
||||||
|
LPINT lpBuffer
|
||||||
|
)
|
||||||
|
{
|
||||||
|
/* FIXME what to do with iFirstChar and iLastChar ??? */
|
||||||
|
return NtGdiGetCharWidth32 ( hdc, iFirstChar, iLastChar, lpBuffer );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
BOOL
|
||||||
|
STDCALL
|
||||||
|
GetCharWidthW (
|
||||||
|
HDC hdc,
|
||||||
|
UINT iFirstChar,
|
||||||
|
UINT iLastChar,
|
||||||
|
LPINT lpBuffer
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return NtGdiGetCharWidth32 ( hdc, iFirstChar, iLastChar, lpBuffer );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
BOOL
|
||||||
|
STDCALL
|
||||||
|
GetCharWidth32W(
|
||||||
|
HDC hdc,
|
||||||
|
UINT iFirstChar,
|
||||||
|
UINT iLastChar,
|
||||||
|
LPINT lpBuffer
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return NtGdiGetCharWidth32 ( hdc, iFirstChar, iLastChar, lpBuffer );
|
||||||
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: text.c,v 1.82 2004/03/23 00:18:54 gvg Exp $ */
|
/* $Id: text.c,v 1.83 2004/03/23 07:59:47 gvg Exp $ */
|
||||||
|
|
||||||
|
|
||||||
#undef WIN32_LEAN_AND_MEAN
|
#undef WIN32_LEAN_AND_MEAN
|
||||||
|
@ -1892,17 +1892,6 @@ NtGdiGetCharacterPlacement(HDC hDC,
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL
|
|
||||||
STDCALL
|
|
||||||
NtGdiGetCharWidth(HDC hDC,
|
|
||||||
UINT FirstChar,
|
|
||||||
UINT LastChar,
|
|
||||||
LPINT Buffer)
|
|
||||||
{
|
|
||||||
DPRINT1("NtGdiGetCharWidth isnt really unimplemented - keep going anyway\n");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
STDCALL
|
STDCALL
|
||||||
NtGdiGetCharWidth32(HDC hDC,
|
NtGdiGetCharWidth32(HDC hDC,
|
||||||
|
@ -1924,7 +1913,7 @@ NtGdiGetCharWidth32(HDC hDC,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BufferSize = (LastChar - FirstChar) * sizeof(INT);
|
BufferSize = (LastChar - FirstChar + 1) * sizeof(INT);
|
||||||
SafeBuffer = ExAllocatePoolWithTag(PagedPool, BufferSize, TAG_GDITEXT);
|
SafeBuffer = ExAllocatePoolWithTag(PagedPool, BufferSize, TAG_GDITEXT);
|
||||||
if (SafeBuffer == NULL)
|
if (SafeBuffer == NULL)
|
||||||
{
|
{
|
||||||
|
@ -1982,7 +1971,7 @@ NtGdiGetCharWidth32(HDC hDC,
|
||||||
{
|
{
|
||||||
glyph_index = FT_Get_Char_Index(face, i);
|
glyph_index = FT_Get_Char_Index(face, i);
|
||||||
FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);
|
FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);
|
||||||
SafeBuffer[i] = face->glyph->advance.x >> 6;
|
SafeBuffer[i - FirstChar] = face->glyph->advance.x >> 6;
|
||||||
}
|
}
|
||||||
IntUnLockFreeType;
|
IntUnLockFreeType;
|
||||||
TEXTOBJ_UnlockText(dc->w.hFont);
|
TEXTOBJ_UnlockText(dc->w.hFont);
|
||||||
|
|
Loading…
Reference in a new issue