[GDIPLUS_WINETEST]
[reactos.git] / rostests / winetests / gdiplus / font.c
index 2ce988d..c4f7dbe 100644 (file)
 
 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'};
 static const WCHAR MSSansSerif[] = {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'};
-static const WCHAR MicrosoftSansSerif[] = {'M','i','c','r','o','s','o','f','t',' ','S','a','n','s',' ','S','e','r','i','f','\0'};
 static const WCHAR TimesNewRoman[] = {'T','i','m','e','s',' ','N','e','w',' ','R','o','m','a','n','\0'};
-static const WCHAR CourierNew[] = {'C','o','u','r','i','e','r',' ','N','e','w','\0'};
 static const WCHAR Tahoma[] = {'T','a','h','o','m','a',0};
-static const WCHAR LiberationSerif[] = {'L','i','b','e','r','a','t','i','o','n',' ','S','e','r','i','f',0};
 
 static void set_rect_empty(RectF *rc)
 {
@@ -742,7 +739,7 @@ static void test_font_substitution(void)
     WCHAR ms_shell_dlg[LF_FACESIZE];
     HDC hdc;
     HFONT hfont;
-    LOGFONT lf;
+    LOGFONTA lf;
     GpStatus status;
     GpGraphics *graphics;
     GpFont *font;
@@ -757,9 +754,9 @@ static void test_font_substitution(void)
     ok(hfont != 0, "GetStockObject(DEFAULT_GUI_FONT) failed\n");
 
     memset(&lf, 0xfe, sizeof(lf));
-    ret = GetObject(hfont, sizeof(lf), &lf);
+    ret = GetObjectA(hfont, sizeof(lf), &lf);
     ok(ret == sizeof(lf), "GetObject failed\n");
-    ok(!lstrcmp(lf.lfFaceName, "MS Shell Dlg"), "wrong face name %s\n", lf.lfFaceName);
+    ok(!lstrcmpA(lf.lfFaceName, "MS Shell Dlg"), "wrong face name %s\n", lf.lfFaceName);
     MultiByteToWideChar(CP_ACP, 0, lf.lfFaceName, -1, ms_shell_dlg, LF_FACESIZE);
 
     status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
@@ -767,8 +764,8 @@ static void test_font_substitution(void)
     memset(&lf, 0xfe, sizeof(lf));
     status = GdipGetLogFontA(font, graphics, &lf);
     expect(Ok, status);
-    ok(!lstrcmp(lf.lfFaceName, "Microsoft Sans Serif") ||
-       !lstrcmp(lf.lfFaceName, "Tahoma"), "wrong face name %s\n", lf.lfFaceName);
+    ok(!lstrcmpA(lf.lfFaceName, "Microsoft Sans Serif") ||
+       !lstrcmpA(lf.lfFaceName, "Tahoma"), "wrong face name %s\n", lf.lfFaceName);
     GdipDeleteFont(font);
 
     status = GdipCreateFontFamilyFromName(ms_shell_dlg, NULL, &family);
@@ -778,21 +775,21 @@ static void test_font_substitution(void)
     memset(&lf, 0xfe, sizeof(lf));
     status = GdipGetLogFontA(font, graphics, &lf);
     expect(Ok, status);
-    ok(!lstrcmp(lf.lfFaceName, "Microsoft Sans Serif") ||
-       !lstrcmp(lf.lfFaceName, "Tahoma"), "wrong face name %s\n", lf.lfFaceName);
+    ok(!lstrcmpA(lf.lfFaceName, "Microsoft Sans Serif") ||
+       !lstrcmpA(lf.lfFaceName, "Tahoma"), "wrong face name %s\n", lf.lfFaceName);
     GdipDeleteFont(font);
     GdipDeleteFontFamily(family);
 
     status = GdipCreateFontFamilyFromName(nonexistent, NULL, &family);
     ok(status == FontFamilyNotFound, "expected FontFamilyNotFound, got %d\n", status);
 
-    lstrcpy(lf.lfFaceName, "ThisFontShouldNotExist");
+    lstrcpyA(lf.lfFaceName, "ThisFontShouldNotExist");
     status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
     expect(Ok, status);
     memset(&lf, 0xfe, sizeof(lf));
     status = GdipGetLogFontA(font, graphics, &lf);
     expect(Ok, status);
-    ok(!lstrcmp(lf.lfFaceName, "Arial"), "wrong face name %s\n", lf.lfFaceName);
+    ok(!lstrcmpA(lf.lfFaceName, "Arial"), "wrong face name %s\n", lf.lfFaceName);
     GdipDeleteFont(font);
 
     /* empty FaceName */
@@ -802,24 +799,30 @@ static void test_font_substitution(void)
     memset(&lf, 0xfe, sizeof(lf));
     status = GdipGetLogFontA(font, graphics, &lf);
     expect(Ok, status);
-    ok(!lstrcmp(lf.lfFaceName, "Arial"), "wrong face name %s\n", lf.lfFaceName);
+    ok(!lstrcmpA(lf.lfFaceName, "Arial"), "wrong face name %s\n", lf.lfFaceName);
     GdipDeleteFont(font);
 
     /* zeroing out lfWeight and lfCharSet leads to font creation failure */
     lf.lfWeight = 0;
     lf.lfCharSet = 0;
-    lstrcpy(lf.lfFaceName, "ThisFontShouldNotExist");
+    lstrcpyA(lf.lfFaceName, "ThisFontShouldNotExist");
+    font = NULL;
     status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
 todo_wine
     ok(status == NotTrueTypeFont || broken(status == FileNotFound), /* before XP */
        "expected NotTrueTypeFont, got %d\n", status);
+    /* FIXME: remove when wine is fixed */
+    if (font) GdipDeleteFont(font);
 
     /* empty FaceName */
     lf.lfFaceName[0] = 0;
+    font = NULL;
     status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
 todo_wine
     ok(status == NotTrueTypeFont || broken(status == FileNotFound), /* before XP */
        "expected NotTrueTypeFont, got %d\n", status);
+    /* FIXME: remove when wine is fixed */
+    if (font) GdipDeleteFont(font);
 
     GdipDeleteGraphics(graphics);
     DeleteDC(hdc);
@@ -830,7 +833,7 @@ static void test_font_transform(void)
     static const WCHAR string[] = { 'A',0 };
     GpStatus status;
     HDC hdc;
-    LOGFONT lf;
+    LOGFONTA lf;
     GpFont *font;
     GpGraphics *graphics;
     GpMatrix *matrix;
@@ -852,7 +855,7 @@ static void test_font_transform(void)
     expect(Ok, status);
 
     memset(&lf, 0, sizeof(lf));
-    lstrcpy(lf.lfFaceName, "Tahoma");
+    lstrcpyA(lf.lfFaceName, "Tahoma");
     lf.lfHeight = -100;
     lf.lfWidth = 100;
     status = GdipCreateFontFromLogfontA(hdc, &lf, &font);