mirror of
https://github.com/reactos/reactos.git
synced 2024-09-09 20:30:04 +00:00
- Implementation of [NtGdi]GetTextFace[W] and [NtGdi]GetFontData[W].
- Print a message for unimplemented functions in GDI32.dll. svn path=/trunk/; revision=10058
This commit is contained in:
parent
549b154510
commit
fe2b1d6967
|
@ -123,6 +123,7 @@ NtGdiGetEnhMetaFileDescription 3
|
|||
NtGdiGetEnhMetaFileHeader 3
|
||||
NtGdiGetEnhMetaFilePaletteEntries 3
|
||||
NtGdiGetEnhMetaFilePixelFormat 3
|
||||
NtGdiGetFontData 5
|
||||
NtGdiGetFontFamilyInfo 4
|
||||
NtGdiGetFontLanguageInfo 1
|
||||
#NtGdiGetFontResourceInfo ?
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: font.h,v 1.1 2004/03/23 00:18:54 gvg Exp $
|
||||
/* $Id: font.h,v 1.2 2004/07/09 20:28:19 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
|
@ -22,5 +22,6 @@ typedef struct tagFONTFAMILYINFO
|
|||
|
||||
int STDCALL NtGdiGetFontFamilyInfo(HDC Dc, LPLOGFONTW LogFont, PFONTFAMILYINFO Info, DWORD Size);
|
||||
BOOL STDCALL NtGdiTranslateCharsetInfo(PDWORD Src, LPCHARSETINFO CSI, DWORD Flags);
|
||||
DWORD STDCALL NtGdiGetFontData(HDC,DWORD,DWORD,LPVOID,DWORD);
|
||||
|
||||
#endif /* WIN32K_FONT_H_INCLUDED */
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,4 @@
|
|||
/* $Id: stubsa.c,v 1.31 2004/04/09 20:03:13 navaraf Exp $
|
||||
/* $Id: stubsa.c,v 1.32 2004/07/09 20:28:20 navaraf Exp $
|
||||
*
|
||||
* reactos/lib/gdi32/misc/stubs.c
|
||||
*
|
||||
|
@ -23,6 +23,8 @@
|
|||
#include <rosrtl/logfont.h>
|
||||
#include <internal/heap.h>
|
||||
|
||||
#define UNIMPLEMENTED DbgPrint("GDI32: %s is unimplemented, please try again later.\n", __FUNCTION__);
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
|
@ -172,6 +174,7 @@ DeviceCapabilitiesExA(
|
|||
CONST DEVMODEA *pDevMode
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
@ -189,6 +192,7 @@ EnumFontsA (
|
|||
LPARAM lParam
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
#if 0
|
||||
|
@ -291,6 +295,7 @@ GetOutlineTextMetricsA(
|
|||
LPOUTLINETEXTMETRICA lpOTM
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
@ -344,6 +349,7 @@ GetCharacterPlacementA(
|
|||
DWORD a5
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
@ -404,6 +410,7 @@ StartDocA(
|
|||
CONST DOCINFOA *a1
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
@ -420,6 +427,7 @@ PolyTextOutA(
|
|||
int a2
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -436,6 +444,7 @@ GetTextFaceA(
|
|||
LPSTR a2
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -452,6 +461,7 @@ GetKerningPairsA(
|
|||
LPKERNINGPAIR a2
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
@ -468,6 +478,7 @@ GetLogColorSpaceA(
|
|||
DWORD a2
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -482,6 +493,7 @@ CreateColorSpaceA(
|
|||
LPLOGCOLORSPACEA a0
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
@ -498,6 +510,7 @@ GetICMProfileA(
|
|||
LPSTR a2
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -513,6 +526,7 @@ SetICMProfileA(
|
|||
LPSTR a1
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -539,6 +553,7 @@ EnumICMProfilesA(
|
|||
* until we run out of strings or the user returns FALSE
|
||||
*/
|
||||
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
@ -556,6 +571,7 @@ wglUseFontBitmapsA(
|
|||
DWORD a3
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -577,6 +593,7 @@ wglUseFontOutlinesA(
|
|||
LPGLYPHMETRICSFLOAT a7
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -594,6 +611,7 @@ UpdateICMRegKeyA(
|
|||
UINT a3
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: stubsw.c,v 1.28 2004/04/09 20:03:13 navaraf Exp $
|
||||
/* $Id: stubsw.c,v 1.29 2004/07/09 20:28:20 navaraf Exp $
|
||||
*
|
||||
* reactos/lib/gdi32/misc/stubs.c
|
||||
*
|
||||
|
@ -14,6 +14,8 @@
|
|||
#include <windows.h>
|
||||
#include <win32k/kapi.h>
|
||||
|
||||
#define UNIMPLEMENTED DbgPrint("GDI32: %s is unimplemented, please try again later.\n", __FUNCTION__);
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
|
@ -106,6 +108,7 @@ DeviceCapabilitiesExW(
|
|||
pOutput,
|
||||
pDevMode );
|
||||
#else
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
#endif
|
||||
|
@ -127,6 +130,7 @@ EnumFontsW(
|
|||
#if 0
|
||||
return NtGdiEnumFonts ( hDC, lpFaceName, FontFunc, lParam );
|
||||
#else
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
#endif
|
||||
|
@ -211,6 +215,7 @@ GetOutlineTextMetricsW(
|
|||
LPOUTLINETEXTMETRICW lpOTM
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
@ -250,6 +255,7 @@ GetCharacterPlacementW(
|
|||
DWORD a5
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
@ -307,13 +313,14 @@ PolyTextOutW(
|
|||
int a2
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
* @implemented
|
||||
*/
|
||||
int
|
||||
STDCALL
|
||||
|
@ -323,8 +330,7 @@ GetTextFaceW(
|
|||
LPWSTR a2
|
||||
)
|
||||
{
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
return NtGdiGetTextFace(a0, a1, a2);
|
||||
}
|
||||
|
||||
|
||||
|
@ -339,6 +345,7 @@ GetKerningPairsW(
|
|||
LPKERNINGPAIR a2
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
@ -355,6 +362,7 @@ GetLogColorSpaceW(
|
|||
DWORD a2
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -368,6 +376,7 @@ CreateColorSpaceW(
|
|||
LPLOGCOLORSPACEW a0
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
@ -384,6 +393,7 @@ GetICMProfileW(
|
|||
LPWSTR a2
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -399,6 +409,7 @@ SetICMProfileW(
|
|||
LPWSTR a1
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -424,6 +435,7 @@ EnumICMProfilesW(
|
|||
* and call the user's callback function until we run out of strings or
|
||||
* the user returns FALSE
|
||||
*/
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
@ -441,6 +453,7 @@ wglUseFontBitmapsW(
|
|||
DWORD a3
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -462,6 +475,7 @@ wglUseFontOutlinesW(
|
|||
LPGLYPHMETRICSFLOAT a7
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -479,6 +493,7 @@ UpdateICMRegKeyW(
|
|||
UINT a3
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -502,6 +517,7 @@ GetFontResourceInfoW(
|
|||
DWORD a3
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: font.c,v 1.5 2004/07/03 17:40:22 navaraf Exp $
|
||||
/* $Id: font.c,v 1.6 2004/07/09 20:28:20 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
|
@ -404,3 +404,20 @@ GetCharWidth32W(
|
|||
{
|
||||
return NtGdiGetCharWidth32 ( hdc, iFirstChar, iLastChar, lpBuffer );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
DWORD
|
||||
STDCALL
|
||||
GetFontData(
|
||||
HDC a0,
|
||||
DWORD a1,
|
||||
DWORD a2,
|
||||
LPVOID a3,
|
||||
DWORD a4
|
||||
)
|
||||
{
|
||||
return NtGdiGetFontData(a0, a1, a2, a3, a4);
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: text.c,v 1.102 2004/07/03 17:40:27 navaraf Exp $ */
|
||||
/* $Id: text.c,v 1.103 2004/07/09 20:28:20 navaraf Exp $ */
|
||||
#include <w32k.h>
|
||||
|
||||
#include <ft2build.h>
|
||||
|
@ -2498,13 +2498,31 @@ NtGdiGetTextExtentPoint32(HDC hDC,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
int
|
||||
STDCALL
|
||||
NtGdiGetTextFace(HDC hDC,
|
||||
int Count,
|
||||
LPWSTR FaceName)
|
||||
INT STDCALL
|
||||
NtGdiGetTextFace(HDC hDC, INT Count, LPWSTR FaceName)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
PDC Dc;
|
||||
PTEXTOBJ TextObj;
|
||||
NTSTATUS Status;
|
||||
|
||||
Dc = DC_LockDc(hDC);
|
||||
if (Dc == NULL)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
TextObj = TEXTOBJ_LockText(Dc->w.hFont);
|
||||
DC_UnlockDc(hDC);
|
||||
|
||||
Count = min(Count, wcslen(TextObj->logfont.lfFaceName));
|
||||
Status = MmCopyToCaller(FaceName, TextObj->logfont.lfFaceName, Count * sizeof(WCHAR));
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return Count;
|
||||
}
|
||||
|
||||
BOOL
|
||||
|
@ -2680,6 +2698,63 @@ NtGdiTextOut(
|
|||
return NtGdiExtTextOut(hDC, XStart, YStart, 0, NULL, String, Count, NULL);
|
||||
}
|
||||
|
||||
DWORD STDCALL
|
||||
NtGdiGetFontData(
|
||||
HDC hDC,
|
||||
DWORD Table,
|
||||
DWORD Offset,
|
||||
LPVOID Buffer,
|
||||
DWORD Size)
|
||||
{
|
||||
PDC Dc;
|
||||
HFONT hFont;
|
||||
PTEXTOBJ TextObj;
|
||||
PFONTGDI FontGdi;
|
||||
DWORD Result = GDI_ERROR;
|
||||
NTSTATUS Status;
|
||||
|
||||
Dc = DC_LockDc(hDC);
|
||||
if (Dc == NULL)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return GDI_ERROR;
|
||||
}
|
||||
hFont = Dc->w.hFont;
|
||||
TextObj = TEXTOBJ_LockText(hFont);
|
||||
DC_UnlockDc(hDC);
|
||||
|
||||
if (TextObj == NULL)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return GDI_ERROR;
|
||||
}
|
||||
|
||||
Status = GetFontObjectsFromTextObj(TextObj, NULL, NULL, &FontGdi);
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
IntLockFreeType;
|
||||
|
||||
if (FT_IS_SFNT(FontGdi->face))
|
||||
{
|
||||
if (Table)
|
||||
Table = Table >> 24 | Table << 24 | (Table >> 8 & 0xFF00) |
|
||||
(Table << 8 & 0xFF0000);
|
||||
|
||||
if (Buffer == NULL)
|
||||
Size = 0;
|
||||
|
||||
if (!FT_Load_Sfnt_Table(FontGdi->face, Table, Offset, Buffer, &Size))
|
||||
Result = Size;
|
||||
}
|
||||
|
||||
IntUnLockFreeType;
|
||||
}
|
||||
|
||||
TEXTOBJ_UnlockText(hFont);
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
static UINT FASTCALL
|
||||
GetFontScore(LOGFONTW *LogFont, PUNICODE_STRING FaceName, PFONTGDI FontGDI)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue