Alexandre Julliard : gdiplus/tests: Use Tahoma instead of Courier New for testing font metrics.
Alexandre Julliard
julliard at winehq.org
Thu Jul 1 11:19:31 CDT 2010
Module: wine
Branch: master
Commit: 5d71136611d49adda0c83895bfae067fcaaf951d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5d71136611d49adda0c83895bfae067fcaaf951d
Author: Alexandre Julliard <julliard at winehq.org>
Date: Thu Jul 1 11:38:46 2010 +0200
gdiplus/tests: Use Tahoma instead of Courier New for testing font metrics.
---
dlls/gdiplus/tests/graphics.c | 20 ++++++--------------
1 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c
index 57ce638..aaf661d 100644
--- a/dlls/gdiplus/tests/graphics.c
+++ b/dlls/gdiplus/tests/graphics.c
@@ -2411,9 +2411,8 @@ static void test_string_functions(void)
GpBrush *brush;
ARGB color = 0xff000000;
HDC hdc = GetDC( hwnd );
- const WCHAR fontname[] = {'C','o','u','r','i','e','r',' ','N','e','w',0};
- const WCHAR fontname2[] = {'C','o','u','r','i','e','r',0};
- const WCHAR teststring[] = {'o','o',' ','o','\n','o',0};
+ const WCHAR fontname[] = {'T','a','h','o','m','a',0};
+ const WCHAR teststring[] = {'M','M',' ','M','\n','M',0};
REAL char_width, char_height;
INT codepointsfitted, linesfilled;
GpStringFormat *format;
@@ -2428,14 +2427,6 @@ static void test_string_functions(void)
ok(graphics != NULL, "Expected graphics to be initialized\n");
status = GdipCreateFontFamilyFromName(fontname, NULL, &family);
-
- if (status != Ok)
- {
- /* Wine doesn't have Courier New? */
- todo_wine expect(Ok, status);
- status = GdipCreateFontFamilyFromName(fontname2, NULL, &family);
- }
-
expect(Ok, status);
status = GdipCreateFont(family, 10.0, FontStyleRegular, UnitPixel, &font);
@@ -2514,14 +2505,15 @@ static void test_string_functions(void)
expect(Ok, status);
expectf(0.0, bounds.X);
expectf(0.0, bounds.Y);
- expectf_(char_bounds.Width + char_width * 3, bounds.Width, 0.01);
+ ok(bounds.Width > char_bounds.Width + char_width * 2, "got %0.2f, expected at least %0.2f\n",
+ bounds.Width, char_bounds.Width + char_width * 2);
ok(bounds.Height > char_bounds.Height, "got %0.2f, expected at least %0.2f\n", bounds.Height, char_bounds.Height);
expect(6, codepointsfitted);
expect(2, linesfilled);
char_height = bounds.Height - char_bounds.Height;
/* Cut off everything after the first space. */
- rc.Width = char_bounds.Width + char_width * 2.5;
+ rc.Width = char_bounds.Width + char_width * 2.1;
status = GdipMeasureString(graphics, teststring, 6, font, &rc, NULL, &bounds, &codepointsfitted, &linesfilled);
expect(Ok, status);
@@ -2607,7 +2599,7 @@ static void test_string_functions(void)
ok(!region_isempty[3], "region shouldn't be empty\n");
/* Cut off everything after the first space, and the second line. */
- rc.Width = char_bounds.Width + char_width * 2.5;
+ rc.Width = char_bounds.Width + char_width * 2.1;
rc.Height = char_bounds.Height + char_height * 0.5;
status = GdipMeasureCharacterRanges(graphics, teststring, 6, font, &rc, format, 3, regions);
More information about the wine-cvs
mailing list