Exemplo n.º 1
0
static void test_getgenerics (void)
{
    GpStatus stat;
    GpFontFamily* family;
    WCHAR familyName[LF_FACESIZE];
    ZeroMemory(familyName, sizeof(familyName)/sizeof(WCHAR));

    stat = GdipGetGenericFontFamilySansSerif (&family);
    if (stat == FontFamilyNotFound)
    {
        skip("Microsoft Sans Serif not installed\n");
        goto serif;
    }
    expect (Ok, stat);
    stat = GdipGetFamilyName (family, familyName, LANG_NEUTRAL);
    expect (Ok, stat);
    if (!lstrcmpiW(familyName, Tahoma))
        todo_wine ok ((lstrcmpiW(familyName, MicrosoftSansSerif) == 0),
                      "Expected Microsoft Sans Serif, got Tahoma\n");
    else
        ok ((lstrcmpiW(familyName, MicrosoftSansSerif) == 0),
            "Expected Microsoft Sans Serif, got %s\n", wine_dbgstr_w(familyName));
    stat = GdipDeleteFontFamily (family);
    expect (Ok, stat);

serif:
    stat = GdipGetGenericFontFamilySerif (&family);
    if (stat == FontFamilyNotFound)
    {
        skip("Times New Roman not installed\n");
        goto monospace;
    }
    expect (Ok, stat);
    stat = GdipGetFamilyName (family, familyName, LANG_NEUTRAL);
    expect (Ok, stat);
    ok (lstrcmpiW(familyName, TimesNewRoman) == 0,
        "Expected Times New Roman, got %s\n", wine_dbgstr_w(familyName));
    stat = GdipDeleteFontFamily (family);
    expect (Ok, stat);

monospace:
    stat = GdipGetGenericFontFamilyMonospace (&family);
    if (stat == FontFamilyNotFound)
    {
        skip("Courier New not installed\n");
        return;
    }
    expect (Ok, stat);
    stat = GdipGetFamilyName (family, familyName, LANG_NEUTRAL);
    expect (Ok, stat);
    ok (lstrcmpiW(familyName, CourierNew) == 0,
        "Expected Courier New, got %s\n", wine_dbgstr_w(familyName));
    stat = GdipDeleteFontFamily (family);
    expect (Ok, stat);
}
Exemplo n.º 2
0
Arquivo: font.c Projeto: iamfil/wine
static void test_getgenerics (void)
{
    GpStatus stat;
    GpFontFamily** family;
    WCHAR familyName[LF_FACESIZE];
    ZeroMemory(familyName, sizeof(familyName)/sizeof(WCHAR));

    family = GdipAlloc (sizeof (GpFontFamily*));

    stat = GdipGetGenericFontFamilySansSerif (family);
    expect (Ok, stat);
    stat = GdipGetFamilyName (*family, familyName, LANG_NEUTRAL);
    expect (Ok, stat);
    ok ((lstrcmpiW(familyName, MicrosoftSansSerif) == 0) ||
        (lstrcmpiW(familyName,MSSansSerif) == 0),
        "Expected Microsoft Sans Serif or MS Sans Serif, got %s\n",
        debugstr_w(familyName));
    stat = GdipDeleteFontFamily (*family);
    expect (Ok, stat);

    stat = GdipGetGenericFontFamilySerif (family);
    expect (Ok, stat);
    stat = GdipGetFamilyName (*family, familyName, LANG_NEUTRAL);
    expect (Ok, stat);
    ok (lstrcmpiW(familyName, TimesNewRoman) == 0,
        "Expected Times New Roman, got %s\n", debugstr_w(familyName));
    stat = GdipDeleteFontFamily (*family);
    expect (Ok, stat);

    stat = GdipGetGenericFontFamilyMonospace (family);
    expect (Ok, stat);
    stat = GdipGetFamilyName (*family, familyName, LANG_NEUTRAL);
    expect (Ok, stat);
    ok (lstrcmpiW(familyName, CourierNew) == 0,
        "Expected Courier New, got %s\n", debugstr_w(familyName));
    stat = GdipDeleteFontFamily (*family);
    expect (Ok, stat);

    GdipFree (family);
}
Exemplo n.º 3
0
Arquivo: font.c Projeto: Dietr1ch/wine
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);
    expect (Ok, stat);
    if (stat == FontFamilyNotFound)
        missingfonts = 1;
    else
        check_family("Sans Serif", family, sansname);

    stat = GdipGetGenericFontFamilySerif(&family);
    expect (Ok, stat);
    if (stat == FontFamilyNotFound)
        missingfonts = 1;
    else
        check_family("Serif", family, serifname);

    stat = GdipGetGenericFontFamilyMonospace(&family);
    expect (Ok, stat);
    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));
}