diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 4d6f11d5080..ba1da3b11a9 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -4743,38 +4743,9 @@ BOOL WINAPI NtGdiSetTextJustification( HDC hdc, INT extra, INT breaks ) /*********************************************************************** - * GetTextFaceA (GDI32.@) + * NtGdiGetTextFaceW (win32u.@) */ -INT WINAPI GetTextFaceA( HDC hdc, INT count, LPSTR name ) -{ - INT res = GetTextFaceW(hdc, 0, NULL); - LPWSTR nameW = HeapAlloc( GetProcessHeap(), 0, res * 2 ); - GetTextFaceW( hdc, res, nameW ); - - if (name) - { - if (count) - { - res = WideCharToMultiByte(CP_ACP, 0, nameW, -1, name, count, NULL, NULL); - if (res == 0) - res = count; - name[count-1] = 0; - /* GetTextFaceA does NOT include the nul byte in the return count. */ - res--; - } - else - res = 0; - } - else - res = WideCharToMultiByte( CP_ACP, 0, nameW, -1, NULL, 0, NULL, NULL); - HeapFree( GetProcessHeap(), 0, nameW ); - return res; -} - -/*********************************************************************** - * GetTextFaceW (GDI32.@) - */ -INT WINAPI GetTextFaceW( HDC hdc, INT count, LPWSTR name ) +INT WINAPI NtGdiGetTextFaceW( HDC hdc, INT count, WCHAR *name, BOOL alias_name ) { PHYSDEV dev; INT ret; diff --git a/dlls/gdi32/text.c b/dlls/gdi32/text.c index 82bf709fe19..d8cd4fb0dda 100644 --- a/dlls/gdi32/text.c +++ b/dlls/gdi32/text.c @@ -1052,3 +1052,39 @@ DWORD WINAPI GetCharacterPlacementA( HDC hdc, const char *str, INT count, INT ma HeapFree( GetProcessHeap(), 0, resultsW.lpOutString ); return ret; } + +/*********************************************************************** + * GetTextFaceA (GDI32.@) + */ +INT WINAPI GetTextFaceA( HDC hdc, INT count, char *name ) +{ + INT res = GetTextFaceW( hdc, 0, NULL ); + WCHAR *nameW = HeapAlloc( GetProcessHeap(), 0, res * sizeof(WCHAR) ); + + GetTextFaceW( hdc, res, nameW ); + if (name) + { + if (count) + { + res = WideCharToMultiByte( CP_ACP, 0, nameW, -1, name, count, NULL, NULL ); + if (res == 0) res = count; + name[count - 1] = 0; + /* GetTextFaceA does NOT include the nul byte in the return count. */ + res--; + } + else + res = 0; + } + else + res = WideCharToMultiByte( CP_ACP, 0, nameW, -1, NULL, 0, NULL, NULL ); + HeapFree( GetProcessHeap(), 0, nameW ); + return res; +} + +/*********************************************************************** + * GetTextFaceW (GDI32.@) + */ +INT WINAPI GetTextFaceW( HDC hdc, INT count, WCHAR *name ) +{ + return NtGdiGetTextFaceW( hdc, count, name, FALSE ); +} diff --git a/include/ntgdi.h b/include/ntgdi.h index cfcbce43fed..fd552cfa26d 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -238,7 +238,7 @@ DWORD WINAPI NtGdiGetRegionData( HRGN hrgn, DWORD count, RGNDATA *data ); INT WINAPI NtGdiGetRgnBox( HRGN hrgn, RECT *rect ); UINT WINAPI NtGdiGetSystemPaletteUse( HDC hdc ); UINT WINAPI NtGdiGetTextCharsetInfo( HDC hdc, FONTSIGNATURE *fs, DWORD flags ); -INT WINAPI NtGdiGetTextFaceW( HDC hdc, INT count, WCHAR *name ); +INT WINAPI NtGdiGetTextFaceW( HDC hdc, INT count, WCHAR *name, BOOL alias_name ); BOOL WINAPI NtGdiGetTextMetricsW( HDC hdc, TEXTMETRICW *metrics ); BOOL WINAPI NtGdiGetTransform( HDC hdc, DWORD which, XFORM *xform ); BOOL WINAPI NtGdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,