28#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got)
29#define expect_(expected, got, precision) ok(abs((expected) - (got)) <= (precision), "Expected %d, got %d\n", (expected), (got))
30#define expectf_(expected, got, precision) ok(fabs((expected) - (got)) <= (precision), "Expected %f, got %f\n", (expected), (got))
31#define expectf(expected, got) expectf_((expected), (got), 0.001)
33static const WCHAR nonexistent[] = {
'T',
'h',
'i',
's',
'F',
'o',
'n',
't',
's',
'h',
'o',
'u',
'l',
'd',
'N',
'o',
't',
'E',
'x',
'i',
's',
't',
'\0'};
34static const WCHAR MSSansSerif[] = {
'M',
'S',
' ',
'S',
'a',
'n',
's',
' ',
'S',
'e',
'r',
'i',
'f',
'\0'};
35static const WCHAR TimesNewRoman[] = {
'T',
'i',
'm',
'e',
's',
' ',
'N',
'e',
'w',
' ',
'R',
'o',
'm',
'a',
'n',
'\0'};
60 ok(
res != 0,
"couldn't find resource\n");
67#define DELETE_FONTFILE(filename) _delete_testfontfile(filename, __LINE__)
77 static const WCHAR path_longname[] = {
'w',
'i',
'n',
'e',
'_',
'l',
'o',
'n',
'g',
'n',
'a',
'm',
'e',
'.',
't',
't',
'f',0};
86 ok(
stat ==
Ok,
"GdipNewPrivateFontCollection failed: %d\n",
stat);
91 ok(
stat ==
Ok,
"GdipPrivateAddFontFile failed: %d\n",
stat);
94 ok(
stat ==
Ok,
"GdipGetFontCollectionFamilyCount failed: %d\n",
stat);
96 ok(num_families == 1,
"expected num_families to be 1, got %d\n", num_families);
99 ok(
stat ==
Ok,
"GdipGetFontCollectionFamilyList failed: %d\n",
stat);
113 ok(
stat ==
Ok,
"GdipDeletePrivateFontCollection failed: %d\n",
stat);
151 ok (
size == 12,
"Expected 12, got %f\n",
size);
161 ok (
size == 24,
"Expected 24, got %f (with unit: %d)\n",
size,
i);
163 ok (
stat ==
Ok,
"Failed to get font unit, %d.\n",
stat);
181 UINT16 em_height, line_spacing;
196 ok(lfa2.
lfHeight < 0,
"Expected negative height\n");
227 ok(lfa2.
lfHeight < 0,
"Expected negative height\n");
245 "Expected , got %d\n",
style);
265 expect(2472, line_spacing);
270 memset(&lfa, 0,
sizeof(lfa));
275 memset(&lfa2, 0xff,
sizeof(lfa2));
298 expect(2472, line_spacing);
382 skip(
"Times New Roman not installed\n");
431 int missingfonts = 0;
455 trace(
"You may need to install either the Microsoft Web Fonts or the Liberation Fonts\n");
458 ok(
lstrcmpiW(sansname, serifname) != 0,
"Sans Serif and Serif families should be different: %s\n",
wine_dbgstr_w(sansname));
459 ok(
lstrcmpiW(sansname, mononame) != 0,
"Sans Serif and Monospace families should be different: %s\n",
wine_dbgstr_w(sansname));
460 ok(
lstrcmpiW(serifname, mononame) != 0,
"Serif and Monospace families should be different: %s\n",
wine_dbgstr_w(serifname));
601 ok(
ret,
"GetOutlineTextMetrics failed\n");
682 memset(&lf, 0,
sizeof(lf));
696 trace(
"%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
703 trace(
"%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
715 trace(
"%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
737 trace(
"%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
744 trace(
"%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
756 trace(
"%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
775 trace(
"%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
785 trace(
"%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
825 ok(
hfont != 0,
"GetStockObject(DEFAULT_GUI_FONT) failed\n");
827 memset(&lf, 0xfe,
sizeof(lf));
829 ok(
ret ==
sizeof(lf),
"GetObject failed\n");
835 memset(&lf, 0xfe,
sizeof(lf));
846 memset(&lf, 0xfe,
sizeof(lf));
864 trace(
"fallback font %s\n", fallback_font);
870 memset(&lf, 0xfe,
sizeof(lf));
880 memset(&lf, 0xfe,
sizeof(lf));
894 "expected NotTrueTypeFont, got %d\n",
status);
904 "expected NotTrueTypeFont, got %d\n",
status);
914 static const WCHAR string[] = {
'A',0 };
938 memset(&lf, 0,
sizeof(lf));
945 margin_y = 100.0 / 8.0;
1201 ok(
count > 0,
"Unexpected empty collection.\n");
1209 ok(found == 123,
"Unexpected list count %d.\n", found);
1217 ok(found == 123,
"Unexpected list count %d.\n", found);
1222 ok(found == 123,
"Unexpected list count %d.\n", found);
1228 ok(found == 1,
"Unexpected list count %d.\n", found);
1229 ok(family !=
NULL,
"Expected family instance.\n");
1235 ok(found == 1,
"Unexpected list count %d.\n", found);
1236 ok(family2 != family,
"Unexpected family instance.\n");
1254 ok(
count == 123,
"Unexpected family count %d.\n",
count);
int CDECL _controlfp_s(unsigned int *cur, unsigned int newval, unsigned int mask)
int strcmp(const char *String1, const char *String2)
char * strcpy(char *DstString, const char *SrcString)
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define MultiByteToWideChar
GpStatus WINGDIPAPI GdipGetFontSize(GpFont *font, REAL *size)
GpStatus WINGDIPAPI GdipGetFontHeight(GDIPCONST GpFont *font, GDIPCONST GpGraphics *graphics, REAL *height)
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 GdipCreateFontFamilyFromName(GDIPCONST WCHAR *name, GpFontCollection *fontCollection, GpFontFamily **FontFamily)
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 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 GdipPrivateAddFontFile(GpFontCollection *collection, GDIPCONST WCHAR *name)
GpStatus WINGDIPAPI GdipNewPrivateFontCollection(GpFontCollection **fontCollection)
GpStatus WINGDIPAPI GdipCloneFontFamily(GpFontFamily *FontFamily, GpFontFamily **clonedFontFamily)
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 LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR 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)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Status WINAPI GdiplusStartup(ULONG_PTR *token, const struct GdiplusStartupInput *input, struct GdiplusStartupOutput *output)
@ DriverStringOptionsCmapLookup
void WINAPI GdiplusShutdown(ULONG_PTR)
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
GLint GLint GLsizei GLsizei height
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)
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 DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
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 gdi_get_font_metrics(LOGFONTW *lf, struct font_metrics *fm)
static void test_fontfamily(void)
#define DELETE_FONTFILE(filename)
static void test_long_name(void)
static void test_GdipGetFontCollectionFamilyList(void)
static void test_GdipGetFontCollectionFamilyCount(void)
static const WCHAR nonexistent[]
static void set_rect_empty(RectF *rc)
static const WCHAR Tahoma[]
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 const WCHAR MSSansSerif[]
static const WCHAR TimesNewRoman[]
static void test_heightgivendpi(void)
static void test_installedfonts(void)
static ICollection collection
png_const_structrp png_const_inforp int * unit
const char * winetest_platform
CHAR lfFaceName[LF_FACESIZE]
WCHAR lfFaceName[LF_FACESIZE]
TEXTMETRICW otmTextMetrics
T1_FIELD_DICT_FONTDICT family_name
DWORD WINAPI GetLastError(void)
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI GetObjectA(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
int WINAPI EnumFontFamiliesExW(_In_ HDC, _In_ PLOGFONTW, _In_ FONTENUMPROCW, _In_ LPARAM, _In_ DWORD)
#define TRUETYPE_FONTTYPE
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
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 MAKEINTRESOURCEA(i)