Win32/Gdi32:

- Implement NtGdiHfontCreate, removed NtGdiCreateFont and NtGdiCreateFontIndirect from service. Changed name to NtGdiGetOutlineTextMetricsInternalW.
- Updated TEXTOBJ structure changing LOGFONTW to ENUMLOGFONTEXDVW.
- Update FontGetObject plus the rest of text.c in win32k.
- Added CreateFontIndirectExA/W to psdk/wingdi.h, it was missing.
Tested with Qemu.

svn path=/trunk/; revision=26530
This commit is contained in:
James Tabor 2007-04-27 05:42:25 +00:00
parent 9e76cf5867
commit 3b4b572193
8 changed files with 218 additions and 82 deletions

View file

@ -277,9 +277,20 @@ HFONT
STDCALL STDCALL
CreateFontIndirectExA(const ENUMLOGFONTEXDVA *elfexd) CreateFontIndirectExA(const ENUMLOGFONTEXDVA *elfexd)
{ {
UNIMPLEMENTED; if (elfexd)
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); {
return 0; ENUMLOGFONTEXDVW Logfont;
EnumLogFontExW2A( (LPENUMLOGFONTEXA) elfexd,
&Logfont.elfEnumLogfontEx );
RtlCopyMemory( &Logfont.elfDesignVector,
(PVOID) &elfexd->elfDesignVector,
sizeof(DESIGNVECTOR));
return NtGdiHfontCreate( &Logfont, 0, 0, 0, NULL);
}
else return NULL;
} }
/* /*

View file

@ -353,9 +353,11 @@ HFONT
STDCALL STDCALL
CreateFontIndirectExW(const ENUMLOGFONTEXDVW *elfexd) CreateFontIndirectExW(const ENUMLOGFONTEXDVW *elfexd)
{ {
UNIMPLEMENTED; if ( elfexd )
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); {
return 0; return NtGdiHfontCreate((PENUMLOGFONTEXDVW) elfexd, 0, 0, 0, NULL );
}
else return NULL;
} }
/* /*

View file

@ -282,7 +282,7 @@ IntEnumFontFamilies(HDC Dc, LPLOGFONTW LogFont, PVOID EnumProc, LPARAM lParam,
Info[i].FontType, lParam); Info[i].FontType, lParam);
} }
else else
{ { // Could use EnumLogFontExW2A here?
LogFontW2A(&EnumLogFontExA.elfLogFont, &Info[i].EnumLogFontEx.elfLogFont); LogFontW2A(&EnumLogFontExA.elfLogFont, &Info[i].EnumLogFontEx.elfLogFont);
WideCharToMultiByte(CP_THREAD_ACP, 0, Info[i].EnumLogFontEx.elfFullName, -1, WideCharToMultiByte(CP_THREAD_ACP, 0, Info[i].EnumLogFontEx.elfFullName, -1,
(LPSTR)EnumLogFontExA.elfFullName, LF_FULLFACESIZE, NULL, NULL); (LPSTR)EnumLogFontExA.elfFullName, LF_FULLFACESIZE, NULL, NULL);
@ -814,10 +814,9 @@ GetOutlineTextMetricsW(
LPOUTLINETEXTMETRICW lpOTM LPOUTLINETEXTMETRICW lpOTM
) )
{ {
return NtGdiGetOutlineTextMetrics(hdc, cbData, lpOTM); TMDIFF Tmd; // Should not be zero.
// TMDIFF Tmd; // Should not be zero.
// if ( lpOTM == NULL) return 0; return NtGdiGetOutlineTextMetricsInternalW(hdc, cbData, lpOTM, &Tmd);
// return NtGdiGetOutlineTextMetricsInternalW(hdc, cbData, lpOTM, &Tmd);
} }
@ -830,14 +829,14 @@ CreateFontIndirectA(
CONST LOGFONTA *lplf CONST LOGFONTA *lplf
) )
{ {
LOGFONTW tlf;
if (lplf) if (lplf)
{ {
LOGFONTW tlf;
LogFontA2W(&tlf, lplf); LogFontA2W(&tlf, lplf);
return NtGdiCreateFontIndirect(&tlf); return CreateFontIndirectW(&tlf);
} }
else return NtGdiCreateFontIndirect(NULL); else return NULL;
} }
@ -850,7 +849,25 @@ CreateFontIndirectW(
CONST LOGFONTW *lplf CONST LOGFONTW *lplf
) )
{ {
return NtGdiCreateFontIndirect((CONST LPLOGFONTW)lplf); if (lplf)
{
ENUMLOGFONTEXDVW Logfont;
RtlCopyMemory( &Logfont.elfEnumLogfontEx.elfLogFont, lplf, sizeof(LOGFONTW));
// Need something other than just cleaning memory here.
// Guess? Use caller data to determine the rest.
RtlZeroMemory( &Logfont.elfEnumLogfontEx.elfFullName,
sizeof(Logfont.elfEnumLogfontEx.elfFullName));
RtlZeroMemory( &Logfont.elfEnumLogfontEx.elfStyle,
sizeof(Logfont.elfEnumLogfontEx.elfStyle));
RtlZeroMemory( &Logfont.elfEnumLogfontEx.elfScript,
sizeof(Logfont.elfEnumLogfontEx.elfScript));
RtlZeroMemory( &Logfont.elfDesignVector, sizeof(DESIGNVECTOR));
return CreateFontIndirectExW(&Logfont);
}
else return NULL;
} }
@ -883,8 +900,20 @@ CreateFontA(
RtlInitAnsiString(&StringA, (LPSTR)lpszFace); RtlInitAnsiString(&StringA, (LPSTR)lpszFace);
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE); RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
ret = CreateFontW(nHeight, nWidth, nEscapement, nOrientation, fnWeight, fdwItalic, fdwUnderline, fdwStrikeOut, ret = CreateFontW(nHeight,
fdwCharSet, fdwOutputPrecision, fdwClipPrecision, fdwQuality, fdwPitchAndFamily, StringU.Buffer); nWidth,
nEscapement,
nOrientation,
fnWeight,
fdwItalic,
fdwUnderline,
fdwStrikeOut,
fdwCharSet,
fdwOutputPrecision,
fdwClipPrecision,
fdwQuality,
fdwPitchAndFamily,
StringU.Buffer);
RtlFreeUnicodeString(&StringU); RtlFreeUnicodeString(&StringU);
@ -914,8 +943,35 @@ CreateFontW(
LPCWSTR lpszFace LPCWSTR lpszFace
) )
{ {
return NtGdiCreateFont(nHeight, nWidth, nEscapement, nOrientation, nWeight, fnItalic, fdwUnderline, fdwStrikeOut, LOGFONTW logfont;
fdwCharSet, fdwOutputPrecision, fdwClipPrecision, fdwQuality, fdwPitchAndFamily, lpszFace);
logfont.lfHeight = nHeight;
logfont.lfWidth = nWidth;
logfont.lfEscapement = nEscapement;
logfont.lfOrientation = nOrientation;
logfont.lfWeight = nWeight;
logfont.lfItalic = fnItalic;
logfont.lfUnderline = fdwUnderline;
logfont.lfStrikeOut = fdwStrikeOut;
logfont.lfCharSet = fdwCharSet;
logfont.lfOutPrecision = fdwOutputPrecision;
logfont.lfClipPrecision = fdwClipPrecision;
logfont.lfQuality = fdwQuality;
logfont.lfPitchAndFamily = fdwPitchAndFamily;
if (NULL != lpszFace)
{
int Size = sizeof(logfont.lfFaceName) / sizeof(WCHAR);
wcsncpy((wchar_t *)logfont.lfFaceName, lpszFace, Size - 1);
/* Be 101% sure to have '\0' at end of string */
logfont.lfFaceName[Size - 1] = '\0';
}
else
{
logfont.lfFaceName[0] = L'\0';
}
return CreateFontIndirectW(&logfont);
} }

