2007-08-15 03:58:59 +02:00
|
|
|
/*
|
|
|
|
* Unit test suite for fonts
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007 Google (Evan Stade)
|
2012-05-11 12:21:36 +02:00
|
|
|
* Copyright (C) 2012 Dmitry Timoshkov
|
2007-08-15 03:58:59 +02:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2010-03-26 01:27:20 +01:00
|
|
|
#include <math.h>
|
|
|
|
|
2013-10-16 05:49:40 +02:00
|
|
|
#include "objbase.h"
|
2007-08-15 03:58:59 +02:00
|
|
|
#include "gdiplus.h"
|
|
|
|
#include "wine/test.h"
|
|
|
|
|
2012-04-20 09:44:17 +02:00
|
|
|
#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got)
|
2012-10-24 11:11:29 +02:00
|
|
|
#define expect_(expected, got, precision) ok(abs((expected) - (got)) <= (precision), "Expected %d, got %d\n", (expected), (got))
|
2012-10-09 11:41:47 +02:00
|
|
|
#define expectf_(expected, got, precision) ok(fabs((expected) - (got)) <= (precision), "Expected %f, got %f\n", (expected), (got))
|
|
|
|
#define expectf(expected, got) expectf_((expected), (got), 0.001)
|
2007-08-15 03:58:59 +02:00
|
|
|
|
2012-10-09 11:41:47 +02:00
|
|
|
static void set_rect_empty(RectF *rc)
|
|
|
|
{
|
|
|
|
rc->X = 0.0;
|
|
|
|
rc->Y = 0.0;
|
|
|
|
rc->Width = 0.0;
|
|
|
|
rc->Height = 0.0;
|
|
|
|
}
|
|
|
|
|
2017-11-26 14:33:18 +01:00
|
|
|
static void create_testfontfile(const WCHAR *filename, int resource, WCHAR pathW[MAX_PATH])
|
|
|
|
{
|
|
|
|
DWORD written;
|
|
|
|
HANDLE file;
|
|
|
|
HRSRC res;
|
|
|
|
void *ptr;
|
|
|
|
|
|
|
|
GetTempPathW(MAX_PATH, pathW);
|
|
|
|
lstrcatW(pathW, filename);
|
|
|
|
|
|
|
|
file = CreateFileW(pathW, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0);
|
|
|
|
ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %d\n", wine_dbgstr_w(pathW), GetLastError());
|
|
|
|
|
|
|
|
res = FindResourceA(GetModuleHandleA(NULL), MAKEINTRESOURCEA(resource), (LPCSTR)RT_RCDATA);
|
|
|
|
ok(res != 0, "couldn't find resource\n");
|
|
|
|
ptr = LockResource(LoadResource(GetModuleHandleA(NULL), res));
|
|
|
|
WriteFile(file, ptr, SizeofResource(GetModuleHandleA(NULL), res), &written, NULL);
|
|
|
|
ok(written == SizeofResource(GetModuleHandleA(NULL), res), "couldn't write resource\n");
|
|
|
|
CloseHandle(file);
|
|
|
|
}
|
|
|
|
|
|
|
|
#define DELETE_FONTFILE(filename) _delete_testfontfile(filename, __LINE__)
|
|
|
|
static void _delete_testfontfile(const WCHAR *filename, int line)
|
|
|
|
{
|
|
|
|
BOOL ret = DeleteFileW(filename);
|
|
|
|
ok_(__FILE__,line)(ret, "failed to delete file %s, error %d\n", wine_dbgstr_w(filename), GetLastError());
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_long_name(void)
|
|
|
|
{
|
|
|
|
WCHAR path[MAX_PATH];
|
|
|
|
GpStatus stat;
|
|
|
|
GpFontCollection *fonts;
|
|
|
|
INT num_families;
|
2021-05-26 22:49:18 +02:00
|
|
|
GpFontFamily *family, *cloned_family;
|
2017-11-26 14:33:18 +01:00
|
|
|
WCHAR family_name[LF_FACESIZE];
|
|
|
|
GpFont *font;
|
|
|
|
|
|
|
|
stat = GdipNewPrivateFontCollection(&fonts);
|
|
|
|
ok(stat == Ok, "GdipNewPrivateFontCollection failed: %d\n", stat);
|
|
|
|
|
2020-12-09 02:40:10 +01:00
|
|
|
create_testfontfile(L"wine_longname.ttf", 1, path);
|
2017-11-26 14:33:18 +01:00
|
|
|
|
|
|
|
stat = GdipPrivateAddFontFile(fonts, path);
|
|
|
|
ok(stat == Ok, "GdipPrivateAddFontFile failed: %d\n", stat);
|
|
|
|
|
|
|
|
stat = GdipGetFontCollectionFamilyCount(fonts, &num_families);
|
|
|
|
ok(stat == Ok, "GdipGetFontCollectionFamilyCount failed: %d\n", stat);
|
|
|
|
|
|
|
|
ok(num_families == 1, "expected num_families to be 1, got %d\n", num_families);
|
|
|
|
|
|
|
|
stat = GdipGetFontCollectionFamilyList(fonts, num_families, &family, &num_families);
|
|
|
|
ok(stat == Ok, "GdipGetFontCollectionFamilyList failed: %d\n", stat);
|
|
|
|
|
|
|
|
stat = GdipGetFamilyName(family, family_name, LANG_NEUTRAL);
|
|
|
|
ok(stat == Ok, "GdipGetFamilyName failed: %d\n", stat);
|
|
|
|
|
|
|
|
stat = GdipCreateFont(family, 256.0, FontStyleRegular, UnitPixel, &font);
|
|
|
|
ok(stat == Ok, "GdipCreateFont failed: %d\n", stat);
|
|
|
|
|
2021-05-26 22:49:18 +02:00
|
|
|
stat = GdipCloneFontFamily(family, &cloned_family);
|
|
|
|
ok(stat == Ok, "GdipCloneFontFamily failed: %d\n", stat);
|
|
|
|
ok(family == cloned_family, "GdipCloneFontFamily returned new object\n");
|
|
|
|
|
2017-11-26 14:33:18 +01:00
|
|
|
/* Cleanup */
|
|
|
|
|
|
|
|
stat = GdipDeleteFont(font);
|
|
|
|
ok(stat == Ok, "GdipDeleteFont failed: %d\n", stat);
|
|
|
|
|
|
|
|
stat = GdipDeletePrivateFontCollection(&fonts);
|
|
|
|
ok(stat == Ok, "GdipDeletePrivateFontCollection failed: %d\n", stat);
|
|
|
|
|
2021-05-26 22:49:18 +02:00
|
|
|
/* Cloned family survives after collection is deleted */
|
|
|
|
stat = GdipGetFamilyName(cloned_family, family_name, LANG_NEUTRAL);
|
|
|
|
ok(stat == Ok, "GdipGetFamilyName failed: %d\n", stat);
|
|
|
|
|
|
|
|
stat = GdipDeleteFontFamily(cloned_family);
|
|
|
|
ok(stat == Ok, "GdipDeleteFontFamily failed: %d\n", stat);
|
|
|
|
|
2017-11-26 14:33:18 +01:00
|
|
|
DELETE_FONTFILE(path);
|
|
|
|
}
|
|
|
|
|
2008-06-21 19:02:56 +02:00
|
|
|
static void test_createfont(void)
|
|
|
|
{
|
2008-08-27 23:21:45 +02:00
|
|
|
GpFontFamily* fontfamily = NULL, *fontfamily2;
|
2008-06-21 19:02:56 +02:00
|
|
|
GpFont* font = NULL;
|
|
|
|
GpStatus stat;
|
|
|
|
Unit unit;
|
|
|
|
UINT i;
|
|
|
|
REAL size;
|
2008-08-27 23:21:45 +02:00
|
|
|
WCHAR familyname[LF_FACESIZE];
|
2008-06-21 19:02:56 +02:00
|
|
|
|
2020-12-09 02:40:09 +01:00
|
|
|
stat = GdipCreateFontFamilyFromName(L"ThisFontShouldNotExist", NULL, &fontfamily);
|
2008-06-21 19:02:56 +02:00
|
|
|
expect (FontFamilyNotFound, stat);
|
|
|
|
stat = GdipDeleteFont(font);
|
|
|
|
expect (InvalidParameter, stat);
|
2020-12-09 02:40:09 +01:00
|
|
|
stat = GdipCreateFontFamilyFromName(L"Tahoma", NULL, &fontfamily);
|
2008-06-21 19:02:56 +02:00
|
|
|
expect (Ok, stat);
|
|
|
|
stat = GdipCreateFont(fontfamily, 12, FontStyleRegular, UnitPoint, &font);
|
|
|
|
expect (Ok, stat);
|
|
|
|
stat = GdipGetFontUnit (font, &unit);
|
|
|
|
expect (Ok, stat);
|
|
|
|
expect (UnitPoint, unit);
|
|
|
|
|
2008-08-27 23:21:45 +02:00
|
|
|
stat = GdipGetFamily(font, &fontfamily2);
|
|
|
|
expect(Ok, stat);
|
|
|
|
stat = GdipGetFamilyName(fontfamily2, familyname, 0);
|
|
|
|
expect(Ok, stat);
|
2019-01-26 15:23:04 +01:00
|
|
|
ok (fontfamily == fontfamily2, "Unexpected family instance.\n");
|
2020-12-09 02:40:09 +01:00
|
|
|
ok (lstrcmpiW(L"Tahoma", familyname) == 0, "Expected Tahoma, got %s\n",
|
2009-08-19 13:36:22 +02:00
|
|
|
wine_dbgstr_w(familyname));
|
2008-08-27 23:21:45 +02:00
|
|
|
stat = GdipDeleteFontFamily(fontfamily2);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
2016-08-02 00:10:10 +02:00
|
|
|
/* Test to see if returned size is based on unit (it's not) */
|
2008-06-21 19:02:56 +02:00
|
|
|
GdipGetFontSize(font, &size);
|
|
|
|
ok (size == 12, "Expected 12, got %f\n", size);
|
|
|
|
GdipDeleteFont(font);
|
|
|
|
|
|
|
|
/* Make sure everything is converted correctly for all Units */
|
|
|
|
for (i = UnitWorld; i <=UnitMillimeter; i++)
|
|
|
|
{
|
|
|
|
if (i == UnitDisplay) continue; /* Crashes WindowsXP, wtf? */
|
2017-11-28 10:05:20 +01:00
|
|
|
stat = GdipCreateFont(fontfamily, 24, FontStyleRegular, i, &font);
|
|
|
|
expect(Ok, stat);
|
2008-06-21 19:02:56 +02:00
|
|
|
GdipGetFontSize (font, &size);
|
|
|
|
ok (size == 24, "Expected 24, got %f (with unit: %d)\n", size, i);
|
2019-01-06 16:27:58 +01:00
|
|
|
stat = GdipGetFontUnit (font, &unit);
|
|
|
|
ok (stat == Ok, "Failed to get font unit, %d.\n", stat);
|
2008-06-21 19:02:56 +02:00
|
|
|
expect (i, unit);
|
|
|
|
GdipDeleteFont(font);
|
|
|
|
}
|
2008-07-03 20:25:41 +02:00
|
|
|
|
|
|
|
GdipDeleteFontFamily(fontfamily);
|
2008-06-21 19:02:56 +02:00
|
|
|
}
|
|
|
|
|
2007-08-15 03:58:59 +02:00
|
|
|
static void test_logfont(void)
|
|
|
|
{
|
2009-04-23 21:29:22 +02:00
|
|
|
LOGFONTA lfa, lfa2;
|
2007-08-15 03:58:59 +02:00
|
|
|
GpFont *font;
|
2012-05-11 12:21:36 +02:00
|
|
|
GpFontFamily *family;
|
2007-08-15 03:58:59 +02:00
|
|
|
GpStatus stat;
|
|
|
|
GpGraphics *graphics;
|
|
|
|
HDC hdc = GetDC(0);
|
2008-08-27 23:21:49 +02:00
|
|
|
INT style;
|
2012-05-11 12:21:36 +02:00
|
|
|
REAL rval;
|
|
|
|
UINT16 em_height, line_spacing;
|
|
|
|
Unit unit;
|
2007-08-15 03:58:59 +02:00
|
|
|
|
2017-11-28 10:05:20 +01:00
|
|
|
stat = GdipCreateFromHDC(hdc, &graphics);
|
|
|
|
expect(Ok, stat);
|
2012-05-11 12:21:36 +02:00
|
|
|
|
2009-04-23 21:29:22 +02:00
|
|
|
memset(&lfa, 0, sizeof(LOGFONTA));
|
|
|
|
memset(&lfa2, 0xff, sizeof(LOGFONTA));
|
2012-04-20 09:44:17 +02:00
|
|
|
lstrcpyA(lfa.lfFaceName, "Tahoma");
|
2007-08-15 03:58:59 +02:00
|
|
|
|
2009-04-23 21:29:22 +02:00
|
|
|
stat = GdipCreateFontFromLogfontA(hdc, &lfa, &font);
|
2007-08-15 03:58:59 +02:00
|
|
|
expect(Ok, stat);
|
2009-04-23 21:29:22 +02:00
|
|
|
stat = GdipGetLogFontA(font, graphics, &lfa2);
|
2007-08-15 03:58:59 +02:00
|
|
|
expect(Ok, stat);
|
|
|
|
|
2009-04-23 21:29:22 +02:00
|
|
|
ok(lfa2.lfHeight < 0, "Expected negative height\n");
|
|
|
|
expect(0, lfa2.lfWidth);
|
|
|
|
expect(0, lfa2.lfEscapement);
|
|
|
|
expect(0, lfa2.lfOrientation);
|
|
|
|
ok((lfa2.lfWeight >= 100) && (lfa2.lfWeight <= 900), "Expected weight to be set\n");
|
|
|
|
expect(0, lfa2.lfItalic);
|
|
|
|
expect(0, lfa2.lfUnderline);
|
|
|
|
expect(0, lfa2.lfStrikeOut);
|
2010-10-25 06:39:08 +02:00
|
|
|
ok(lfa2.lfCharSet == GetTextCharset(hdc) || lfa2.lfCharSet == ANSI_CHARSET,
|
|
|
|
"Expected %x or %x, got %x\n", GetTextCharset(hdc), ANSI_CHARSET, lfa2.lfCharSet);
|
2009-04-23 21:29:22 +02:00
|
|
|
expect(0, lfa2.lfOutPrecision);
|
|
|
|
expect(0, lfa2.lfClipPrecision);
|
|
|
|
expect(0, lfa2.lfQuality);
|
|
|
|
expect(0, lfa2.lfPitchAndFamily);
|
2007-08-15 03:58:59 +02:00
|
|
|
|
2007-08-15 03:59:22 +02:00
|
|
|
GdipDeleteFont(font);
|
|
|
|
|
2009-04-23 21:29:22 +02:00
|
|
|
memset(&lfa, 0, sizeof(LOGFONTA));
|
|
|
|
lfa.lfHeight = 25;
|
|
|
|
lfa.lfWidth = 25;
|
|
|
|
lfa.lfEscapement = lfa.lfOrientation = 50;
|
|
|
|
lfa.lfItalic = lfa.lfUnderline = lfa.lfStrikeOut = TRUE;
|
2007-08-15 03:59:22 +02:00
|
|
|
|
2009-04-23 21:29:22 +02:00
|
|
|
memset(&lfa2, 0xff, sizeof(LOGFONTA));
|
2012-04-20 09:44:17 +02:00
|
|
|
lstrcpyA(lfa.lfFaceName, "Tahoma");
|
2007-08-15 03:59:22 +02:00
|
|
|
|
2009-04-23 21:29:22 +02:00
|
|
|
stat = GdipCreateFontFromLogfontA(hdc, &lfa, &font);
|
2007-08-15 03:59:22 +02:00
|
|
|
expect(Ok, stat);
|
2009-04-23 21:29:22 +02:00
|
|
|
stat = GdipGetLogFontA(font, graphics, &lfa2);
|
2007-08-15 03:59:22 +02:00
|
|
|
expect(Ok, stat);
|
|
|
|
|
2009-04-23 21:29:22 +02:00
|
|
|
ok(lfa2.lfHeight < 0, "Expected negative height\n");
|
|
|
|
expect(0, lfa2.lfWidth);
|
|
|
|
expect(0, lfa2.lfEscapement);
|
|
|
|
expect(0, lfa2.lfOrientation);
|
|
|
|
ok((lfa2.lfWeight >= 100) && (lfa2.lfWeight <= 900), "Expected weight to be set\n");
|
|
|
|
expect(TRUE, lfa2.lfItalic);
|
|
|
|
expect(TRUE, lfa2.lfUnderline);
|
|
|
|
expect(TRUE, lfa2.lfStrikeOut);
|
2010-10-25 06:39:08 +02:00
|
|
|
ok(lfa2.lfCharSet == GetTextCharset(hdc) || lfa2.lfCharSet == ANSI_CHARSET,
|
|
|
|
"Expected %x or %x, got %x\n", GetTextCharset(hdc), ANSI_CHARSET, lfa2.lfCharSet);
|
2009-04-23 21:29:22 +02:00
|
|
|
expect(0, lfa2.lfOutPrecision);
|
|
|
|
expect(0, lfa2.lfClipPrecision);
|
|
|
|
expect(0, lfa2.lfQuality);
|
|
|
|
expect(0, lfa2.lfPitchAndFamily);
|
2007-08-15 03:59:22 +02:00
|
|
|
|
2008-08-27 23:21:49 +02:00
|
|
|
stat = GdipGetFontStyle(font, &style);
|
|
|
|
expect(Ok, stat);
|
|
|
|
ok (style == (FontStyleItalic | FontStyleUnderline | FontStyleStrikeout),
|
|
|
|
"Expected , got %d\n", style);
|
|
|
|
|
2012-05-11 12:21:36 +02:00
|
|
|
stat = GdipGetFontUnit(font, &unit);
|
|
|
|
expect(Ok, stat);
|
|
|
|
expect(UnitWorld, unit);
|
|
|
|
|
|
|
|
stat = GdipGetFontHeight(font, graphics, &rval);
|
|
|
|
expect(Ok, stat);
|
|
|
|
expectf(25.347656, rval);
|
|
|
|
stat = GdipGetFontSize(font, &rval);
|
|
|
|
expect(Ok, stat);
|
|
|
|
expectf(21.0, rval);
|
|
|
|
|
|
|
|
stat = GdipGetFamily(font, &family);
|
|
|
|
expect(Ok, stat);
|
|
|
|
stat = GdipGetEmHeight(family, FontStyleRegular, &em_height);
|
|
|
|
expect(Ok, stat);
|
|
|
|
expect(2048, em_height);
|
|
|
|
stat = GdipGetLineSpacing(family, FontStyleRegular, &line_spacing);
|
|
|
|
expect(Ok, stat);
|
|
|
|
expect(2472, line_spacing);
|
|
|
|
GdipDeleteFontFamily(family);
|
|
|
|
|
|
|
|
GdipDeleteFont(font);
|
|
|
|
|
|
|
|
memset(&lfa, 0, sizeof(lfa));
|
|
|
|
lfa.lfHeight = -25;
|
|
|
|
lstrcpyA(lfa.lfFaceName, "Tahoma");
|
|
|
|
stat = GdipCreateFontFromLogfontA(hdc, &lfa, &font);
|
|
|
|
expect(Ok, stat);
|
|
|
|
memset(&lfa2, 0xff, sizeof(lfa2));
|
|
|
|
stat = GdipGetLogFontA(font, graphics, &lfa2);
|
|
|
|
expect(Ok, stat);
|
|
|
|
expect(lfa.lfHeight, lfa2.lfHeight);
|
|
|
|
|
|
|
|
stat = GdipGetFontUnit(font, &unit);
|
|
|
|
expect(Ok, stat);
|
|
|
|
expect(UnitWorld, unit);
|
|
|
|
|
|
|
|
stat = GdipGetFontHeight(font, graphics, &rval);
|
|
|
|
expect(Ok, stat);
|
|
|
|
expectf(30.175781, rval);
|
|
|
|
stat = GdipGetFontSize(font, &rval);
|
|
|
|
expect(Ok, stat);
|
|
|
|
expectf(25.0, rval);
|
|
|
|
|
|
|
|
stat = GdipGetFamily(font, &family);
|
|
|
|
expect(Ok, stat);
|
|
|
|
stat = GdipGetEmHeight(family, FontStyleRegular, &em_height);
|
|
|
|
expect(Ok, stat);
|
|
|
|
expect(2048, em_height);
|
|
|
|
stat = GdipGetLineSpacing(family, FontStyleRegular, &line_spacing);
|
|
|
|
expect(Ok, stat);
|
|
|
|
expect(2472, line_spacing);
|
|
|
|
GdipDeleteFontFamily(family);
|
|
|
|
|
2007-08-15 03:59:22 +02:00
|
|
|
GdipDeleteFont(font);
|
2020-07-15 03:24:56 +02:00
|
|
|
font = NULL;
|
|
|
|
|
|
|
|
/* The next test must be done with a font where tmHeight -
|
|
|
|
tmInternalLeading != tmAscent. Times New Roman is such a font,
|
|
|
|
so make sure we really have it before continuing. */
|
|
|
|
memset(&lfa, 0, sizeof(lfa));
|
|
|
|
lstrcpyA(lfa.lfFaceName, "Times New Roman");
|
|
|
|
|
|
|
|
stat = GdipCreateFontFromLogfontA(hdc, &lfa, &font);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
memset(&lfa2, 0, sizeof(lfa2));
|
|
|
|
stat = GdipGetLogFontA(font, graphics, &lfa2);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
GdipDeleteFont(font);
|
|
|
|
font = NULL;
|
|
|
|
|
|
|
|
if (!lstrlenA(lfa.lfFaceName) || lstrcmpA(lfa.lfFaceName, lfa2.lfFaceName))
|
|
|
|
{
|
|
|
|
skip("Times New Roman not installed\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
static const struct
|
|
|
|
{
|
|
|
|
INT input;
|
|
|
|
REAL expected;
|
|
|
|
} test_sizes[] = {{12, 9.0}, {36, 32.0}, {48, 42.0}, {72, 63.0}, {144, 127.0}};
|
|
|
|
|
|
|
|
UINT i;
|
|
|
|
|
|
|
|
memset(&lfa, 0, sizeof(lfa));
|
|
|
|
lstrcpyA(lfa.lfFaceName, "Times New Roman");
|
|
|
|
|
2020-09-21 22:52:29 +02:00
|
|
|
for (i = 0; i < ARRAY_SIZE(test_sizes); ++i)
|
2020-07-15 03:24:56 +02:00
|
|
|
{
|
|
|
|
lfa.lfHeight = test_sizes[i].input;
|
|
|
|
|
|
|
|
stat = GdipCreateFontFromLogfontA(hdc, &lfa, &font);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
stat = GdipGetFontSize(font, &rval);
|
|
|
|
expect(Ok, stat);
|
2020-07-15 03:24:57 +02:00
|
|
|
expectf(test_sizes[i].expected, rval);
|
2020-07-15 03:24:56 +02:00
|
|
|
|
|
|
|
GdipDeleteFont(font);
|
|
|
|
font = NULL;
|
|
|
|
}
|
|
|
|
}
|
2007-08-15 03:59:22 +02:00
|
|
|
|
2007-08-15 03:58:59 +02:00
|
|
|
GdipDeleteGraphics(graphics);
|
|
|
|
ReleaseDC(0, hdc);
|
|
|
|
}
|
|
|
|
|
2008-06-21 19:02:51 +02:00
|
|
|
static void test_fontfamily (void)
|
|
|
|
{
|
2008-07-03 20:26:22 +02:00
|
|
|
GpFontFamily *family, *clonedFontFamily;
|
2008-06-21 19:02:51 +02:00
|
|
|
WCHAR itsName[LF_FACESIZE];
|
|
|
|
GpStatus stat;
|
|
|
|
|
2008-07-10 00:25:28 +02:00
|
|
|
/* FontFamily cannot be NULL */
|
2020-12-09 02:40:09 +01:00
|
|
|
stat = GdipCreateFontFamilyFromName (L"Tahoma" , NULL, NULL);
|
2008-06-21 19:02:51 +02:00
|
|
|
expect (InvalidParameter, stat);
|
|
|
|
|
|
|
|
/* FontFamily must be able to actually find the family.
|
2008-07-03 20:25:56 +02:00
|
|
|
* If it can't, any subsequent calls should fail.
|
2008-06-21 19:02:51 +02:00
|
|
|
*/
|
2020-12-09 02:40:09 +01:00
|
|
|
stat = GdipCreateFontFamilyFromName (L"ThisFontShouldNotExist", NULL, &family);
|
2008-06-21 19:02:51 +02:00
|
|
|
expect (FontFamilyNotFound, stat);
|
|
|
|
|
2008-07-08 14:20:55 +02:00
|
|
|
/* Bitmap fonts are not found */
|
2020-12-09 02:40:09 +01:00
|
|
|
stat = GdipCreateFontFamilyFromName (L"MS Sans Serif", NULL, &family);
|
2008-07-08 14:20:55 +02:00
|
|
|
expect (FontFamilyNotFound, stat);
|
2009-12-15 12:32:58 +01:00
|
|
|
if(stat == Ok) GdipDeleteFontFamily(family);
|
2008-07-08 14:20:55 +02:00
|
|
|
|
2020-12-09 02:40:09 +01:00
|
|
|
stat = GdipCreateFontFamilyFromName (L"Tahoma", NULL, &family);
|
2008-06-21 19:02:51 +02:00
|
|
|
expect (Ok, stat);
|
|
|
|
|
2008-07-03 20:25:56 +02:00
|
|
|
stat = GdipGetFamilyName (family, itsName, LANG_NEUTRAL);
|
2008-06-21 19:02:51 +02:00
|
|
|
expect (Ok, stat);
|
2020-12-09 02:40:09 +01:00
|
|
|
expect (0, lstrcmpiW(itsName, L"Tahoma"));
|
2008-06-21 19:02:51 +02:00
|
|
|
|
|
|
|
if (0)
|
|
|
|
{
|
|
|
|
/* Crashes on Windows XP SP2, Vista, and so Wine as well */
|
2008-07-03 20:25:56 +02:00
|
|
|
stat = GdipGetFamilyName (family, NULL, LANG_NEUTRAL);
|
2008-06-21 19:02:51 +02:00
|
|
|
expect (Ok, stat);
|
|
|
|
}
|
|
|
|
|
2008-07-03 20:26:22 +02:00
|
|
|
/* Make sure we don't read old data */
|
|
|
|
ZeroMemory (itsName, sizeof(itsName));
|
|
|
|
stat = GdipCloneFontFamily(family, &clonedFontFamily);
|
|
|
|
expect (Ok, stat);
|
2019-01-26 15:23:04 +01:00
|
|
|
ok (family == clonedFontFamily, "Unexpected family instance.\n");
|
2008-07-03 20:25:56 +02:00
|
|
|
GdipDeleteFontFamily(family);
|
2008-07-03 20:26:22 +02:00
|
|
|
stat = GdipGetFamilyName(clonedFontFamily, itsName, LANG_NEUTRAL);
|
|
|
|
expect(Ok, stat);
|
2020-12-09 02:40:09 +01:00
|
|
|
expect(0, lstrcmpiW(itsName, L"Tahoma"));
|
2008-07-03 20:26:22 +02:00
|
|
|
|
|
|
|
GdipDeleteFontFamily(clonedFontFamily);
|
2008-06-21 19:02:51 +02:00
|
|
|
}
|
|
|
|
|
2008-07-03 20:26:44 +02:00
|
|
|
static void test_fontfamily_properties (void)
|
|
|
|
{
|
|
|
|
GpFontFamily* FontFamily = NULL;
|
|
|
|
GpStatus stat;
|
|
|
|
UINT16 result = 0;
|
|
|
|
|
2020-12-09 02:40:09 +01:00
|
|
|
stat = GdipCreateFontFamilyFromName(L"Tahoma", NULL, &FontFamily);
|
2012-04-20 09:44:17 +02:00
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
stat = GdipGetLineSpacing(FontFamily, FontStyleRegular, &result);
|
|
|
|
expect(Ok, stat);
|
|
|
|
ok (result == 2472, "Expected 2472, got %d\n", result);
|
|
|
|
result = 0;
|
|
|
|
stat = GdipGetEmHeight(FontFamily, FontStyleRegular, &result);
|
|
|
|
expect(Ok, stat);
|
|
|
|
ok(result == 2048, "Expected 2048, got %d\n", result);
|
|
|
|
result = 0;
|
|
|
|
stat = GdipGetCellAscent(FontFamily, FontStyleRegular, &result);
|
|
|
|
expect(Ok, stat);
|
|
|
|
ok(result == 2049, "Expected 2049, got %d\n", result);
|
|
|
|
result = 0;
|
|
|
|
stat = GdipGetCellDescent(FontFamily, FontStyleRegular, &result);
|
|
|
|
expect(Ok, stat);
|
|
|
|
ok(result == 423, "Expected 423, got %d\n", result);
|
|
|
|
GdipDeleteFontFamily(FontFamily);
|
2008-07-17 17:45:31 +02:00
|
|
|
|
2020-12-09 02:40:09 +01:00
|
|
|
stat = GdipCreateFontFamilyFromName(L"Times New Roman", NULL, &FontFamily);
|
2008-07-17 17:45:31 +02:00
|
|
|
if(stat == FontFamilyNotFound)
|
|
|
|
skip("Times New Roman not installed\n");
|
|
|
|
else
|
|
|
|
{
|
|
|
|
result = 0;
|
|
|
|
stat = GdipGetLineSpacing(FontFamily, FontStyleRegular, &result);
|
|
|
|
expect(Ok, stat);
|
|
|
|
ok(result == 2355, "Expected 2355, got %d\n", result);
|
|
|
|
result = 0;
|
|
|
|
stat = GdipGetEmHeight(FontFamily, FontStyleRegular, &result);
|
|
|
|
expect(Ok, stat);
|
|
|
|
ok(result == 2048, "Expected 2048, got %d\n", result);
|
|
|
|
result = 0;
|
|
|
|
stat = GdipGetCellAscent(FontFamily, FontStyleRegular, &result);
|
|
|
|
expect(Ok, stat);
|
|
|
|
ok(result == 1825, "Expected 1825, got %d\n", result);
|
|
|
|
result = 0;
|
|
|
|
stat = GdipGetCellDescent(FontFamily, FontStyleRegular, &result);
|
2011-02-05 08:16:28 +01:00
|
|
|
expect(Ok, stat);
|
2008-07-17 17:45:31 +02:00
|
|
|
ok(result == 443, "Expected 443 got %d\n", result);
|
|
|
|
GdipDeleteFontFamily(FontFamily);
|
|
|
|
}
|
2008-07-03 20:26:44 +02:00
|
|
|
}
|
2008-06-21 19:02:51 +02:00
|
|
|
|
2011-09-13 01:45:20 +02:00
|
|
|
static void check_family(const char* context, GpFontFamily *family, WCHAR *name)
|
2008-06-21 19:02:52 +02:00
|
|
|
{
|
|
|
|
GpStatus stat;
|
2011-09-13 01:45:20 +02:00
|
|
|
GpFont* font;
|
2008-06-21 19:02:52 +02:00
|
|
|
|
2011-09-13 01:45:20 +02:00
|
|
|
*name = 0;
|
|
|
|
stat = GdipGetFamilyName(family, name, LANG_NEUTRAL);
|
|
|
|
ok(stat == Ok, "could not get the %s family name: %.8x\n", context, stat);
|
|
|
|
|
|
|
|
stat = GdipCreateFont(family, 12, FontStyleRegular, UnitPixel, &font);
|
|
|
|
ok(stat == Ok, "could not create a font for the %s family: %.8x\n", context, stat);
|
|
|
|
if (stat == Ok)
|
2008-08-04 20:55:06 +02:00
|
|
|
{
|
2011-09-13 01:45:20 +02:00
|
|
|
stat = GdipDeleteFont(font);
|
|
|
|
ok(stat == Ok, "could not delete the %s family font: %.8x\n", context, stat);
|
2008-08-04 20:55:06 +02:00
|
|
|
}
|
2011-09-13 01:45:20 +02:00
|
|
|
|
|
|
|
stat = GdipDeleteFontFamily(family);
|
|
|
|
ok(stat == Ok, "could not delete the %s family: %.8x\n", context, stat);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_getgenerics (void)
|
|
|
|
{
|
|
|
|
GpStatus stat;
|
|
|
|
GpFontFamily *family;
|
|
|
|
WCHAR sansname[LF_FACESIZE], serifname[LF_FACESIZE], mononame[LF_FACESIZE];
|
|
|
|
int missingfonts = 0;
|
|
|
|
|
|
|
|
stat = GdipGetGenericFontFamilySansSerif(&family);
|
2008-06-21 19:02:52 +02:00
|
|
|
expect (Ok, stat);
|
2011-09-13 01:45:20 +02:00
|
|
|
if (stat == FontFamilyNotFound)
|
|
|
|
missingfonts = 1;
|
2010-07-01 12:06:35 +02:00
|
|
|
else
|
2011-09-13 01:45:20 +02:00
|
|
|
check_family("Sans Serif", family, sansname);
|
2008-06-21 19:02:52 +02:00
|
|
|
|
2011-09-13 01:45:20 +02:00
|
|
|
stat = GdipGetGenericFontFamilySerif(&family);
|
2008-06-21 19:02:52 +02:00
|
|
|
expect (Ok, stat);
|
2008-08-04 20:55:06 +02:00
|
|
|
if (stat == FontFamilyNotFound)
|
2011-09-13 01:45:20 +02:00
|
|
|
missingfonts = 1;
|
|
|
|
else
|
|
|
|
check_family("Serif", family, serifname);
|
|
|
|
|
|
|
|
stat = GdipGetGenericFontFamilyMonospace(&family);
|
2008-06-21 19:02:52 +02:00
|
|
|
expect (Ok, stat);
|
2011-09-13 01:45:20 +02:00
|
|
|
if (stat == FontFamilyNotFound)
|
|
|
|
missingfonts = 1;
|
|
|
|
else
|
|
|
|
check_family("Monospace", family, mononame);
|
|
|
|
|
|
|
|
if (missingfonts && strcmp(winetest_platform, "wine") == 0)
|
|
|
|
trace("You may need to install either the Microsoft Web Fonts or the Liberation Fonts\n");
|
|
|
|
|
|
|
|
/* Check that the family names are all different */
|
|
|
|
ok(lstrcmpiW(sansname, serifname) != 0, "Sans Serif and Serif families should be different: %s\n", wine_dbgstr_w(sansname));
|
|
|
|
ok(lstrcmpiW(sansname, mononame) != 0, "Sans Serif and Monospace families should be different: %s\n", wine_dbgstr_w(sansname));
|
|
|
|
ok(lstrcmpiW(serifname, mononame) != 0, "Serif and Monospace families should be different: %s\n", wine_dbgstr_w(serifname));
|
2008-06-21 19:02:52 +02:00
|
|
|
}
|
|
|
|
|
2009-01-28 23:08:43 +01:00
|
|
|
static void test_installedfonts (void)
|
|
|
|
{
|
|
|
|
GpStatus stat;
|
|
|
|
GpFontCollection* collection=NULL;
|
|
|
|
|
|
|
|
stat = GdipNewInstalledFontCollection(NULL);
|
|
|
|
expect (InvalidParameter, stat);
|
|
|
|
|
|
|
|
stat = GdipNewInstalledFontCollection(&collection);
|
2009-04-27 23:24:47 +02:00
|
|
|
expect (Ok, stat);
|
|
|
|
ok (collection != NULL, "got NULL font collection\n");
|
2009-01-28 23:08:43 +01:00
|
|
|
}
|
|
|
|
|
2010-03-26 01:27:20 +01:00
|
|
|
static void test_heightgivendpi(void)
|
|
|
|
{
|
|
|
|
GpStatus stat;
|
|
|
|
GpFont* font = NULL;
|
|
|
|
GpFontFamily* fontfamily = NULL;
|
|
|
|
REAL height;
|
2012-05-11 12:21:36 +02:00
|
|
|
Unit unit;
|
2010-03-26 01:27:20 +01:00
|
|
|
|
2020-12-09 02:40:09 +01:00
|
|
|
stat = GdipCreateFontFamilyFromName(L"Tahoma", NULL, &fontfamily);
|
2010-03-26 01:27:20 +01:00
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
stat = GdipCreateFont(fontfamily, 30, FontStyleRegular, UnitPixel, &font);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
stat = GdipGetFontHeightGivenDPI(NULL, 96, &height);
|
|
|
|
expect(InvalidParameter, stat);
|
|
|
|
|
|
|
|
stat = GdipGetFontHeightGivenDPI(font, 96, NULL);
|
|
|
|
expect(InvalidParameter, stat);
|
|
|
|
|
|
|
|
stat = GdipGetFontHeightGivenDPI(font, 96, &height);
|
|
|
|
expect(Ok, stat);
|
2012-04-20 09:44:17 +02:00
|
|
|
expectf(36.210938, height);
|
2010-03-26 01:27:20 +01:00
|
|
|
GdipDeleteFont(font);
|
|
|
|
|
|
|
|
height = 12345;
|
|
|
|
stat = GdipCreateFont(fontfamily, 30, FontStyleRegular, UnitWorld, &font);
|
|
|
|
expect(Ok, stat);
|
2012-05-11 12:21:36 +02:00
|
|
|
|
|
|
|
stat = GdipGetFontUnit(font, &unit);
|
|
|
|
expect(Ok, stat);
|
|
|
|
expect(UnitWorld, unit);
|
|
|
|
|
2010-03-26 01:27:20 +01:00
|
|
|
stat = GdipGetFontHeightGivenDPI(font, 96, &height);
|
2010-03-26 01:27:21 +01:00
|
|
|
expect(Ok, stat);
|
2012-04-20 09:44:17 +02:00
|
|
|
expectf(36.210938, height);
|
2010-03-26 01:27:20 +01:00
|
|
|
GdipDeleteFont(font);
|
|
|
|
|
|
|
|
height = 12345;
|
|
|
|
stat = GdipCreateFont(fontfamily, 30, FontStyleRegular, UnitPoint, &font);
|
|
|
|
expect(Ok, stat);
|
|
|
|
stat = GdipGetFontHeightGivenDPI(font, 96, &height);
|
|
|
|
expect(Ok, stat);
|
2012-04-20 09:44:17 +02:00
|
|
|
expectf(48.281250, height);
|
2010-03-26 01:27:20 +01:00
|
|
|
GdipDeleteFont(font);
|
|
|
|
|
|
|
|
height = 12345;
|
|
|
|
stat = GdipCreateFont(fontfamily, 30, FontStyleRegular, UnitInch, &font);
|
|
|
|
expect(Ok, stat);
|
2012-05-11 12:21:36 +02:00
|
|
|
|
|
|
|
stat = GdipGetFontUnit(font, &unit);
|
|
|
|
expect(Ok, stat);
|
|
|
|
expect(UnitInch, unit);
|
|
|
|
|
2010-03-26 01:27:20 +01:00
|
|
|
stat = GdipGetFontHeightGivenDPI(font, 96, &height);
|
|
|
|
expect(Ok, stat);
|
2012-04-20 09:44:17 +02:00
|
|
|
expectf(3476.250000, height);
|
2010-03-26 01:27:20 +01:00
|
|
|
GdipDeleteFont(font);
|
|
|
|
|
|
|
|
height = 12345;
|
|
|
|
stat = GdipCreateFont(fontfamily, 30, FontStyleRegular, UnitDocument, &font);
|
|
|
|
expect(Ok, stat);
|
2012-05-11 12:21:36 +02:00
|
|
|
|
|
|
|
stat = GdipGetFontUnit(font, &unit);
|
|
|
|
expect(Ok, stat);
|
|
|
|
expect(UnitDocument, unit);
|
|
|
|
|
2010-03-26 01:27:20 +01:00
|
|
|
stat = GdipGetFontHeightGivenDPI(font, 96, &height);
|
|
|
|
expect(Ok, stat);
|
2012-04-20 09:44:17 +02:00
|
|
|
expectf(11.587500, height);
|
2010-03-26 01:27:20 +01:00
|
|
|
GdipDeleteFont(font);
|
|
|
|
|
|
|
|
height = 12345;
|
|
|
|
stat = GdipCreateFont(fontfamily, 30, FontStyleRegular, UnitMillimeter, &font);
|
|
|
|
expect(Ok, stat);
|
2012-05-11 12:21:36 +02:00
|
|
|
|
|
|
|
stat = GdipGetFontUnit(font, &unit);
|
|
|
|
expect(Ok, stat);
|
|
|
|
expect(UnitMillimeter, unit);
|
|
|
|
|
2010-03-26 01:27:20 +01:00
|
|
|
stat = GdipGetFontHeightGivenDPI(font, 96, &height);
|
|
|
|
expect(Ok, stat);
|
2012-04-20 09:44:17 +02:00
|
|
|
expectf(136.860245, height);
|
2010-03-26 01:27:20 +01:00
|
|
|
GdipDeleteFont(font);
|
|
|
|
|
|
|
|
GdipDeleteFontFamily(fontfamily);
|
|
|
|
}
|
|
|
|
|
2012-05-11 12:21:36 +02:00
|
|
|
static int CALLBACK font_enum_proc(const LOGFONTW *lfe, const TEXTMETRICW *ntme,
|
|
|
|
DWORD type, LPARAM lparam)
|
|
|
|
{
|
|
|
|
NEWTEXTMETRICW *ntm = (NEWTEXTMETRICW *)lparam;
|
|
|
|
|
|
|
|
if (type != TRUETYPE_FONTTYPE) return 1;
|
|
|
|
|
|
|
|
*ntm = *(NEWTEXTMETRICW *)ntme;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct font_metrics
|
|
|
|
{
|
|
|
|
UINT16 em_height, line_spacing, ascent, descent;
|
|
|
|
REAL font_height, font_size;
|
|
|
|
INT lfHeight;
|
|
|
|
};
|
|
|
|
|
|
|
|
static void gdi_get_font_metrics(LOGFONTW *lf, struct font_metrics *fm)
|
|
|
|
{
|
|
|
|
HDC hdc;
|
|
|
|
HFONT hfont;
|
|
|
|
NEWTEXTMETRICW ntm;
|
|
|
|
OUTLINETEXTMETRICW otm;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
hdc = CreateCompatibleDC(0);
|
|
|
|
|
|
|
|
/* it's the only way to get extended NEWTEXTMETRIC fields */
|
|
|
|
ret = EnumFontFamiliesExW(hdc, lf, font_enum_proc, (LPARAM)&ntm, 0);
|
|
|
|
ok(!ret, "EnumFontFamiliesExW failed to find %s\n", wine_dbgstr_w(lf->lfFaceName));
|
|
|
|
|
|
|
|
hfont = CreateFontIndirectW(lf);
|
|
|
|
SelectObject(hdc, hfont);
|
|
|
|
|
|
|
|
otm.otmSize = sizeof(otm);
|
|
|
|
ret = GetOutlineTextMetricsW(hdc, otm.otmSize, &otm);
|
|
|
|
ok(ret, "GetOutlineTextMetrics failed\n");
|
|
|
|
|
|
|
|
DeleteDC(hdc);
|
|
|
|
DeleteObject(hfont);
|
|
|
|
|
|
|
|
fm->lfHeight = -otm.otmTextMetrics.tmAscent;
|
|
|
|
fm->line_spacing = ntm.ntmCellHeight;
|
|
|
|
fm->font_size = (REAL)otm.otmTextMetrics.tmAscent;
|
|
|
|
fm->font_height = (REAL)fm->line_spacing * fm->font_size / (REAL)ntm.ntmSizeEM;
|
|
|
|
fm->em_height = ntm.ntmSizeEM;
|
|
|
|
fm->ascent = ntm.ntmSizeEM;
|
|
|
|
fm->descent = ntm.ntmCellHeight - ntm.ntmSizeEM;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void gdip_get_font_metrics(GpFont *font, struct font_metrics *fm)
|
|
|
|
{
|
|
|
|
INT style;
|
|
|
|
GpFontFamily *family;
|
|
|
|
GpStatus stat;
|
|
|
|
|
|
|
|
stat = GdipGetFontStyle(font, &style);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
2017-03-06 23:06:19 +01:00
|
|
|
stat = GdipGetFontHeight(NULL, NULL, &fm->font_height);
|
|
|
|
expect(InvalidParameter, stat);
|
|
|
|
|
|
|
|
stat = GdipGetFontHeight(font, NULL, NULL);
|
|
|
|
expect(InvalidParameter, stat);
|
|
|
|
|
2012-05-11 12:21:36 +02:00
|
|
|
stat = GdipGetFontHeight(font, NULL, &fm->font_height);
|
|
|
|
expect(Ok, stat);
|
|
|
|
stat = GdipGetFontSize(font, &fm->font_size);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
fm->lfHeight = (INT)(fm->font_size * -1.0);
|
|
|
|
|
|
|
|
stat = GdipGetFamily(font, &family);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
stat = GdipGetEmHeight(family, style, &fm->em_height);
|
|
|
|
expect(Ok, stat);
|
|
|
|
stat = GdipGetLineSpacing(family, style, &fm->line_spacing);
|
|
|
|
expect(Ok, stat);
|
|
|
|
stat = GdipGetCellAscent(family, style, &fm->ascent);
|
|
|
|
expect(Ok, stat);
|
|
|
|
stat = GdipGetCellDescent(family, style, &fm->descent);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
GdipDeleteFontFamily(family);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void cmp_font_metrics(struct font_metrics *fm1, struct font_metrics *fm2, int line)
|
|
|
|
{
|
|
|
|
ok_(__FILE__, line)(fm1->lfHeight == fm2->lfHeight, "lfHeight %d != %d\n", fm1->lfHeight, fm2->lfHeight);
|
|
|
|
ok_(__FILE__, line)(fm1->em_height == fm2->em_height, "em_height %u != %u\n", fm1->em_height, fm2->em_height);
|
|
|
|
ok_(__FILE__, line)(fm1->line_spacing == fm2->line_spacing, "line_spacing %u != %u\n", fm1->line_spacing, fm2->line_spacing);
|
|
|
|
ok_(__FILE__, line)(abs(fm1->ascent - fm2->ascent) <= 1, "ascent %u != %u\n", fm1->ascent, fm2->ascent);
|
|
|
|
ok_(__FILE__, line)(abs(fm1->descent - fm2->descent) <= 1, "descent %u != %u\n", fm1->descent, fm2->descent);
|
|
|
|
ok(fm1->font_height > 0.0, "fm1->font_height should be positive, got %f\n", fm1->font_height);
|
|
|
|
ok(fm2->font_height > 0.0, "fm2->font_height should be positive, got %f\n", fm2->font_height);
|
|
|
|
ok_(__FILE__, line)(fm1->font_height == fm2->font_height, "font_height %f != %f\n", fm1->font_height, fm2->font_height);
|
|
|
|
ok(fm1->font_size > 0.0, "fm1->font_size should be positive, got %f\n", fm1->font_size);
|
|
|
|
ok(fm2->font_size > 0.0, "fm2->font_size should be positive, got %f\n", fm2->font_size);
|
|
|
|
ok_(__FILE__, line)(fm1->font_size == fm2->font_size, "font_size %f != %f\n", fm1->font_size, fm2->font_size);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_font_metrics(void)
|
|
|
|
{
|
|
|
|
LOGFONTW lf;
|
|
|
|
GpFont *font;
|
|
|
|
GpFontFamily *family;
|
|
|
|
GpGraphics *graphics;
|
|
|
|
GpStatus stat;
|
|
|
|
Unit unit;
|
|
|
|
struct font_metrics fm_gdi, fm_gdip;
|
|
|
|
HDC hdc;
|
|
|
|
|
|
|
|
hdc = CreateCompatibleDC(0);
|
|
|
|
stat = GdipCreateFromHDC(hdc, &graphics);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
memset(&lf, 0, sizeof(lf));
|
|
|
|
|
|
|
|
/* Tahoma,-13 */
|
2020-12-09 02:40:09 +01:00
|
|
|
lstrcpyW(lf.lfFaceName, L"Tahoma");
|
2012-05-11 12:21:36 +02:00
|
|
|
lf.lfHeight = -13;
|
|
|
|
stat = GdipCreateFontFromLogfontW(hdc, &lf, &font);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
stat = GdipGetFontUnit(font, &unit);
|
|
|
|
expect(Ok, stat);
|
|
|
|
expect(UnitWorld, unit);
|
|
|
|
|
|
|
|
gdip_get_font_metrics(font, &fm_gdip);
|
|
|
|
trace("gdiplus:\n");
|
|
|
|
trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
|
|
|
|
wine_dbgstr_w(lf.lfFaceName), lf.lfHeight,
|
|
|
|
fm_gdip.em_height, fm_gdip.line_spacing, fm_gdip.ascent, fm_gdip.descent,
|
|
|
|
fm_gdip.font_height, fm_gdip.font_size);
|
|
|
|
|
|
|
|
gdi_get_font_metrics(&lf, &fm_gdi);
|
|
|
|
trace("gdi:\n");
|
|
|
|
trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
|
|
|
|
wine_dbgstr_w(lf.lfFaceName), lf.lfHeight,
|
|
|
|
fm_gdi.em_height, fm_gdi.line_spacing, fm_gdi.ascent, fm_gdi.descent,
|
|
|
|
fm_gdi.font_height, fm_gdi.font_size);
|
|
|
|
|
|
|
|
cmp_font_metrics(&fm_gdip, &fm_gdi, __LINE__);
|
|
|
|
|
|
|
|
stat = GdipGetLogFontW(font, graphics, &lf);
|
|
|
|
expect(Ok, stat);
|
|
|
|
ok(lf.lfHeight < 0, "lf.lfHeight should be negative, got %d\n", lf.lfHeight);
|
|
|
|
gdi_get_font_metrics(&lf, &fm_gdi);
|
|
|
|
trace("gdi:\n");
|
|
|
|
trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
|
|
|
|
wine_dbgstr_w(lf.lfFaceName), lf.lfHeight,
|
|
|
|
fm_gdi.em_height, fm_gdi.line_spacing, fm_gdi.ascent, fm_gdi.descent,
|
|
|
|
fm_gdi.font_height, fm_gdi.font_size);
|
|
|
|
ok((REAL)lf.lfHeight * -1.0 == fm_gdi.font_size, "expected %f, got %f\n", (REAL)lf.lfHeight * -1.0, fm_gdi.font_size);
|
|
|
|
|
|
|
|
cmp_font_metrics(&fm_gdip, &fm_gdi, __LINE__);
|
|
|
|
|
|
|
|
GdipDeleteFont(font);
|
|
|
|
|
|
|
|
/* Tahoma,13 */
|
2020-12-09 02:40:09 +01:00
|
|
|
lstrcpyW(lf.lfFaceName, L"Tahoma");
|
2012-05-11 12:21:36 +02:00
|
|
|
lf.lfHeight = 13;
|
|
|
|
stat = GdipCreateFontFromLogfontW(hdc, &lf, &font);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
stat = GdipGetFontUnit(font, &unit);
|
|
|
|
expect(Ok, stat);
|
|
|
|
expect(UnitWorld, unit);
|
|
|
|
|
|
|
|
gdip_get_font_metrics(font, &fm_gdip);
|
|
|
|
trace("gdiplus:\n");
|
|
|
|
trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
|
|
|
|
wine_dbgstr_w(lf.lfFaceName), lf.lfHeight,
|
|
|
|
fm_gdip.em_height, fm_gdip.line_spacing, fm_gdip.ascent, fm_gdip.descent,
|
|
|
|
fm_gdip.font_height, fm_gdip.font_size);
|
|
|
|
|
|
|
|
gdi_get_font_metrics(&lf, &fm_gdi);
|
|
|
|
trace("gdi:\n");
|
|
|
|
trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
|
|
|
|
wine_dbgstr_w(lf.lfFaceName), lf.lfHeight,
|
|
|
|
fm_gdi.em_height, fm_gdi.line_spacing, fm_gdi.ascent, fm_gdi.descent,
|
|
|
|
fm_gdi.font_height, fm_gdi.font_size);
|
|
|
|
|
|
|
|
cmp_font_metrics(&fm_gdip, &fm_gdi, __LINE__);
|
|
|
|
|
|
|
|
stat = GdipGetLogFontW(font, graphics, &lf);
|
|
|
|
expect(Ok, stat);
|
|
|
|
ok(lf.lfHeight < 0, "lf.lfHeight should be negative, got %d\n", lf.lfHeight);
|
|
|
|
gdi_get_font_metrics(&lf, &fm_gdi);
|
|
|
|
trace("gdi:\n");
|
|
|
|
trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
|
|
|
|
wine_dbgstr_w(lf.lfFaceName), lf.lfHeight,
|
|
|
|
fm_gdi.em_height, fm_gdi.line_spacing, fm_gdi.ascent, fm_gdi.descent,
|
|
|
|
fm_gdi.font_height, fm_gdi.font_size);
|
|
|
|
ok((REAL)lf.lfHeight * -1.0 == fm_gdi.font_size, "expected %f, got %f\n", (REAL)lf.lfHeight * -1.0, fm_gdi.font_size);
|
|
|
|
|
|
|
|
cmp_font_metrics(&fm_gdip, &fm_gdi, __LINE__);
|
|
|
|
|
|
|
|
GdipDeleteFont(font);
|
|
|
|
|
2020-12-09 02:40:09 +01:00
|
|
|
stat = GdipCreateFontFamilyFromName(L"Tahoma", NULL, &family);
|
2012-05-11 12:21:36 +02:00
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
/* Tahoma,13 */
|
|
|
|
stat = GdipCreateFont(family, 13.0, FontStyleRegular, UnitPixel, &font);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
gdip_get_font_metrics(font, &fm_gdip);
|
|
|
|
trace("gdiplus:\n");
|
|
|
|
trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
|
|
|
|
wine_dbgstr_w(lf.lfFaceName), lf.lfHeight,
|
|
|
|
fm_gdip.em_height, fm_gdip.line_spacing, fm_gdip.ascent, fm_gdip.descent,
|
|
|
|
fm_gdip.font_height, fm_gdip.font_size);
|
|
|
|
|
|
|
|
stat = GdipGetLogFontW(font, graphics, &lf);
|
|
|
|
expect(Ok, stat);
|
|
|
|
ok(lf.lfHeight < 0, "lf.lfHeight should be negative, got %d\n", lf.lfHeight);
|
|
|
|
gdi_get_font_metrics(&lf, &fm_gdi);
|
|
|
|
trace("gdi:\n");
|
|
|
|
trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
|
|
|
|
wine_dbgstr_w(lf.lfFaceName), lf.lfHeight,
|
|
|
|
fm_gdi.em_height, fm_gdi.line_spacing, fm_gdi.ascent, fm_gdi.descent,
|
|
|
|
fm_gdi.font_height, fm_gdi.font_size);
|
|
|
|
ok((REAL)lf.lfHeight * -1.0 == fm_gdi.font_size, "expected %f, got %f\n", (REAL)lf.lfHeight * -1.0, fm_gdi.font_size);
|
|
|
|
|
|
|
|
cmp_font_metrics(&fm_gdip, &fm_gdi, __LINE__);
|
|
|
|
|
|
|
|
stat = GdipGetLogFontW(font, NULL, &lf);
|
|
|
|
expect(InvalidParameter, stat);
|
|
|
|
|
|
|
|
GdipDeleteFont(font);
|
|
|
|
|
|
|
|
stat = GdipCreateFont(family, -13.0, FontStyleRegular, UnitPixel, &font);
|
|
|
|
expect(InvalidParameter, stat);
|
|
|
|
|
|
|
|
GdipDeleteFontFamily(family);
|
|
|
|
|
|
|
|
GdipDeleteGraphics(graphics);
|
|
|
|
DeleteDC(hdc);
|
|
|
|
}
|
|
|
|
|
2012-09-27 08:52:07 +02:00
|
|
|
static void test_font_substitution(void)
|
|
|
|
{
|
2015-11-25 12:30:00 +01:00
|
|
|
char fallback_font[LF_FACESIZE];
|
2012-09-27 08:52:07 +02:00
|
|
|
HDC hdc;
|
2013-10-16 05:49:40 +02:00
|
|
|
LOGFONTA lf;
|
2012-09-27 08:52:07 +02:00
|
|
|
GpStatus status;
|
|
|
|
GpGraphics *graphics;
|
|
|
|
GpFont *font;
|
|
|
|
GpFontFamily *family;
|
|
|
|
|
|
|
|
hdc = CreateCompatibleDC(0);
|
|
|
|
status = GdipCreateFromHDC(hdc, &graphics);
|
|
|
|
expect(Ok, status);
|
|
|
|
|
2020-03-22 20:46:16 +01:00
|
|
|
memset(&lf, 0, sizeof(lf));
|
|
|
|
lstrcpyA(lf.lfFaceName, "MS Shell Dlg");
|
2012-09-27 08:52:07 +02:00
|
|
|
|
|
|
|
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
|
|
|
|
expect(Ok, status);
|
|
|
|
memset(&lf, 0xfe, sizeof(lf));
|
|
|
|
status = GdipGetLogFontA(font, graphics, &lf);
|
|
|
|
expect(Ok, status);
|
2020-03-22 20:46:17 +01:00
|
|
|
ok(lstrcmpA(lf.lfFaceName, "MS Shell Dlg") != 0, "expected substitution of MS Shell Dlg\n");
|
2012-09-27 08:52:07 +02:00
|
|
|
GdipDeleteFont(font);
|
|
|
|
|
2020-03-22 20:46:16 +01:00
|
|
|
status = GdipCreateFontFamilyFromName(L"MS Shell Dlg", NULL, &family);
|
2012-09-27 08:52:07 +02:00
|
|
|
expect(Ok, status);
|
|
|
|
status = GdipCreateFont(family, 12, FontStyleRegular, UnitPoint, &font);
|
|
|
|
expect(Ok, status);
|
|
|
|
memset(&lf, 0xfe, sizeof(lf));
|
|
|
|
status = GdipGetLogFontA(font, graphics, &lf);
|
|
|
|
expect(Ok, status);
|
2020-03-22 20:46:17 +01:00
|
|
|
ok(lstrcmpA(lf.lfFaceName, "MS Shell Dlg") != 0, "expected substitution of MS Shell Dlg\n");
|
2012-09-27 08:52:07 +02:00
|
|
|
GdipDeleteFont(font);
|
|
|
|
GdipDeleteFontFamily(family);
|
|
|
|
|
2020-12-09 02:40:09 +01:00
|
|
|
status = GdipCreateFontFamilyFromName(L"ThisFontShouldNotExist", NULL, &family);
|
2012-09-27 08:52:07 +02:00
|
|
|
ok(status == FontFamilyNotFound, "expected FontFamilyNotFound, got %d\n", status);
|
|
|
|
|
2015-11-25 12:30:00 +01:00
|
|
|
/* nonexistent fonts fallback to Arial, or something else if it's missing */
|
|
|
|
strcpy(lf.lfFaceName,"Arial");
|
|
|
|
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
|
|
|
|
expect(Ok, status);
|
|
|
|
status = GdipGetLogFontA(font, graphics, &lf);
|
|
|
|
expect(Ok, status);
|
|
|
|
strcpy(fallback_font,lf.lfFaceName);
|
|
|
|
trace("fallback font %s\n", fallback_font);
|
2016-05-30 21:52:50 +02:00
|
|
|
GdipDeleteFont(font);
|
2015-11-25 12:30:00 +01:00
|
|
|
|
2013-10-16 05:49:40 +02:00
|
|
|
lstrcpyA(lf.lfFaceName, "ThisFontShouldNotExist");
|
2012-09-27 08:52:07 +02:00
|
|
|
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
|
|
|
|
expect(Ok, status);
|
|
|
|
memset(&lf, 0xfe, sizeof(lf));
|
|
|
|
status = GdipGetLogFontA(font, graphics, &lf);
|
|
|
|
expect(Ok, status);
|
2015-11-25 12:30:00 +01:00
|
|
|
ok(!lstrcmpA(lf.lfFaceName, fallback_font), "wrong face name %s / %s\n", lf.lfFaceName, fallback_font);
|
2012-09-27 08:52:07 +02:00
|
|
|
GdipDeleteFont(font);
|
|
|
|
|
|
|
|
/* empty FaceName */
|
|
|
|
lf.lfFaceName[0] = 0;
|
|
|
|
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
|
|
|
|
expect(Ok, status);
|
|
|
|
memset(&lf, 0xfe, sizeof(lf));
|
|
|
|
status = GdipGetLogFontA(font, graphics, &lf);
|
|
|
|
expect(Ok, status);
|
2015-11-25 12:30:00 +01:00
|
|
|
ok(!lstrcmpA(lf.lfFaceName, fallback_font), "wrong face name %s / %s\n", lf.lfFaceName, fallback_font);
|
2012-09-27 08:52:07 +02:00
|
|
|
GdipDeleteFont(font);
|
|
|
|
|
|
|
|
/* zeroing out lfWeight and lfCharSet leads to font creation failure */
|
|
|
|
lf.lfWeight = 0;
|
|
|
|
lf.lfCharSet = 0;
|
2013-10-16 05:49:40 +02:00
|
|
|
lstrcpyA(lf.lfFaceName, "ThisFontShouldNotExist");
|
2014-04-25 11:49:41 +02:00
|
|
|
font = NULL;
|
2012-09-27 08:52:07 +02:00
|
|
|
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
|
2012-09-27 08:52:29 +02:00
|
|
|
todo_wine
|
2012-09-27 08:52:07 +02:00
|
|
|
ok(status == NotTrueTypeFont || broken(status == FileNotFound), /* before XP */
|
|
|
|
"expected NotTrueTypeFont, got %d\n", status);
|
2014-04-25 11:49:41 +02:00
|
|
|
/* FIXME: remove when wine is fixed */
|
|
|
|
if (font) GdipDeleteFont(font);
|
2012-09-27 08:52:07 +02:00
|
|
|
|
|
|
|
/* empty FaceName */
|
|
|
|
lf.lfFaceName[0] = 0;
|
2014-04-25 11:49:41 +02:00
|
|
|
font = NULL;
|
2012-09-27 08:52:07 +02:00
|
|
|
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
|
2012-09-27 08:52:29 +02:00
|
|
|
todo_wine
|
2012-09-27 08:52:07 +02:00
|
|
|
ok(status == NotTrueTypeFont || broken(status == FileNotFound), /* before XP */
|
|
|
|
"expected NotTrueTypeFont, got %d\n", status);
|
2014-04-25 11:49:41 +02:00
|
|
|
/* FIXME: remove when wine is fixed */
|
|
|
|
if (font) GdipDeleteFont(font);
|
2012-09-27 08:52:07 +02:00
|
|
|
|
|
|
|
GdipDeleteGraphics(graphics);
|
|
|
|
DeleteDC(hdc);
|
|
|
|
}
|
|
|
|
|
2012-10-08 09:48:59 +02:00
|
|
|
static void test_font_transform(void)
|
|
|
|
{
|
2020-12-09 03:31:14 +01:00
|
|
|
static const WCHAR string[] = L"A";
|
2012-10-08 09:48:59 +02:00
|
|
|
GpStatus status;
|
|
|
|
HDC hdc;
|
2013-10-16 05:49:40 +02:00
|
|
|
LOGFONTA lf;
|
2012-10-08 09:48:59 +02:00
|
|
|
GpFont *font;
|
|
|
|
GpGraphics *graphics;
|
|
|
|
GpMatrix *matrix;
|
2012-10-09 11:41:47 +02:00
|
|
|
GpStringFormat *format, *typographic;
|
|
|
|
PointF pos[1] = { { 0,0 } };
|
2012-10-11 12:49:13 +02:00
|
|
|
REAL height, margin_y;
|
2012-10-09 11:41:47 +02:00
|
|
|
RectF bounds, rect;
|
2012-10-08 09:48:59 +02:00
|
|
|
|
|
|
|
hdc = CreateCompatibleDC(0);
|
|
|
|
status = GdipCreateFromHDC(hdc, &graphics);
|
|
|
|
expect(Ok, status);
|
|
|
|
|
2012-10-09 11:41:47 +02:00
|
|
|
status = GdipSetPageUnit(graphics, UnitPixel);
|
|
|
|
expect(Ok, status);
|
|
|
|
|
|
|
|
status = GdipCreateStringFormat(0, LANG_NEUTRAL, &format);
|
|
|
|
expect(Ok, status);
|
|
|
|
status = GdipStringFormatGetGenericTypographic(&typographic);
|
|
|
|
expect(Ok, status);
|
|
|
|
|
2012-10-08 09:48:59 +02:00
|
|
|
memset(&lf, 0, sizeof(lf));
|
2013-10-16 05:49:40 +02:00
|
|
|
lstrcpyA(lf.lfFaceName, "Tahoma");
|
2012-10-08 09:48:59 +02:00
|
|
|
lf.lfHeight = -100;
|
|
|
|
lf.lfWidth = 100;
|
|
|
|
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
|
|
|
|
expect(Ok, status);
|
|
|
|
|
2012-10-11 12:49:13 +02:00
|
|
|
margin_y = 100.0 / 8.0;
|
|
|
|
|
2012-10-08 09:48:59 +02:00
|
|
|
/* identity matrix */
|
|
|
|
status = GdipCreateMatrix(&matrix);
|
|
|
|
expect(Ok, status);
|
|
|
|
status = GdipSetWorldTransform(graphics, matrix);
|
|
|
|
expect(Ok, status);
|
|
|
|
status = GdipGetLogFontA(font, graphics, &lf);
|
|
|
|
expect(Ok, status);
|
|
|
|
expect(-100, lf.lfHeight);
|
|
|
|
expect(0, lf.lfWidth);
|
2012-10-23 10:27:48 +02:00
|
|
|
expect(0, lf.lfEscapement);
|
|
|
|
expect(0, lf.lfOrientation);
|
2012-10-09 11:41:47 +02:00
|
|
|
status = GdipGetFontHeight(font, graphics, &height);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(120.703125, height);
|
|
|
|
set_rect_empty(&rect);
|
|
|
|
set_rect_empty(&bounds);
|
|
|
|
status = GdipMeasureString(graphics, string, -1, font, &rect, format, &bounds, NULL, NULL);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(0.0, bounds.X);
|
|
|
|
expectf(0.0, bounds.Y);
|
|
|
|
todo_wine
|
2012-10-11 12:49:13 +02:00
|
|
|
expectf(height + margin_y, bounds.Height);
|
2012-10-09 11:41:47 +02:00
|
|
|
set_rect_empty(&rect);
|
|
|
|
set_rect_empty(&bounds);
|
|
|
|
status = GdipMeasureString(graphics, string, -1, font, &rect, typographic, &bounds, NULL, NULL);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(0.0, bounds.X);
|
|
|
|
expectf(0.0, bounds.Y);
|
2013-06-19 10:23:27 +02:00
|
|
|
expectf_(height, bounds.Height, 1.0);
|
2012-10-09 11:41:47 +02:00
|
|
|
set_rect_empty(&bounds);
|
|
|
|
status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
|
|
|
|
DriverStringOptionsCmapLookup, NULL, &bounds);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(0.0, bounds.X);
|
|
|
|
expectf_(-100.0, bounds.Y, 0.05);
|
2013-06-19 10:23:27 +02:00
|
|
|
expectf_(height, bounds.Height, 0.5);
|
2012-10-12 07:00:53 +02:00
|
|
|
set_rect_empty(&bounds);
|
|
|
|
status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
|
|
|
|
DriverStringOptionsCmapLookup, matrix, &bounds);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(0.0, bounds.X);
|
|
|
|
expectf_(-100.0, bounds.Y, 0.05);
|
2013-06-19 10:23:27 +02:00
|
|
|
expectf_(height, bounds.Height, 0.5);
|
2012-10-08 09:48:59 +02:00
|
|
|
|
|
|
|
/* scale matrix */
|
|
|
|
status = GdipScaleMatrix(matrix, 2.0, 3.0, MatrixOrderAppend);
|
|
|
|
expect(Ok, status);
|
|
|
|
status = GdipSetWorldTransform(graphics, matrix);
|
|
|
|
expect(Ok, status);
|
|
|
|
status = GdipGetLogFontA(font, graphics, &lf);
|
|
|
|
expect(Ok, status);
|
|
|
|
expect(-300, lf.lfHeight);
|
|
|
|
expect(0, lf.lfWidth);
|
2012-10-23 10:27:48 +02:00
|
|
|
expect(0, lf.lfEscapement);
|
|
|
|
expect(0, lf.lfOrientation);
|
2012-10-09 11:41:47 +02:00
|
|
|
status = GdipGetFontHeight(font, graphics, &height);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(120.703125, height);
|
|
|
|
set_rect_empty(&rect);
|
|
|
|
set_rect_empty(&bounds);
|
|
|
|
status = GdipMeasureString(graphics, string, -1, font, &rect, format, &bounds, NULL, NULL);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(0.0, bounds.X);
|
|
|
|
expectf(0.0, bounds.Y);
|
|
|
|
todo_wine
|
2012-10-11 12:49:13 +02:00
|
|
|
expectf(height + margin_y, bounds.Height);
|
2012-10-09 11:41:47 +02:00
|
|
|
set_rect_empty(&rect);
|
|
|
|
set_rect_empty(&bounds);
|
|
|
|
status = GdipMeasureString(graphics, string, -1, font, &rect, typographic, &bounds, NULL, NULL);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(0.0, bounds.X);
|
|
|
|
expectf(0.0, bounds.Y);
|
2013-06-19 10:23:27 +02:00
|
|
|
expectf_(height, bounds.Height, 0.05);
|
2012-10-09 11:41:47 +02:00
|
|
|
set_rect_empty(&bounds);
|
|
|
|
status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
|
|
|
|
DriverStringOptionsCmapLookup, NULL, &bounds);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(0.0, bounds.X);
|
|
|
|
expectf_(-100.0, bounds.Y, 0.05);
|
2013-06-19 10:23:27 +02:00
|
|
|
expectf_(height, bounds.Height, 0.2);
|
2012-10-12 07:00:53 +02:00
|
|
|
set_rect_empty(&bounds);
|
|
|
|
status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
|
|
|
|
DriverStringOptionsCmapLookup, matrix, &bounds);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(0.0, bounds.X);
|
|
|
|
todo_wine
|
|
|
|
expectf_(-300.0, bounds.Y, 0.15);
|
|
|
|
todo_wine
|
|
|
|
expectf(height * 3.0, bounds.Height);
|
2012-10-08 09:48:59 +02:00
|
|
|
|
|
|
|
/* scale + ratate matrix */
|
|
|
|
status = GdipRotateMatrix(matrix, 45.0, MatrixOrderAppend);
|
|
|
|
expect(Ok, status);
|
|
|
|
status = GdipSetWorldTransform(graphics, matrix);
|
|
|
|
expect(Ok, status);
|
|
|
|
status = GdipGetLogFontA(font, graphics, &lf);
|
|
|
|
expect(Ok, status);
|
|
|
|
expect(-300, lf.lfHeight);
|
|
|
|
expect(0, lf.lfWidth);
|
2012-10-24 11:11:29 +02:00
|
|
|
expect_(3151, lf.lfEscapement, 1);
|
|
|
|
expect_(3151, lf.lfOrientation, 1);
|
2012-10-09 11:41:47 +02:00
|
|
|
status = GdipGetFontHeight(font, graphics, &height);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(120.703125, height);
|
|
|
|
set_rect_empty(&rect);
|
|
|
|
set_rect_empty(&bounds);
|
|
|
|
status = GdipMeasureString(graphics, string, -1, font, &rect, format, &bounds, NULL, NULL);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(0.0, bounds.X);
|
|
|
|
expectf(0.0, bounds.Y);
|
|
|
|
todo_wine
|
2012-10-11 12:49:13 +02:00
|
|
|
expectf(height + margin_y, bounds.Height);
|
2012-10-09 11:41:47 +02:00
|
|
|
set_rect_empty(&rect);
|
|
|
|
set_rect_empty(&bounds);
|
|
|
|
status = GdipMeasureString(graphics, string, -1, font, &rect, typographic, &bounds, NULL, NULL);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(0.0, bounds.X);
|
|
|
|
expectf(0.0, bounds.Y);
|
2013-06-19 10:23:27 +02:00
|
|
|
expectf_(height, bounds.Height, 0.05);
|
2012-10-09 11:41:47 +02:00
|
|
|
set_rect_empty(&bounds);
|
|
|
|
status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
|
|
|
|
DriverStringOptionsCmapLookup, NULL, &bounds);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(0.0, bounds.X);
|
|
|
|
expectf_(-100.0, bounds.Y, 0.05);
|
2013-06-19 10:23:27 +02:00
|
|
|
expectf_(height, bounds.Height, 0.2);
|
2012-10-12 07:00:53 +02:00
|
|
|
set_rect_empty(&bounds);
|
|
|
|
status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
|
|
|
|
DriverStringOptionsCmapLookup, matrix, &bounds);
|
|
|
|
expect(Ok, status);
|
|
|
|
todo_wine
|
|
|
|
expectf_(-43.814377, bounds.X, 0.05);
|
|
|
|
todo_wine
|
|
|
|
expectf_(-212.235611, bounds.Y, 0.05);
|
|
|
|
todo_wine
|
|
|
|
expectf_(340.847534, bounds.Height, 0.05);
|
2012-10-08 09:48:59 +02:00
|
|
|
|
|
|
|
/* scale + ratate + shear matrix */
|
|
|
|
status = GdipShearMatrix(matrix, 4.0, 5.0, MatrixOrderAppend);
|
|
|
|
expect(Ok, status);
|
|
|
|
status = GdipSetWorldTransform(graphics, matrix);
|
|
|
|
expect(Ok, status);
|
|
|
|
status = GdipGetLogFontA(font, graphics, &lf);
|
|
|
|
expect(Ok, status);
|
|
|
|
todo_wine
|
|
|
|
expect(1032, lf.lfHeight);
|
|
|
|
expect(0, lf.lfWidth);
|
2012-10-24 11:11:29 +02:00
|
|
|
expect_(3099, lf.lfEscapement, 1);
|
|
|
|
expect_(3099, lf.lfOrientation, 1);
|
2012-10-09 11:41:47 +02:00
|
|
|
status = GdipGetFontHeight(font, graphics, &height);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(120.703125, height);
|
|
|
|
set_rect_empty(&rect);
|
|
|
|
set_rect_empty(&bounds);
|
|
|
|
status = GdipMeasureString(graphics, string, -1, font, &rect, format, &bounds, NULL, NULL);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(0.0, bounds.X);
|
|
|
|
expectf(0.0, bounds.Y);
|
|
|
|
todo_wine
|
2012-10-11 12:49:13 +02:00
|
|
|
expectf(height + margin_y, bounds.Height);
|
2012-10-09 11:41:47 +02:00
|
|
|
set_rect_empty(&rect);
|
|
|
|
set_rect_empty(&bounds);
|
|
|
|
status = GdipMeasureString(graphics, string, -1, font, &rect, typographic, &bounds, NULL, NULL);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(0.0, bounds.X);
|
|
|
|
expectf(0.0, bounds.Y);
|
2013-06-19 10:23:27 +02:00
|
|
|
expectf_(height, bounds.Height, 0.2);
|
2012-10-09 11:41:47 +02:00
|
|
|
set_rect_empty(&bounds);
|
|
|
|
status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
|
|
|
|
DriverStringOptionsCmapLookup, NULL, &bounds);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(0.0, bounds.X);
|
2013-06-19 10:23:27 +02:00
|
|
|
expectf_(-100.0, bounds.Y, 0.2);
|
|
|
|
expectf_(height, bounds.Height, 0.2);
|
2012-10-12 07:00:53 +02:00
|
|
|
set_rect_empty(&bounds);
|
|
|
|
status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
|
|
|
|
DriverStringOptionsCmapLookup, matrix, &bounds);
|
|
|
|
expect(Ok, status);
|
|
|
|
todo_wine
|
|
|
|
expectf_(-636.706848, bounds.X, 0.05);
|
|
|
|
todo_wine
|
|
|
|
expectf_(-175.257523, bounds.Y, 0.05);
|
|
|
|
todo_wine
|
|
|
|
expectf_(1532.984985, bounds.Height, 0.05);
|
2012-10-09 11:41:47 +02:00
|
|
|
|
|
|
|
/* scale + ratate + shear + translate matrix */
|
|
|
|
status = GdipTranslateMatrix(matrix, 10.0, 20.0, MatrixOrderAppend);
|
|
|
|
expect(Ok, status);
|
|
|
|
status = GdipSetWorldTransform(graphics, matrix);
|
|
|
|
expect(Ok, status);
|
|
|
|
status = GdipGetLogFontA(font, graphics, &lf);
|
|
|
|
expect(Ok, status);
|
|
|
|
todo_wine
|
|
|
|
expect(1032, lf.lfHeight);
|
|
|
|
expect(0, lf.lfWidth);
|
2012-10-24 11:11:29 +02:00
|
|
|
expect_(3099, lf.lfEscapement, 1);
|
|
|
|
expect_(3099, lf.lfOrientation, 1);
|
2012-10-09 11:41:47 +02:00
|
|
|
status = GdipGetFontHeight(font, graphics, &height);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(120.703125, height);
|
|
|
|
set_rect_empty(&rect);
|
|
|
|
set_rect_empty(&bounds);
|
|
|
|
status = GdipMeasureString(graphics, string, -1, font, &rect, format, &bounds, NULL, NULL);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(0.0, bounds.X);
|
|
|
|
expectf(0.0, bounds.Y);
|
|
|
|
todo_wine
|
2012-10-11 12:49:13 +02:00
|
|
|
expectf(height + margin_y, bounds.Height);
|
2012-10-09 11:41:47 +02:00
|
|
|
set_rect_empty(&rect);
|
|
|
|
set_rect_empty(&bounds);
|
|
|
|
status = GdipMeasureString(graphics, string, -1, font, &rect, typographic, &bounds, NULL, NULL);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(0.0, bounds.X);
|
|
|
|
expectf(0.0, bounds.Y);
|
2013-06-19 10:23:27 +02:00
|
|
|
expectf_(height, bounds.Height, 0.1);
|
2012-10-09 11:41:47 +02:00
|
|
|
set_rect_empty(&bounds);
|
|
|
|
status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
|
|
|
|
DriverStringOptionsCmapLookup, NULL, &bounds);
|
|
|
|
expect(Ok, status);
|
|
|
|
expectf(0.0, bounds.X);
|
2013-06-19 10:23:27 +02:00
|
|
|
expectf_(-100.0, bounds.Y, 0.2);
|
|
|
|
expectf_(height, bounds.Height, 0.2);
|
2012-10-12 07:00:53 +02:00
|
|
|
set_rect_empty(&bounds);
|
|
|
|
status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
|
|
|
|
DriverStringOptionsCmapLookup, matrix, &bounds);
|
|
|
|
expect(Ok, status);
|
|
|
|
todo_wine
|
|
|
|
expectf_(-626.706848, bounds.X, 0.05);
|
|
|
|
todo_wine
|
|
|
|
expectf_(-155.257523, bounds.Y, 0.05);
|
|
|
|
todo_wine
|
|
|
|
expectf_(1532.984985, bounds.Height, 0.05);
|
2012-10-08 09:48:59 +02:00
|
|
|
|
|
|
|
GdipDeleteMatrix(matrix);
|
|
|
|
GdipDeleteFont(font);
|
|
|
|
GdipDeleteGraphics(graphics);
|
2012-10-09 11:41:47 +02:00
|
|
|
GdipDeleteStringFormat(typographic);
|
|
|
|
GdipDeleteStringFormat(format);
|
2012-10-08 09:48:59 +02:00
|
|
|
DeleteDC(hdc);
|
|
|
|
}
|
|
|
|
|
2017-11-21 07:32:07 +01:00
|
|
|
static void test_GdipGetFontCollectionFamilyList(void)
|
|
|
|
{
|
2019-01-26 15:23:04 +01:00
|
|
|
GpFontFamily *family, *family2, **families;
|
2017-11-21 07:32:07 +01:00
|
|
|
GpFontCollection *collection;
|
2019-01-26 15:23:04 +01:00
|
|
|
UINT i;
|
2017-11-21 07:32:07 +01:00
|
|
|
INT found, count;
|
|
|
|
GpStatus status;
|
|
|
|
|
|
|
|
status = GdipNewInstalledFontCollection(&collection);
|
|
|
|
ok(status == Ok, "Failed to get system collection, status %d.\n", status);
|
|
|
|
|
|
|
|
count = 0;
|
|
|
|
status = GdipGetFontCollectionFamilyCount(collection, &count);
|
|
|
|
ok(status == Ok, "Failed to get family count, status %d.\n", status);
|
|
|
|
ok(count > 0, "Unexpected empty collection.\n");
|
|
|
|
|
|
|
|
status = GdipGetFontCollectionFamilyList(NULL, 0, NULL, NULL);
|
|
|
|
ok(status == InvalidParameter, "Unexpected status %d.\n", status);
|
|
|
|
|
|
|
|
found = 123;
|
|
|
|
status = GdipGetFontCollectionFamilyList(NULL, 0, NULL, &found);
|
|
|
|
ok(status == InvalidParameter, "Unexpected status %d.\n", status);
|
|
|
|
ok(found == 123, "Unexpected list count %d.\n", found);
|
|
|
|
|
|
|
|
status = GdipGetFontCollectionFamilyList(collection, 0, NULL, NULL);
|
|
|
|
ok(status == InvalidParameter, "Unexpected status %d.\n", status);
|
|
|
|
|
|
|
|
found = 123;
|
|
|
|
status = GdipGetFontCollectionFamilyList(collection, 0, NULL, &found);
|
|
|
|
ok(status == InvalidParameter, "Unexpected status %d.\n", status);
|
|
|
|
ok(found == 123, "Unexpected list count %d.\n", found);
|
|
|
|
|
|
|
|
found = 123;
|
|
|
|
status = GdipGetFontCollectionFamilyList(collection, 1, NULL, &found);
|
|
|
|
ok(status == InvalidParameter, "Unexpected status %d.\n", status);
|
|
|
|
ok(found == 123, "Unexpected list count %d.\n", found);
|
|
|
|
|
|
|
|
family = NULL;
|
|
|
|
found = 0;
|
|
|
|
status = GdipGetFontCollectionFamilyList(collection, 1, &family, &found);
|
|
|
|
ok(status == Ok, "Failed to get family list, status %d.\n", status);
|
|
|
|
ok(found == 1, "Unexpected list count %d.\n", found);
|
|
|
|
ok(family != NULL, "Expected family instance.\n");
|
|
|
|
|
2019-01-26 15:23:04 +01:00
|
|
|
family2 = NULL;
|
2017-11-21 07:32:07 +01:00
|
|
|
found = 0;
|
|
|
|
status = GdipGetFontCollectionFamilyList(collection, 1, &family2, &found);
|
|
|
|
ok(status == Ok, "Failed to get family list, status %d.\n", status);
|
|
|
|
ok(found == 1, "Unexpected list count %d.\n", found);
|
2019-01-26 15:23:04 +01:00
|
|
|
ok(family2 == family, "Unexpected family instance.\n");
|
2017-11-21 07:32:07 +01:00
|
|
|
|
2019-01-26 15:23:04 +01:00
|
|
|
status = GdipDeleteFontFamily(family);
|
|
|
|
expect(Ok, status);
|
|
|
|
|
|
|
|
status = GdipDeleteFontFamily(family2);
|
|
|
|
expect(Ok, status);
|
|
|
|
|
|
|
|
families = GdipAlloc((count + 1) * sizeof(*families));
|
|
|
|
found = 0;
|
|
|
|
status = GdipGetFontCollectionFamilyList(collection, count + 1, families, &found);
|
|
|
|
ok(status == Ok, "Failed to get family list, status %d.\n", status);
|
|
|
|
ok(found == count, "Unexpected list count %d, extected %d.\n", found, count);
|
|
|
|
|
|
|
|
for (i = 0; i < found; i++)
|
|
|
|
{
|
|
|
|
status = GdipDeleteFontFamily(families[i]);
|
|
|
|
expect(Ok, status);
|
|
|
|
}
|
|
|
|
GdipFree(families);
|
2017-11-21 07:32:07 +01:00
|
|
|
}
|
|
|
|
|
2018-11-01 10:53:27 +01:00
|
|
|
static void test_GdipGetFontCollectionFamilyCount(void)
|
|
|
|
{
|
|
|
|
GpFontCollection *collection;
|
|
|
|
GpStatus status;
|
|
|
|
INT count;
|
|
|
|
|
|
|
|
status = GdipGetFontCollectionFamilyCount(NULL, NULL);
|
|
|
|
ok(status == InvalidParameter, "Unexpected status %d.\n", status);
|
|
|
|
|
|
|
|
count = 123;
|
|
|
|
status = GdipGetFontCollectionFamilyCount(NULL, &count);
|
|
|
|
ok(status == InvalidParameter, "Unexpected status %d.\n", status);
|
|
|
|
ok(count == 123, "Unexpected family count %d.\n", count);
|
|
|
|
|
|
|
|
status = GdipNewInstalledFontCollection(&collection);
|
|
|
|
ok(status == Ok, "Failed to get system collection, status %d.\n", status);
|
|
|
|
|
|
|
|
status = GdipGetFontCollectionFamilyCount(collection, NULL);
|
|
|
|
ok(status == InvalidParameter, "Unexpected status %d.\n", status);
|
|
|
|
}
|
|
|
|
|
2020-01-31 09:47:17 +01:00
|
|
|
static BOOL is_family_in_collection(GpFontCollection *collection, GpFontFamily *family)
|
|
|
|
{
|
|
|
|
GpStatus status;
|
|
|
|
GpFontFamily **list;
|
|
|
|
int count, i;
|
|
|
|
BOOL found = FALSE;
|
|
|
|
|
|
|
|
status = GdipGetFontCollectionFamilyCount(collection, &count);
|
|
|
|
expect(Ok, status);
|
|
|
|
|
|
|
|
list = GdipAlloc(count * sizeof(GpFontFamily *));
|
|
|
|
status = GdipGetFontCollectionFamilyList(collection, count, list, &count);
|
|
|
|
expect(Ok, status);
|
|
|
|
|
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
{
|
|
|
|
if (list[i] == family)
|
|
|
|
{
|
|
|
|
found = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GdipFree(list);
|
|
|
|
|
|
|
|
return found;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_CloneFont(void)
|
|
|
|
{
|
|
|
|
GpStatus status;
|
|
|
|
GpFontCollection *collection, *collection2;
|
|
|
|
GpFont *font, *font2;
|
|
|
|
GpFontFamily *family, *family2;
|
|
|
|
REAL height;
|
|
|
|
Unit unit;
|
|
|
|
int style;
|
|
|
|
BOOL ret;
|
|
|
|
|
|
|
|
status = GdipNewInstalledFontCollection(&collection);
|
|
|
|
expect(Ok, status);
|
|
|
|
|
|
|
|
status = GdipNewInstalledFontCollection(&collection2);
|
|
|
|
expect(Ok, status);
|
|
|
|
ok(collection == collection2, "got %p\n", collection2);
|
|
|
|
|
2020-12-09 02:40:09 +01:00
|
|
|
status = GdipCreateFontFamilyFromName(L"ThisFontShouldNotExist", NULL, &family);
|
2020-01-31 09:47:17 +01:00
|
|
|
expect(FontFamilyNotFound, status);
|
|
|
|
|
2020-12-09 02:40:09 +01:00
|
|
|
status = GdipCreateFontFamilyFromName(L"ThisFontShouldNotExist", collection, &family);
|
2020-01-31 09:47:17 +01:00
|
|
|
expect(FontFamilyNotFound, status);
|
|
|
|
|
2020-12-09 02:40:09 +01:00
|
|
|
status = GdipCreateFontFamilyFromName(L"Tahoma", NULL, &family);
|
2020-01-31 09:47:17 +01:00
|
|
|
expect(Ok, status);
|
|
|
|
|
|
|
|
ret = is_family_in_collection(collection, family);
|
|
|
|
ok(ret, "family is not in collection\n");
|
|
|
|
|
|
|
|
status = GdipCreateFont(family, 30.0f, FontStyleRegular, UnitPixel, &font);
|
|
|
|
expect(Ok, status);
|
|
|
|
|
|
|
|
status = GdipGetFontUnit(font, &unit);
|
|
|
|
expect(Ok, status);
|
|
|
|
ok(unit == UnitPixel, "got %u\n", unit);
|
|
|
|
|
|
|
|
status = GdipGetFontSize(font, &height);
|
|
|
|
expect(Ok, status);
|
|
|
|
ok(height == 30.0f, "got %f\n", height);
|
|
|
|
|
|
|
|
status = GdipGetFontStyle(font, &style);
|
|
|
|
expect(Ok, status);
|
|
|
|
ok(style == FontStyleRegular, "got %d\n", style);
|
|
|
|
|
|
|
|
status = GdipGetFamily(font, &family2);
|
|
|
|
expect(Ok, status);
|
|
|
|
ok(family == family2, "got %p\n", family2);
|
|
|
|
|
|
|
|
status = GdipCloneFont(font, &font2);
|
|
|
|
expect(Ok, status);
|
|
|
|
|
|
|
|
status = GdipGetFontUnit(font2, &unit);
|
|
|
|
expect(Ok, status);
|
|
|
|
ok(unit == UnitPixel, "got %u\n", unit);
|
|
|
|
|
|
|
|
status = GdipGetFontSize(font2, &height);
|
|
|
|
expect(Ok, status);
|
|
|
|
ok(height == 30.0f, "got %f\n", height);
|
|
|
|
|
|
|
|
status = GdipGetFontStyle(font2, &style);
|
|
|
|
expect(Ok, status);
|
|
|
|
ok(style == FontStyleRegular, "got %d\n", style);
|
|
|
|
|
|
|
|
status = GdipGetFamily(font2, &family2);
|
|
|
|
expect(Ok, status);
|
|
|
|
ok(family == family2, "got %p\n", family2);
|
|
|
|
|
|
|
|
GdipDeleteFont(font2);
|
|
|
|
GdipDeleteFont(font);
|
|
|
|
GdipDeleteFontFamily(family);
|
|
|
|
}
|
|
|
|
|
2007-08-15 03:58:59 +02:00
|
|
|
START_TEST(font)
|
|
|
|
{
|
|
|
|
struct GdiplusStartupInput gdiplusStartupInput;
|
|
|
|
ULONG_PTR gdiplusToken;
|
2017-07-25 22:15:48 +02:00
|
|
|
HMODULE hmsvcrt;
|
|
|
|
int (CDECL * _controlfp_s)(unsigned int *cur, unsigned int newval, unsigned int mask);
|
|
|
|
|
|
|
|
/* Enable all FP exceptions except _EM_INEXACT, which gdi32 can trigger */
|
|
|
|
hmsvcrt = LoadLibraryA("msvcrt");
|
|
|
|
_controlfp_s = (void*)GetProcAddress(hmsvcrt, "_controlfp_s");
|
|
|
|
if (_controlfp_s) _controlfp_s(0, 0, 0x0008001e);
|
2007-08-15 03:58:59 +02:00
|
|
|
|
|
|
|
gdiplusStartupInput.GdiplusVersion = 1;
|
|
|
|
gdiplusStartupInput.DebugEventCallback = NULL;
|
|
|
|
gdiplusStartupInput.SuppressBackgroundThread = 0;
|
|
|
|
gdiplusStartupInput.SuppressExternalCodecs = 0;
|
|
|
|
|
|
|
|
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
|
|
|
|
|
2020-01-31 09:47:17 +01:00
|
|
|
test_CloneFont();
|
2017-11-26 14:33:18 +01:00
|
|
|
test_long_name();
|
2012-10-08 09:48:59 +02:00
|
|
|
test_font_transform();
|
2012-09-27 08:52:07 +02:00
|
|
|
test_font_substitution();
|
2012-05-11 12:21:36 +02:00
|
|
|
test_font_metrics();
|
2008-06-21 19:02:56 +02:00
|
|
|
test_createfont();
|
2007-08-15 03:58:59 +02:00
|
|
|
test_logfont();
|
2008-06-21 19:02:51 +02:00
|
|
|
test_fontfamily();
|
2008-07-03 20:26:44 +02:00
|
|
|
test_fontfamily_properties();
|
2008-06-21 19:02:52 +02:00
|
|
|
test_getgenerics();
|
2009-01-28 23:08:43 +01:00
|
|
|
test_installedfonts();
|
2010-03-26 01:27:20 +01:00
|
|
|
test_heightgivendpi();
|
2017-11-21 07:32:07 +01:00
|
|
|
test_GdipGetFontCollectionFamilyList();
|
2018-11-01 10:53:27 +01:00
|
|
|
test_GdipGetFontCollectionFamilyCount();
|
2007-08-15 03:58:59 +02:00
|
|
|
|
|
|
|
GdiplusShutdown(gdiplusToken);
|
|
|
|
}
|