Commit e7f6d779 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

gdiplus: Implement GdipPrivateAddFontFile.

parent 6278f5ff
......@@ -1127,15 +1127,39 @@ GpStatus WINGDIPAPI GdipDeletePrivateFontCollection(GpFontCollection **fontColle
/*****************************************************************************
* GdipPrivateAddFontFile [GDIPLUS.@]
*/
GpStatus WINGDIPAPI GdipPrivateAddFontFile(GpFontCollection* fontCollection,
GDIPCONST WCHAR* filename)
GpStatus WINGDIPAPI GdipPrivateAddFontFile(GpFontCollection *collection, GDIPCONST WCHAR *name)
{
FIXME("stub: %p, %s\n", fontCollection, debugstr_w(filename));
HANDLE file, mapping;
LARGE_INTEGER size;
void *mem;
GpStatus status;
TRACE("%p, %s\n", collection, debugstr_w(name));
if (!collection || !name) return InvalidParameter;
if (!(fontCollection && filename))
file = CreateFileW(name, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
if (file == INVALID_HANDLE_VALUE) return InvalidParameter;
if (!GetFileSizeEx(file, &size) || size.u.HighPart)
{
CloseHandle(file);
return InvalidParameter;
}
mapping = CreateFileMappingW(file, NULL, PAGE_READONLY, 0, 0, NULL);
CloseHandle(file);
if (!mapping) return InvalidParameter;
mem = MapViewOfFile(mapping, FILE_MAP_READ, 0, 0, 0);
CloseHandle(mapping);
if (!mem) return InvalidParameter;
/* GdipPrivateAddMemoryFont creates a copy of the memory block */
status = GdipPrivateAddMemoryFont(collection, mem, size.u.LowPart);
UnmapViewOfFile(mem);
return NotImplemented;
return status;
}
#define TT_PLATFORM_APPLE_UNICODE 0
......
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