View file

@ -390,13 +390,13 @@ EnumLogFontExW2A( LPENUMLOGFONTEXA fontA, CONST ENUMLOGFONTEXW *fontW )
{ {
LogFontW2A( (LPLOGFONTA)fontA, (CONST LOGFONTW *)fontW ); LogFontW2A( (LPLOGFONTA)fontA, (CONST LOGFONTW *)fontW );
WideCharToMultiByte( CP_ACP, 0, fontW->elfFullName, -1, WideCharToMultiByte( CP_THREAD_ACP, 0, fontW->elfFullName, -1,
(LPSTR) fontA->elfFullName, LF_FULLFACESIZE, NULL, NULL ); (LPSTR) fontA->elfFullName, LF_FULLFACESIZE, NULL, NULL );
fontA->elfFullName[LF_FULLFACESIZE-1] = '\0'; fontA->elfFullName[LF_FULLFACESIZE-1] = '\0';
WideCharToMultiByte( CP_ACP, 0, fontW->elfStyle, -1, WideCharToMultiByte( CP_THREAD_ACP, 0, fontW->elfStyle, -1,
(LPSTR) fontA->elfStyle, LF_FACESIZE, NULL, NULL ); (LPSTR) fontA->elfStyle, LF_FACESIZE, NULL, NULL );
fontA->elfStyle[LF_FACESIZE-1] = '\0'; fontA->elfStyle[LF_FACESIZE-1] = '\0';
WideCharToMultiByte( CP_ACP, 0, fontW->elfScript, -1, WideCharToMultiByte( CP_THREAD_ACP, 0, fontW->elfScript, -1,
(LPSTR) fontA->elfScript, LF_FACESIZE, NULL, NULL ); (LPSTR) fontA->elfScript, LF_FACESIZE, NULL, NULL );
fontA->elfScript[LF_FACESIZE-1] = '\0'; fontA->elfScript[LF_FACESIZE-1] = '\0';
} }

