Commit 105caa28 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

gdi32: Implement CreateScalableFontResource.

Based on patches by Jeremy White and Dmitry Timoshkov.
parent 7ac623f3
...@@ -2873,28 +2873,14 @@ BOOL WINAPI CreateScalableFontResourceA( DWORD fHidden, ...@@ -2873,28 +2873,14 @@ BOOL WINAPI CreateScalableFontResourceA( DWORD fHidden,
/*********************************************************************** /***********************************************************************
* CreateScalableFontResourceW (GDI32.@) * CreateScalableFontResourceW (GDI32.@)
*/ */
BOOL WINAPI CreateScalableFontResourceW( DWORD fHidden, BOOL WINAPI CreateScalableFontResourceW( DWORD hidden, LPCWSTR resource_file,
LPCWSTR lpszResourceFile, LPCWSTR font_file, LPCWSTR font_path )
LPCWSTR lpszFontFile, {
LPCWSTR lpszCurrentPath ) TRACE("(%d, %s, %s, %s)\n", hidden, debugstr_w(resource_file),
{ debugstr_w(font_file), debugstr_w(font_path) );
HANDLE f;
FIXME("(%d,%s,%s,%s): stub\n",
fHidden, debugstr_w(lpszResourceFile), debugstr_w(lpszFontFile),
debugstr_w(lpszCurrentPath) );
/* fHidden=1 - only visible for the calling app, read-only, not
* enumerated with EnumFonts/EnumFontFamilies
* lpszCurrentPath can be NULL
*/
/* If the output file already exists, return the ERROR_FILE_EXISTS error as specified in MSDN */ return WineEngCreateScalableFontResource( hidden, resource_file,
if ((f = CreateFileW(lpszResourceFile, 0, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)) != INVALID_HANDLE_VALUE) { font_file, font_path );
CloseHandle(f);
SetLastError(ERROR_FILE_EXISTS);
return FALSE;
}
return FALSE; /* create failed */
} }
/************************************************************************* /*************************************************************************
......
...@@ -289,6 +289,7 @@ typedef struct ...@@ -289,6 +289,7 @@ typedef struct
extern INT WineEngAddFontResourceEx(LPCWSTR, DWORD, PVOID) DECLSPEC_HIDDEN; extern INT WineEngAddFontResourceEx(LPCWSTR, DWORD, PVOID) DECLSPEC_HIDDEN;
extern HANDLE WineEngAddFontMemResourceEx(PVOID, DWORD, PVOID, LPDWORD) DECLSPEC_HIDDEN; extern HANDLE WineEngAddFontMemResourceEx(PVOID, DWORD, PVOID, LPDWORD) DECLSPEC_HIDDEN;
extern BOOL WineEngCreateScalableFontResource(DWORD, LPCWSTR, LPCWSTR, LPCWSTR) DECLSPEC_HIDDEN;
extern BOOL WineEngDestroyFontInstance(HFONT handle) DECLSPEC_HIDDEN; extern BOOL WineEngDestroyFontInstance(HFONT handle) DECLSPEC_HIDDEN;
extern BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph) DECLSPEC_HIDDEN; extern BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph) DECLSPEC_HIDDEN;
extern BOOL WineEngInit(void) DECLSPEC_HIDDEN; extern BOOL WineEngInit(void) DECLSPEC_HIDDEN;
......
...@@ -3989,13 +3989,11 @@ static void test_CreateScalableFontResource(void) ...@@ -3989,13 +3989,11 @@ static void test_CreateScalableFontResource(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = CreateScalableFontResource(0, fot_name, "random file name", tmp_path); ret = CreateScalableFontResource(0, fot_name, "random file name", tmp_path);
ok(!ret, "CreateScalableFontResource() should fail\n"); ok(!ret, "CreateScalableFontResource() should fail\n");
todo_wine
ok(GetLastError() == ERROR_INVALID_PARAMETER, "not expected error %d\n", GetLastError()); ok(GetLastError() == ERROR_INVALID_PARAMETER, "not expected error %d\n", GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = CreateScalableFontResource(0, fot_name, NULL, ttf_name); ret = CreateScalableFontResource(0, fot_name, NULL, ttf_name);
ok(!ret, "CreateScalableFontResource() should fail\n"); ok(!ret, "CreateScalableFontResource() should fail\n");
todo_wine
ok(GetLastError() == ERROR_INVALID_PARAMETER, "not expected error %d\n", GetLastError()); ok(GetLastError() == ERROR_INVALID_PARAMETER, "not expected error %d\n", GetLastError());
ret = DeleteFile(fot_name); ret = DeleteFile(fot_name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment