28#define expect(expected,got) expect_inline(__LINE__, expected, got)
34#define expect_(expected, got, precision) ok(abs((expected) - (got)) <= (precision), "Expected %d, got %ld\n", (expected), (got))
35#define expectf_(expected, got, precision) ok(fabs((expected) - (got)) <= (precision), "Expected %f, got %f\n", (expected), (got))
36#define expectf(expected, got) expectf_((expected), (got), 0.001)
46#define load_resource(a, b, c) _load_resource(__LINE__, a, b, c)
71 ok(written ==
length,
"couldn't write resource\n");
75#define DELETE_FONTFILE(filename) _delete_testfontfile(filename, __LINE__)
94 ok(
stat ==
Ok,
"GdipNewPrivateFontCollection failed: %d\n",
stat);
102 ok(
stat ==
Ok,
"GdipPrivateAddFontFile failed with open file handle: %d\n",
stat);
109 ok(
stat ==
Ok,
"GdipPrivateAddFontFile failed: %d\n",
stat);
113 ok(
stat ==
Ok,
"GdipGetFontCollectionFamilyCount failed: %d\n",
stat);
115 ok(num_families == 1,
"expected num_families to be 1, got %d\n", num_families);
118 ok(
stat ==
Ok,
"GdipGetFontCollectionFamilyList failed: %d\n",
stat);
127 ok(
stat ==
Ok,
"GdipCloneFontFamily failed: %d\n",
stat);
128 ok(family == cloned_family,
"GdipCloneFontFamily returned new object\n");
136 ok(
stat ==
Ok,
"GdipDeletePrivateFontCollection failed: %d\n",
stat);
143 ok(
stat ==
Ok,
"GdipDeleteFontFamily failed: %d\n",
stat);
174 ok (fontfamily == fontfamily2,
"Unexpected family instance.\n");
175 ok (
lstrcmpiW(
L"Tahoma", familyname) == 0,
"Expected Tahoma, got %s\n",
182 ok (
size == 12,
"Expected 12, got %f\n",
size);
192 ok (
size == 24,
"Expected 24, got %f (with unit: %d)\n",
size,
i);
194 ok (
stat ==
Ok,
"Failed to get font unit, %d.\n",
stat);
212 static const struct {
282 UINT16 em_height, line_spacing;
297 ok(lfa2.
lfHeight < 0,
"Expected negative height\n");
328 ok(lfa2.
lfHeight < 0,
"Expected negative height\n");
346 "Expected , got %d\n",
style);
366 expect(2472, line_spacing);
371 memset(&lfa, 0,
sizeof(lfa));
376 memset(&lfa2, 0xff,
sizeof(lfa2));
399 expect(2472, line_spacing);
408 memset(&lfa, 0,
sizeof(lfa));
414 memset(&lfa2, 0,
sizeof(lfa2));
423 skip(
"Times New Roman not installed\n");
431 }
test_sizes[] = {{12, 9.0}, {36, 32.0}, {48, 42.0}, {72, 63.0}, {144, 127.0}};
435 memset(&lfa, 0,
sizeof(lfa));
489 win_skip(
"Skipping test that crashes on Windows 2003 / Vista\n");
505 ok (family == clonedFontFamily,
"Unexpected family instance.\n");
542 skip(
"Times New Roman not installed\n");
591 int missingfonts = 0;
615 trace(
"You may need to install either the Microsoft Web Fonts or the Liberation Fonts\n");
618 ok(
lstrcmpiW(sansname, serifname) != 0,
"Sans Serif and Serif families should be different: %s\n",
wine_dbgstr_w(sansname));
619 ok(
lstrcmpiW(sansname, mononame) != 0,
"Sans Serif and Monospace families should be different: %s\n",
wine_dbgstr_w(sansname));
620 ok(
lstrcmpiW(serifname, mononame) != 0,
"Serif and Monospace families should be different: %s\n",
wine_dbgstr_w(serifname));
761 ok(
ret,
"GetOutlineTextMetrics failed\n");
842 memset(&lf, 0,
sizeof(lf));
856 trace(
"%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
863 trace(
"%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
875 trace(
"%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
897 trace(
"%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
904 trace(
"%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
916 trace(
"%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
935 trace(
"%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
945 trace(
"%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
981 memset(&lf, 0,
sizeof(lf));
986 memset(&lf, 0xfe,
sizeof(lf));
998 memset(&lf, 0xfe,
sizeof(lf));
1015 trace(
"fallback font %s\n", fallback_font);
1021 memset(&lf, 0xfe,
sizeof(lf));
1031 memset(&lf, 0xfe,
sizeof(lf));
1045 "expected NotTrueTypeFont, got %d\n",
status);
1055 "expected NotTrueTypeFont, got %d\n",
status);
1065 static const WCHAR string[] =
L"A";
1089 memset(&lf, 0,
sizeof(lf));
1096 margin_y = 100.0 / 8.0;
1367 ok(
count > 0,
"Unexpected empty collection.\n");
1375 ok(found == 123,
"Unexpected list count %d.\n", found);
1383 ok(found == 123,
"Unexpected list count %d.\n", found);
1388 ok(found == 123,
"Unexpected list count %d.\n", found);
1394 ok(found == 1,
"Unexpected list count %d.\n", found);
1395 ok(family !=
NULL,
"Expected family instance.\n");
1401 ok(found == 1,
"Unexpected list count %d.\n", found);
1402 ok(family2 == family,
"Unexpected family instance.\n");
1414 ok(found ==
count,
"Unexpected list count %d, extected %d.\n", found,
count);
1416 for (
i = 0;
i < found;
i++)
1436 ok(
count == 123,
"Unexpected family count %d.\n",
count);
1461 if (
list[
i] == family)
1489 ok(
collection == collection2,
"got %p\n", collection2);
1501 ok(
ret,
"family is not in collection\n");
1520 ok(family == family2,
"got %p\n", family2);
1539 ok(family == family2,
"got %p\n", family2);
1548 static const WORD resource_ids[] =
1564 ok(
stat ==
Ok,
"GdipNewPrivateFontCollection failed, error %d\n",
stat);
1571 ok(
stat ==
Ok,
"GdipGetFontCollectionFamilyCount failed, error %d\n",
stat);
1575 win_skip(
"Fonts without Microsoft platform names are unsupported on win7.\n");
1577 ok(0,
"GdipPrivateAddMemoryFont failed, error %d\n",
stat);
1580 ok(
stat ==
Ok,
"GdipDeletePrivateFontCollection failed, error %d\n",
stat);
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
GpStatus WINGDIPAPI GdipGetFontSize(GpFont *font, REAL *size)
GpStatus WINGDIPAPI GdipGetFontHeight(GDIPCONST GpFont *font, GDIPCONST GpGraphics *graphics, REAL *height)
GpStatus WINGDIPAPI GdipCloneFontFamily(GpFontFamily *family, GpFontFamily **clone)
GpStatus WINGDIPAPI GdipDeleteFontFamily(GpFontFamily *FontFamily)
GpStatus WINGDIPAPI GdipGetFamily(GpFont *font, GpFontFamily **family)
GpStatus WINGDIPAPI GdipDeleteFont(GpFont *font)
GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC hdc, GDIPCONST LOGFONTW *logfont, GpFont **font)
GpStatus WINGDIPAPI GdipCreateFontFromLogfontA(HDC hdc, GDIPCONST LOGFONTA *lfa, GpFont **font)
GpStatus WINGDIPAPI GdipGetLogFontA(GpFont *font, GpGraphics *graphics, LOGFONTA *lfa)
GpStatus WINGDIPAPI GdipGetGenericFontFamilySerif(GpFontFamily **nativeFamily)
GpStatus WINGDIPAPI GdipGetCellDescent(GDIPCONST GpFontFamily *family, INT style, UINT16 *CellDescent)
GpStatus WINGDIPAPI GdipNewInstalledFontCollection(GpFontCollection **fontCollection)
GpStatus WINGDIPAPI GdipGetFontStyle(GpFont *font, INT *style)
GpStatus WINGDIPAPI GdipGetFontCollectionFamilyCount(GpFontCollection *fontCollection, INT *numFound)
GpStatus WINGDIPAPI GdipPrivateAddMemoryFont(GpFontCollection *fontCollection, GDIPCONST void *memory, INT length)
GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics, LOGFONTW *lf)
GpStatus WINGDIPAPI GdipGetGenericFontFamilySansSerif(GpFontFamily **nativeFamily)
GpStatus WINGDIPAPI GdipCreateFont(GDIPCONST GpFontFamily *fontFamily, REAL emSize, INT style, Unit unit, GpFont **font)
GpStatus WINGDIPAPI GdipGetCellAscent(GDIPCONST GpFontFamily *family, INT style, UINT16 *CellAscent)
GpStatus WINGDIPAPI GdipGetFontHeightGivenDPI(GDIPCONST GpFont *font, REAL dpi, REAL *height)
GpStatus WINGDIPAPI GdipGetFontCollectionFamilyList(GpFontCollection *fontCollection, INT numSought, GpFontFamily *gpfamilies[], INT *numFound)
GpStatus WINGDIPAPI GdipGetFontUnit(GpFont *font, Unit *unit)
GpStatus WINGDIPAPI GdipGetLineSpacing(GDIPCONST GpFontFamily *family, INT style, UINT16 *LineSpacing)
GpStatus WINGDIPAPI GdipDeletePrivateFontCollection(GpFontCollection **fontCollection)
GpStatus WINGDIPAPI GdipGetGenericFontFamilyMonospace(GpFontFamily **nativeFamily)
GpStatus WINGDIPAPI GdipGetFamilyName(GDIPCONST GpFontFamily *family, WCHAR *name, LANGID language)
GpStatus WINGDIPAPI GdipGetEmHeight(GDIPCONST GpFontFamily *family, INT style, UINT16 *EmHeight)
GpStatus WINGDIPAPI GdipCloneFont(GpFont *font, GpFont **cloneFont)
GpStatus WINGDIPAPI GdipPrivateAddFontFile(GpFontCollection *collection, GDIPCONST WCHAR *name)
GpStatus WINGDIPAPI GdipCreateFontFamilyFromName(GDIPCONST WCHAR *name, GpFontCollection *collection, GpFontFamily **family)
GpStatus WINGDIPAPI GdipNewPrivateFontCollection(GpFontCollection **fontCollection)
GpStatus WINGDIPAPI GdipCreateFromHDC(HDC hdc, GpGraphics **graphics)
GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics)
GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, RectF *bounds, INT *codepointsfitted, INT *linesfilled)
GpStatus WINGDIPAPI GdipSetWorldTransform(GpGraphics *graphics, GpMatrix *matrix)
GpStatus WINGDIPAPI GdipMeasureDriverString(GpGraphics *graphics, GDIPCONST UINT16 *text, INT length, GDIPCONST GpFont *font, GDIPCONST PointF *positions, INT flags, GDIPCONST GpMatrix *matrix, RectF *boundingBox)
GpStatus WINGDIPAPI GdipSetPageUnit(GpGraphics *graphics, GpUnit unit)
GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix *matrix, REAL scaleX, REAL scaleY, GpMatrixOrder order)
GpStatus WINGDIPAPI GdipShearMatrix(GpMatrix *matrix, REAL shearX, REAL shearY, GpMatrixOrder order)
GpStatus WINGDIPAPI GdipTranslateMatrix(GpMatrix *matrix, REAL offsetX, REAL offsetY, GpMatrixOrder order)
GpStatus WINGDIPAPI GdipRotateMatrix(GpMatrix *matrix, REAL angle, GpMatrixOrder order)
GpStatus WINGDIPAPI GdipDeleteMatrix(GpMatrix *matrix)
GpStatus WINGDIPAPI GdipCreateMatrix(GpMatrix **matrix)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI WriteFile(_In_ HANDLE hFile, _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer, _In_ DWORD nNumberOfBytesToWrite, _Out_opt_ LPDWORD lpNumberOfBytesWritten, _Inout_opt_ LPOVERLAPPED lpOverlapped)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
LPVOID WINAPI LockResource(HGLOBAL handle)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
_ACRTIMP errno_t __cdecl _controlfp_s(unsigned int *, unsigned int, unsigned int)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
void WINGDIPAPI GdipFree(void *ptr)
Status WINAPI GdiplusStartup(ULONG_PTR *token, const struct GdiplusStartupInput *input, struct GdiplusStartupOutput *output)
void *WINGDIPAPI GdipAlloc(SIZE_T size)
@ DriverStringOptionsCmapLookup
void WINAPI GdiplusShutdown(ULONG_PTR)
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei height
GLuint GLsizei GLsizei * length
GLenum GLenum GLenum input
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
int WINAPI lstrlenA(LPCSTR lpString)
const char * winetest_platform
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
static void test_logfont(void)
#define expect(expected, got)
static INT CALLBACK font_enum_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
static void _load_resource(int line, const WCHAR *filename, BYTE **data, DWORD *size)
static void cmp_font_metrics(struct font_metrics *fm1, struct font_metrics *fm2, int line)
static void gdip_get_font_metrics(GpFont *font, struct font_metrics *fm)
#define expectf_(expected, got, precision)
static void test_font_substitution(void)
static void test_font_metrics(void)
static void _delete_testfontfile(const WCHAR *filename, int line)
static void test_GdipPrivateAddMemoryFont(void)
static void test_CloneFont(void)
static void gdi_get_font_metrics(LOGFONTW *lf, struct font_metrics *fm)
static void test_fontfamily(void)
#define DELETE_FONTFILE(filename)
static void expect_inline(unsigned line, DWORD expected, DWORD got)
static BOOL is_family_in_collection(GpFontCollection *collection, GpFontFamily *family)
static void test_long_name(void)
static void test_GdipGetFontCollectionFamilyList(void)
static void test_GdipGetFontCollectionFamilyCount(void)
#define load_resource(a, b, c)
static void set_rect_empty(RectF *rc)
static void test_font_transform(void)
static void test_fontfamily_properties(void)
static void create_testfontfile(const WCHAR *filename, int resource, WCHAR pathW[MAX_PATH])
#define expect_(expected, got, precision)
#define expectf(expected, got)
static void test_createfont(void)
static void test_getgenerics(void)
static void check_family(const char *context, GpFontFamily *family, WCHAR *name)
static void test_createfont_charset(void)
static void test_heightgivendpi(void)
static void test_installedfonts(void)
static const WCHAR pathW[]
static ICollection collection
png_const_structrp png_const_inforp int * unit
#define _WIN32_WINNT_WIN7
CHAR lfFaceName[LF_FACESIZE]
WCHAR lfFaceName[LF_FACESIZE]
TEXTMETRICW otmTextMetrics
T1_FIELD_DICT_FONTDICT family_name
DWORD WINAPI GetLastError(void)
int WINAPI SetMapMode(_In_ HDC, _In_ int)
int WINAPI EnumFontFamiliesExW(_In_ HDC, _In_ PLOGFONTW, _In_ FONTENUMPROCW, _In_ LPARAM, _In_ DWORD)
BOOL WINAPI SetViewportExtEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPSIZE)
#define TRUETYPE_FONTTYPE
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI SetWindowExtEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPSIZE)
int WINAPI GetTextCharset(_In_ HDC)
UINT WINAPI GetOutlineTextMetricsW(_In_ HDC hdc, _In_ UINT cjCopy, _Out_writes_bytes_opt_(cjCopy) LPOUTLINETEXTMETRICW potm)
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
BOOL WINAPI DeleteDC(_In_ HDC)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)
#define MAKEINTRESOURCEW(i)