View file

@ -2651,6 +2651,8 @@ HFONT WINAPI CreateFontA(int,int,int,int,int,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD
HFONT WINAPI CreateFontW(int,int,int,int,int,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,LPCWSTR); HFONT WINAPI CreateFontW(int,int,int,int,int,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,LPCWSTR);
HFONT WINAPI CreateFontIndirectA(const LOGFONTA*); HFONT WINAPI CreateFontIndirectA(const LOGFONTA*);
HFONT WINAPI CreateFontIndirectW(const LOGFONTW*); HFONT WINAPI CreateFontIndirectW(const LOGFONTW*);
HFONT WINAPI CreateFontIndirectExA(const ENUMLOGFONTEXDVA *);
HFONT WINAPI CreateFontIndirectExW(const ENUMLOGFONTEXDVW *);
HPALETTE WINAPI CreateHalftonePalette(HDC); HPALETTE WINAPI CreateHalftonePalette(HDC);
HBRUSH WINAPI CreateHatchBrush(int,COLORREF); HBRUSH WINAPI CreateHatchBrush(int,COLORREF);
HDC WINAPI CreateICA(LPCSTR,LPCSTR,LPCSTR,const DEVMODEA*); HDC WINAPI CreateICA(LPCSTR,LPCSTR,LPCSTR,const DEVMODEA*);
@ -2997,6 +2999,7 @@ typedef DISPLAY_DEVICEW DISPLAY_DEVICE, *PDISPLAY_DEVICE, *LPDISPLAY_DEVICE;
#define CreateEnhMetaFile CreateEnhMetaFileW #define CreateEnhMetaFile CreateEnhMetaFileW
#define CreateFont CreateFontW #define CreateFont CreateFontW
#define CreateFontIndirect CreateFontIndirectW #define CreateFontIndirect CreateFontIndirectW
#define CreateFontIndirectEx CreateFontIndirectExW
#define CreateIC CreateICW #define CreateIC CreateICW
#define CreateMetaFile CreateMetaFileW #define CreateMetaFile CreateMetaFileW
#define CreateScalableFontResource CreateScalableFontResourceW #define CreateScalableFontResource CreateScalableFontResourceW
@ -3069,6 +3072,7 @@ typedef DISPLAY_DEVICEA DISPLAY_DEVICE, *PDISPLAY_DEVICE, *LPDISPLAY_DEVICE;
#define CreateEnhMetaFile CreateEnhMetaFileA #define CreateEnhMetaFile CreateEnhMetaFileA
#define CreateFont CreateFontA #define CreateFont CreateFontA
#define CreateFontIndirect CreateFontIndirectA #define CreateFontIndirect CreateFontIndirectA
#define CreateFontIndirectEx CreateFontIndirectExA
#define CreateIC CreateICA #define CreateIC CreateICA
#define CreateMetaFile CreateMetaFileA #define CreateMetaFile CreateMetaFileA
#define CreateScalableFontResource CreateScalableFontResourceA #define CreateScalableFontResource CreateScalableFontResourceA

View file

@ -4,7 +4,7 @@
/* GDI logical font object */ /* GDI logical font object */
typedef struct typedef struct
{ {
LOGFONTW logfont; ENUMLOGFONTEXDVW logfont; //LOGFONTW logfont;
FONTOBJ *Font; FONTOBJ *Font;
BOOLEAN Initialized; /* Don't reinitialize for each DC */ BOOLEAN Initialized; /* Don't reinitialize for each DC */
} TEXTOBJ, *PTEXTOBJ; } TEXTOBJ, *PTEXTOBJ;

View file

@ -499,11 +499,12 @@ TextIntCreateFontIndirect(CONST LPLOGFONTW lf, HFONT *NewFont)
TextObj = TEXTOBJ_LockText(*NewFont); TextObj = TEXTOBJ_LockText(*NewFont);
if (NULL != TextObj) if (NULL != TextObj)
{ {
memcpy(&TextObj->logfont, lf, sizeof(LOGFONTW)); memcpy(&TextObj->logfont.elfEnumLogfontEx.elfLogFont, lf, sizeof(LOGFONTW));
if (lf->lfEscapement != lf->lfOrientation) if (lf->lfEscapement != lf->lfOrientation)
{ {
/* this should really depend on whether GM_ADVANCED is set */ /* this should really depend on whether GM_ADVANCED is set */
TextObj->logfont.lfOrientation = TextObj->logfont.lfEscapement; TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfOrientation =
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfEscapement;
} }
TEXTOBJ_UnlockText(TextObj); TEXTOBJ_UnlockText(TextObj);
} }
@ -601,6 +602,65 @@ NtGdiCreateFontIndirect(CONST LPLOGFONTW lf)
return NT_SUCCESS(Status) ? NewFont : NULL; return NT_SUCCESS(Status) ? NewFont : NULL;
} }
HFONT
STDCALL
NtGdiHfontCreate(
IN PENUMLOGFONTEXDVW pelfw,
IN ULONG cjElfw,
IN LFTYPE lft,
IN FLONG fl,
IN PVOID pvCliData )
{
ENUMLOGFONTEXDVW SafeLogfont;
HFONT NewFont;
PTEXTOBJ TextObj;
NTSTATUS Status = STATUS_SUCCESS;
if (NULL != pelfw)
{
Status = MmCopyFromCaller(&SafeLogfont, pelfw, sizeof(ENUMLOGFONTEXDVW));
if (NT_SUCCESS(Status))
{
NewFont = TEXTOBJ_AllocText();
if (NULL != NewFont)
{
TextObj = TEXTOBJ_LockText(NewFont);
if (NULL != TextObj)
{
RtlCopyMemory ( &TextObj->logfont,
&SafeLogfont,
sizeof(ENUMLOGFONTEXDVW));
if (SafeLogfont.elfEnumLogfontEx.elfLogFont.lfEscapement !=
SafeLogfont.elfEnumLogfontEx.elfLogFont.lfOrientation)
{
/* this should really depend on whether GM_ADVANCED is set */
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfOrientation =
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfEscapement;
}
TEXTOBJ_UnlockText(TextObj);
}
else
{
/* FIXME */
/* ASSERT(FALSE);*/
Status = STATUS_INVALID_HANDLE;
}
}
}
}
else
{
Status = STATUS_INVALID_PARAMETER;
}
return NT_SUCCESS(Status) ? NewFont : NULL;
}
BOOL BOOL
STDCALL STDCALL
NtGdiCreateScalableFontResource(DWORD Hidden, NtGdiCreateScalableFontResource(DWORD Hidden,
@ -1824,17 +1884,17 @@ NtGdiExtTextOut(
Render = IntIsFontRenderingEnabled(); Render = IntIsFontRenderingEnabled();
if (Render) if (Render)
RenderMode = IntGetFontRenderMode(&TextObj->logfont); RenderMode = IntGetFontRenderMode(&TextObj->logfont.elfEnumLogfontEx.elfLogFont);
else else
RenderMode = FT_RENDER_MODE_MONO; RenderMode = FT_RENDER_MODE_MONO;
error = FT_Set_Pixel_Sizes( error = FT_Set_Pixel_Sizes(
face, face,
TextObj->logfont.lfWidth, TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
/* FIXME should set character height if neg */ /* FIXME should set character height if neg */
(TextObj->logfont.lfHeight < 0 ? (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight < 0 ?
- TextObj->logfont.lfHeight : - TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight :
TextObj->logfont.lfHeight == 0 ? 11 : TextObj->logfont.lfHeight)); TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ? 11 : TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight));
if (error) if (error)
{ {
DPRINT1("Error in setting pixel sizes: %u\n", error); DPRINT1("Error in setting pixel sizes: %u\n", error);
@ -1884,7 +1944,8 @@ NtGdiExtTextOut(
for (i = Start; i < Count; i++) for (i = Start; i < Count; i++)
{ {
glyph_index = FT_Get_Char_Index(face, *TempText); glyph_index = FT_Get_Char_Index(face, *TempText);
if (!(realglyph = NtGdiGlyphCacheGet(face, glyph_index, TextObj->logfont.lfHeight))) if (!(realglyph = NtGdiGlyphCacheGet(face, glyph_index,
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)))
{ {
error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT); error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);
if (error) if (error)
@ -1893,7 +1954,8 @@ NtGdiExtTextOut(
} }
glyph = face->glyph; glyph = face->glyph;
realglyph = NtGdiGlyphCacheSet(face, glyph_index, TextObj->logfont.lfHeight, glyph, RenderMode); realglyph = NtGdiGlyphCacheSet(face, glyph_index,
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight, glyph, RenderMode);
} }
/* retrieve kerning distance */ /* retrieve kerning distance */
if (use_kerning && previous && glyph_index) if (use_kerning && previous && glyph_index)
@ -1932,7 +1994,8 @@ NtGdiExtTextOut(
for (i = 0; i < Count; i++) for (i = 0; i < Count; i++)
{ {
glyph_index = FT_Get_Char_Index(face, *String); glyph_index = FT_Get_Char_Index(face, *String);
if (!(realglyph = NtGdiGlyphCacheGet(face, glyph_index, TextObj->logfont.lfHeight))) if (!(realglyph = NtGdiGlyphCacheGet(face, glyph_index,
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)))
{ {
error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT); error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);
@ -1943,7 +2006,8 @@ NtGdiExtTextOut(
goto fail; goto fail;
} }
glyph = face->glyph; glyph = face->glyph;
realglyph = NtGdiGlyphCacheSet(face, glyph_index, TextObj->logfont.lfHeight, glyph, RenderMode); realglyph = NtGdiGlyphCacheSet(face, glyph_index,
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight, glyph, RenderMode);
} }
// DbgPrint("realglyph: %x\n", realglyph); // DbgPrint("realglyph: %x\n", realglyph);
// DbgPrint("TextLeft: %d\n", TextLeft); // DbgPrint("TextLeft: %d\n", TextLeft);
@ -2238,10 +2302,10 @@ NtGdiGetCharABCWidths(HDC hDC,
IntLockFreeType; IntLockFreeType;
FT_Set_Pixel_Sizes(face, FT_Set_Pixel_Sizes(face,
TextObj->logfont.lfWidth, TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
/* FIXME should set character height if neg */ /* FIXME should set character height if neg */
(TextObj->logfont.lfHeight < 0 ? - TextObj->logfont.lfHeight : (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight < 0 ? - TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight :
TextObj->logfont.lfHeight == 0 ? 11 : TextObj->logfont.lfHeight)); TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ? 11 : TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight));
for (i = FirstChar; i <= LastChar; i++) for (i = FirstChar; i <= LastChar; i++)
{ {
@ -2382,11 +2446,11 @@ NtGdiGetCharWidth32(HDC hDC,
IntLockFreeType; IntLockFreeType;
FT_Set_Pixel_Sizes(face, FT_Set_Pixel_Sizes(face,
TextObj->logfont.lfWidth, TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
/* FIXME should set character height if neg */ /* FIXME should set character height if neg */
(TextObj->logfont.lfHeight < 0 ? (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight < 0 ?
- TextObj->logfont.lfHeight : - TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight :
TextObj->logfont.lfHeight == 0 ? 11 : TextObj->logfont.lfHeight)); TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ? 11 : TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight));
for (i = FirstChar; i <= LastChar; i++) for (i = FirstChar; i <= LastChar; i++)
{ {
@ -2516,8 +2580,8 @@ NtGdiGetGlyphOutline(
FontGDI = ObjToGDI(TextObj->Font, FONT); FontGDI = ObjToGDI(TextObj->Font, FONT);
ft_face = FontGDI->face; ft_face = FontGDI->face;
aveWidth = FT_IS_SCALABLE(ft_face) ? TextObj->logfont.lfWidth: 0; aveWidth = FT_IS_SCALABLE(ft_face) ? TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth: 0;
orientation = FT_IS_SCALABLE(ft_face) ? TextObj->logfont.lfOrientation: 0; orientation = FT_IS_SCALABLE(ft_face) ? TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfOrientation: 0;
Size = IntGetOutlineTextMetrics(FontGDI, 0, NULL); Size = IntGetOutlineTextMetrics(FontGDI, 0, NULL);
potm = ExAllocatePoolWithTag(PagedPool, Size, TAG_GDITEXT); potm = ExAllocatePoolWithTag(PagedPool, Size, TAG_GDITEXT);
@ -2561,10 +2625,10 @@ NtGdiGetGlyphOutline(
} }
// FT_Set_Pixel_Sizes(ft_face, // FT_Set_Pixel_Sizes(ft_face,
// TextObj->logfont.lfWidth, // TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
/* FIXME should set character height if neg */ /* FIXME should set character height if neg */
// (TextObj->logfont.lfHeight < 0 ? - TextObj->logfont.lfHeight : // (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight < 0 ? - TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight :
// TextObj->logfont.lfHeight == 0 ? 11 : TextObj->logfont.lfHeight)); // TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ? 11 : TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight));
TEXTOBJ_UnlockText(TextObj); TEXTOBJ_UnlockText(TextObj);
@ -3107,11 +3171,12 @@ NtGdiGetKerningPairs(HDC hDC,
From "Undocumented Windows 2000 Secrets" Appendix B, Table B-2, page From "Undocumented Windows 2000 Secrets" Appendix B, Table B-2, page
472, this is NtGdiGetOutlineTextMetricsInternalW. 472, this is NtGdiGetOutlineTextMetricsInternalW.
*/ */
UINT ULONG
STDCALL STDCALL
NtGdiGetOutlineTextMetrics(HDC hDC, NtGdiGetOutlineTextMetricsInternalW (HDC hDC,
UINT Data, ULONG Data,
LPOUTLINETEXTMETRICW otm) OUTLINETEXTMETRICW *otm,
TMDIFF *Tmd)
{ {
PDC dc; PDC dc;
PTEXTOBJ TextObj; PTEXTOBJ TextObj;
@ -3343,11 +3408,11 @@ TextIntGetTextExtentPoint(PDC dc,
IntLockFreeType; IntLockFreeType;
error = FT_Set_Pixel_Sizes(face, error = FT_Set_Pixel_Sizes(face,
TextObj->logfont.lfWidth, TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
/* FIXME should set character height if neg */ /* FIXME should set character height if neg */
(TextObj->logfont.lfHeight < 0 ? (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight < 0 ?
- TextObj->logfont.lfHeight : - TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight :
TextObj->logfont.lfHeight == 0 ? 11 : TextObj->logfont.lfHeight)); TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ? 11 : TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight));
IntUnLockFreeType; IntUnLockFreeType;
if (error) if (error)
{ {
@ -3395,7 +3460,7 @@ TextIntGetTextExtentPoint(PDC dc,
} }
Size->cx = (TotalWidth + 32) >> 6; Size->cx = (TotalWidth + 32) >> 6;
Size->cy = (TextObj->logfont.lfHeight < 0 ? - TextObj->logfont.lfHeight : TextObj->logfont.lfHeight); Size->cy = (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight < 0 ? - TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight : TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight);
Size->cy = EngMulDiv(Size->cy, IntGdiGetDeviceCaps(dc, LOGPIXELSY), 72); Size->cy = EngMulDiv(Size->cy, IntGdiGetDeviceCaps(dc, LOGPIXELSY), 72);
return TRUE; return TRUE;
@ -3657,8 +3722,8 @@ NtGdiGetTextFace(HDC hDC, INT Count, LPWSTR FaceName)
TextObj = TEXTOBJ_LockText(hFont); TextObj = TEXTOBJ_LockText(hFont);
ASSERT(TextObj != NULL); ASSERT(TextObj != NULL);
Count = min(Count, wcslen(TextObj->logfont.lfFaceName)); Count = min(Count, wcslen(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfFaceName));
Status = MmCopyToCaller(FaceName, TextObj->logfont.lfFaceName, Count * sizeof(WCHAR)); Status = MmCopyToCaller(FaceName, TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfFaceName, Count * sizeof(WCHAR));
TEXTOBJ_UnlockText(TextObj); TEXTOBJ_UnlockText(TextObj);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
@ -3704,11 +3769,11 @@ NtGdiGetTextMetrics(HDC hDC,
Face = FontGDI->face; Face = FontGDI->face;
IntLockFreeType; IntLockFreeType;
Error = FT_Set_Pixel_Sizes(Face, Error = FT_Set_Pixel_Sizes(Face,
TextObj->logfont.lfWidth, TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
/* FIXME should set character height if neg */ /* FIXME should set character height if neg */
(TextObj->logfont.lfHeight < 0 ? (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight < 0 ?
- TextObj->logfont.lfHeight : - TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight :
TextObj->logfont.lfHeight == 0 ? 11 : TextObj->logfont.lfHeight)); TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ? 11 : TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight));
IntUnLockFreeType; IntUnLockFreeType;
if (0 != Error) if (0 != Error)
{ {
@ -4059,7 +4124,7 @@ TextIntRealizeFont(HFONT FontHandle)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
if (! RtlCreateUnicodeString(&FaceName, TextObj->logfont.lfFaceName)) if (! RtlCreateUnicodeString(&FaceName, TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfFaceName))
{ {
TEXTOBJ_UnlockText(TextObj); TEXTOBJ_UnlockText(TextObj);
return STATUS_NO_MEMORY; return STATUS_NO_MEMORY;
@ -4072,21 +4137,21 @@ TextIntRealizeFont(HFONT FontHandle)
Win32Process = PsGetCurrentProcessWin32Process(); Win32Process = PsGetCurrentProcessWin32Process();
IntLockProcessPrivateFonts(Win32Process); IntLockProcessPrivateFonts(Win32Process);
FindBestFontFromList(&TextObj->Font, &MatchScore, FindBestFontFromList(&TextObj->Font, &MatchScore,
&TextObj->logfont, &FaceName, &TextObj->logfont.elfEnumLogfontEx.elfLogFont, &FaceName,
&Win32Process->PrivateFontListHead); &Win32Process->PrivateFontListHead);
IntUnLockProcessPrivateFonts(Win32Process); IntUnLockProcessPrivateFonts(Win32Process);
/* Search system fonts */ /* Search system fonts */
IntLockGlobalFonts; IntLockGlobalFonts;
FindBestFontFromList(&TextObj->Font, &MatchScore, FindBestFontFromList(&TextObj->Font, &MatchScore,
&TextObj->logfont, &FaceName, &TextObj->logfont.elfEnumLogfontEx.elfLogFont, &FaceName,
&FontListHead); &FontListHead);
IntUnLockGlobalFonts; IntUnLockGlobalFonts;
if (NULL == TextObj->Font) if (NULL == TextObj->Font)
{ {
DPRINT1("Requested font %S not found, no fonts loaded at all\n", DPRINT1("Requested font %S not found, no fonts loaded at all\n",
TextObj->logfont.lfFaceName); TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfFaceName);
Status = STATUS_NOT_FOUND; Status = STATUS_NOT_FOUND;
} }
else else
@ -4104,36 +4169,35 @@ TextIntRealizeFont(HFONT FontHandle)
} }
INT FASTCALL INT FASTCALL
FontGetObject(PTEXTOBJ Font, INT Count, PVOID Buffer) FontGetObject(PTEXTOBJ TFont, INT Count, PVOID Buffer)
{ {
if( Buffer == NULL ) return sizeof(LOGFONTW); if( Buffer == NULL ) return sizeof(LOGFONTW);
switch (Count) switch (Count)
{ {
/* Everything will need to be converted over to ENUMLOGFONTEXDVW.
case sizeof(ENUMLOGFONTEXDVW): case sizeof(ENUMLOGFONTEXDVW):
RtlCopyMemory( (LPENUMLOGFONTEXDVW) Buffer.elfDesignVector, RtlCopyMemory( (LPENUMLOGFONTEXDVW) Buffer,
&Font->logFont.elfDesignVector, &TFont->logfont,
sizeof(DESIGNVECTOR)); sizeof(ENUMLOGFONTEXDVW));
break;
case sizeof(ENUMLOGFONTEXW): case sizeof(ENUMLOGFONTEXW):
RtlCopyMemory( (LPENUMLOGFONTEXW) Buffer, RtlCopyMemory( (LPENUMLOGFONTEXW) Buffer,
&Font->logFont.elfEnumLogfontEx, &TFont->logfont.elfEnumLogfontEx,
sizeof(ENUMLOGFONTEXW)); sizeof(ENUMLOGFONTEXW));
break; break;
case sizeof(EXTLOGFONTW): case sizeof(EXTLOGFONTW):
case sizeof(ENUMLOGFONTW): case sizeof(ENUMLOGFONTW):
RtlCopyMemory((LPENUMLOGFONTW) Buffer, RtlCopyMemory((LPENUMLOGFONTW) Buffer,
(LPENUMLOGFONTW) &Font->logfont.elfEnumLogfontEx.elfLogFont, &TFont->logfont.elfEnumLogfontEx.elfLogFont,
sizeof(ENUMLOGFONTW)); sizeof(ENUMLOGFONTW));
break; break;
*/
case sizeof(LOGFONTW): case sizeof(LOGFONTW):
/* RtlCopyMemory((LPLOGFONTW) Buffer, RtlCopyMemory((LPLOGFONTW) Buffer,
&Font->logFont.elfEnumLogfontEx.elfLogFont, &TFont->logfont.elfEnumLogfontEx.elfLogFont,
sizeof(LOGFONTW)); sizeof(LOGFONTW));
*/
RtlCopyMemory(Buffer, &Font->logfont, sizeof(LOGFONTW));
break; break;
default: default:

View file

@ -33,8 +33,6 @@ NtGdiCreateDiscardableBitmap 3
NtGdiCreateEllipticRgn 4 NtGdiCreateEllipticRgn 4
NtGdiCreateEllipticRgnIndirect 1 NtGdiCreateEllipticRgnIndirect 1
NtGdiCreateEnhMetaFile 4 NtGdiCreateEnhMetaFile 4
NtGdiCreateFont 14
NtGdiCreateFontIndirect 1
NtGdiCreateHalftonePalette 1 NtGdiCreateHalftonePalette 1
NtGdiCreateHatchBrushInternal 3 NtGdiCreateHatchBrushInternal 3
NtGdiCreateIC 4 NtGdiCreateIC 4
@ -138,7 +136,7 @@ NtGdiGetMetaRgn 2
NtGdiGetMiterLimit 2 NtGdiGetMiterLimit 2
NtGdiGetNearestColor 2 NtGdiGetNearestColor 2
NtGdiGetNearestPaletteIndex 2 NtGdiGetNearestPaletteIndex 2
NtGdiGetOutlineTextMetrics 3 NtGdiGetOutlineTextMetricsInternalW 4
NtGdiGetPaletteEntries 4 NtGdiGetPaletteEntries 4
NtGdiGetPath 4 NtGdiGetPath 4
NtGdiGetPixel 3 NtGdiGetPixel 3
@ -171,6 +169,7 @@ NtGdiGetWindowExtEx 2
NtGdiGetWindowOrgEx 2 NtGdiGetWindowOrgEx 2
NtGdiGetWorldTransform 2 NtGdiGetWorldTransform 2
NtGdiGradientFill 6 NtGdiGradientFill 6
NtGdiHfontCreate 5
NtGdiIntersectClipRect 5 NtGdiIntersectClipRect 5
NtGdiInvertRgn 2 NtGdiInvertRgn 2
NtGdiLPtoDP 3 NtGdiLPtoDP 3