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) 33 static 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'};
34 static const WCHAR MSSansSerif[] = {
'M',
'S',
' ',
'S',
'a',
'n',
's',
' ',
'S',
'e',
'r',
'i',
'f',
'\0'};
35 static 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");
611 fm->
ascent = ntm.ntmSizeEM;
612 fm->
descent = ntm.ntmCellHeight - ntm.ntmSizeEM;
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);
HGDIOBJ WINAPI GetStockObject(_In_ int)
static void test_GdipGetFontCollectionFamilyList(void)
HFONT WINAPI CreateFontIndirectW(CONST LOGFONTW *lplf)
int WINAPI GetObjectA(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
GpStatus WINGDIPAPI GdipGetGenericFontFamilyMonospace(GpFontFamily **nativeFamily)
static void test_installedfonts(void)
GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics, LOGFONTW *lf)
GpStatus WINGDIPAPI GdipDeleteFont(GpFont *font)
static const WCHAR TimesNewRoman[]
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
GpStatus WINGDIPAPI GdipSetWorldTransform(GpGraphics *graphics, GpMatrix *matrix)
int WINAPI EnumFontFamiliesExW(HDC hdc, LPLOGFONTW lpLogfont, FONTENUMPROCW lpEnumFontFamExProc, LPARAM lParam, DWORD dwFlags)
GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC hdc, GDIPCONST LOGFONTW *logfont, GpFont **font)
HDC WINAPI GetDC(_In_opt_ HWND)
static const WCHAR nonexistent[]
char * wine_dbgstr_w(const wchar_t *wstr)
GLuint GLuint GLsizei count
GpStatus WINGDIPAPI GdipGetFontUnit(GpFont *font, Unit *unit)
static void check_family(const char *context, GpFontFamily *family, WCHAR *name)
static void test_GdipGetFontCollectionFamilyCount(void)
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
GpStatus WINGDIPAPI GdipCreateMatrix(GpMatrix **matrix)
GpStatus WINGDIPAPI GdipGetLogFontA(GpFont *font, GpGraphics *graphics, LOGFONTA *lfa)
static void gdip_get_font_metrics(GpFont *font, struct font_metrics *fm)
UINT APIENTRY GetOutlineTextMetricsW(HDC hdc, UINT cbData, LPOUTLINETEXTMETRICW lpOTM)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
#define INVALID_HANDLE_VALUE
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
DWORD WINAPI GetLastError(VOID)
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
LPVOID WINAPI LockResource(HGLOBAL handle)
static void cmp_font_metrics(struct font_metrics *fm1, struct font_metrics *fm2, int line)
#define MAKEINTRESOURCEA(i)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
#define expect_(expected, got, precision)
static void test_fontfamily_properties(void)
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
GpStatus WINGDIPAPI GdipGetGenericFontFamilySansSerif(GpFontFamily **nativeFamily)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
GpStatus WINGDIPAPI GdipSetPageUnit(GpGraphics *graphics, GpUnit unit)
GpStatus WINGDIPAPI GdipCreateFont(GDIPCONST GpFontFamily *fontFamily, REAL emSize, INT style, Unit unit, GpFont **font)
GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics)
static UINT WPARAM LPARAM lparam
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)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
static int CALLBACK font_enum_proc(const LOGFONTW *lfe, const TEXTMETRICW *ntme, DWORD type, LPARAM lparam)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
GpStatus WINGDIPAPI GdipGetCellAscent(GDIPCONST GpFontFamily *family, INT style, UINT16 *CellAscent)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
png_const_structrp png_const_inforp int * unit
static void test_fontfamily(void)
#define expectf_(expected, got, precision)
GpStatus WINGDIPAPI GdipGetFontSize(GpFont *font, REAL *size)
const char * winetest_platform
static LPTEXTMETRICW LONG * height
GpStatus WINGDIPAPI GdipCreateFontFamilyFromName(GDIPCONST WCHAR *name, GpFontCollection *fontCollection, GpFontFamily **FontFamily)
int CDECL _controlfp_s(unsigned int *cur, unsigned int newval, unsigned int mask)
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 GdipCreateFontFromLogfontA(HDC hdc, GDIPCONST LOGFONTA *lfa, GpFont **font)
static void test_getgenerics(void)
GpStatus WINGDIPAPI GdipGetLineSpacing(GDIPCONST GpFontFamily *family, INT style, UINT16 *LineSpacing)
static void test_font_substitution(void)
static void test_long_name(void)
void WINAPI GdiplusShutdown(ULONG_PTR)
GpStatus WINGDIPAPI GdipPrivateAddFontFile(GpFontCollection *collection, GDIPCONST WCHAR *name)
Status WINAPI GdiplusStartup(ULONG_PTR *token, const struct GdiplusStartupInput *input, struct GdiplusStartupOutput *output)
GpStatus WINGDIPAPI GdipRotateMatrix(GpMatrix *matrix, REAL angle, GpMatrixOrder order)
GpStatus WINGDIPAPI GdipGetFontHeight(GDIPCONST GpFont *font, GDIPCONST GpGraphics *graphics, REAL *height)
GpStatus WINGDIPAPI GdipGetCellDescent(GDIPCONST GpFontFamily *family, INT style, UINT16 *CellDescent)
static void test_font_transform(void)
GpStatus WINGDIPAPI GdipGetFontCollectionFamilyList(GpFontCollection *fontCollection, INT numSought, GpFontFamily *gpfamilies[], INT *numFound)
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
GpStatus WINGDIPAPI GdipDeleteFontFamily(GpFontFamily *FontFamily)
GpStatus WINGDIPAPI GdipGetFontStyle(GpFont *font, INT *style)
GpStatus WINGDIPAPI GdipDeleteMatrix(GpMatrix *matrix)
#define expect(expected, got)
#define expectf(expected, got)
GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix *matrix, REAL scaleX, REAL scaleY, GpMatrixOrder order)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
GpStatus WINGDIPAPI GdipGetGenericFontFamilySerif(GpFontFamily **nativeFamily)
static void test_heightgivendpi(void)
GpStatus WINGDIPAPI GdipGetFontCollectionFamilyCount(GpFontCollection *fontCollection, INT *numFound)
GLint GLint GLsizei GLsizei height
GpStatus WINGDIPAPI GdipGetFamilyName(GDIPCONST GpFontFamily *family, WCHAR *name, LANGID language)
GpStatus WINGDIPAPI GdipShearMatrix(GpMatrix *matrix, REAL shearX, REAL shearY, GpMatrixOrder order)
GpStatus WINGDIPAPI GdipTranslateMatrix(GpMatrix *matrix, REAL offsetX, REAL offsetY, GpMatrixOrder order)
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Gdiplus::GdiplusStartupInput gdiplusStartupInput
static const WORD INT INT LPINT LPINT LPSIZE size
static void _delete_testfontfile(const WCHAR *filename, int line)
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
BOOL WINAPI DeleteDC(_In_ HDC)
static ICollection collection
static INT(WINAPI *pAddFontResourceExA)(LPCSTR
static void test_font_metrics(void)
GpStatus WINGDIPAPI GdipCloneFontFamily(GpFontFamily *FontFamily, GpFontFamily **clonedFontFamily)
GpStatus WINGDIPAPI GdipNewPrivateFontCollection(GpFontCollection **fontCollection)
GpStatus WINGDIPAPI GdipCreateFromHDC(HDC hdc, GpGraphics **graphics)
GpStatus WINGDIPAPI GdipGetFontHeightGivenDPI(GDIPCONST GpFont *font, REAL dpi, REAL *height)
TEXTMETRICW otmTextMetrics
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
static void test_logfont(void)
GpStatus WINGDIPAPI GdipGetFamily(GpFont *font, GpFontFamily **family)
#define MultiByteToWideChar
static void gdi_get_font_metrics(LOGFONTW *lf, struct font_metrics *fm)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static const WCHAR MSSansSerif[]
static const WCHAR Tahoma[]
char * strcpy(char *DstString, const char *SrcString)
WCHAR lfFaceName[LF_FACESIZE]
int WINAPI GetTextCharset(_In_ HDC)
int strcmp(const char *String1, const char *String2)
CHAR lfFaceName[LF_FACESIZE]
#define GetProcAddress(x, y)
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
GLuint GLuint GLsizei GLenum type
T1_FIELD_DICT_FONTDICT family_name
GpStatus WINGDIPAPI GdipNewInstalledFontCollection(GpFontCollection **fontCollection)
GpStatus WINGDIPAPI GdipDeletePrivateFontCollection(GpFontCollection **fontCollection)
#define DELETE_FONTFILE(filename)
static SERVICE_STATUS status
static void set_rect_empty(RectF *rc)
GpStatus WINGDIPAPI GdipGetEmHeight(GDIPCONST GpFontFamily *family, INT style, UINT16 *EmHeight)
static void test_createfont(void)
static void create_testfontfile(const WCHAR *filename, int resource, WCHAR pathW[MAX_PATH])
#define TRUETYPE_FONTTYPE
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *