dwrite/tests: Skip some tests on variable fonts.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3493792da3
commit
abe71945ef
|
@ -2544,6 +2544,19 @@ static void get_logfont_from_font(IDWriteFont *font, LOGFONTW *logfont)
|
|||
IDWriteFontFace_Release(fontface);
|
||||
}
|
||||
|
||||
static BOOL has_face_variations(IDWriteFontFace *fontface)
|
||||
{
|
||||
IDWriteFontFace5 *fontface5;
|
||||
BOOL ret = FALSE;
|
||||
|
||||
if (SUCCEEDED(IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace5, (void **)&fontface5))) {
|
||||
ret = IDWriteFontFace5_HasVariations(fontface5);
|
||||
IDWriteFontFace5_Release(fontface5);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void test_ConvertFontFaceToLOGFONT(void)
|
||||
{
|
||||
IDWriteFontCollection *collection;
|
||||
|
@ -2614,6 +2627,13 @@ if (0) /* crashes on native */
|
|||
hr = IDWriteFont_CreateFontFace(font, &fontface);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
|
||||
if (has_face_variations(fontface)) {
|
||||
skip("%s: test does not support variable fonts.\n", wine_dbgstr_w(nameW));
|
||||
IDWriteFontFace_Release(fontface);
|
||||
IDWriteFont_Release(font);
|
||||
continue;
|
||||
}
|
||||
|
||||
memset(&logfont, 0xcc, sizeof(logfont));
|
||||
hr = IDWriteGdiInterop_ConvertFontFaceToLOGFONT(interop, fontface, &logfont);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
|
@ -4014,6 +4034,8 @@ if (0) { /* crashes on native */
|
|||
|
||||
for (j = 0; j < font_count; j++) {
|
||||
static const WCHAR spaceW[] = {' ', 0};
|
||||
IDWriteFontFace *fontface;
|
||||
BOOL has_variations;
|
||||
|
||||
hr = IDWriteFontFamily_GetFont(family, j, &font);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
|
@ -4028,6 +4050,18 @@ if (0) { /* crashes on native */
|
|||
lstrcatW(nameW, spaceW);
|
||||
lstrcatW(nameW, facenameW);
|
||||
|
||||
hr = IDWriteFont_CreateFontFace(font, &fontface);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
|
||||
has_variations = has_face_variations(fontface);
|
||||
IDWriteFontFace_Release(fontface);
|
||||
|
||||
if (has_variations) {
|
||||
skip("%s: test does not support variable fonts.\n", wine_dbgstr_w(nameW));
|
||||
IDWriteFont_Release(font);
|
||||
continue;
|
||||
}
|
||||
|
||||
system = FALSE;
|
||||
memset(&logfont, 0xcc, sizeof(logfont));
|
||||
hr = IDWriteGdiInterop_ConvertFontToLOGFONT(interop, font, &logfont, &system);
|
||||
|
|
|
@ -22,6 +22,7 @@ interface IDWriteFontFaceReference;
|
|||
interface IDWriteFontFace3;
|
||||
interface IDWriteFontSet;
|
||||
interface IDWriteFontDownloadQueue;
|
||||
interface IDWriteFontResource;
|
||||
|
||||
cpp_quote("#ifndef _WINGDI_")
|
||||
/* already defined in wingdi.h but needed for WIDL */
|
||||
|
@ -457,6 +458,37 @@ interface IDWriteFontFace4 : IDWriteFontFace3
|
|||
void ReleaseGlyphImageData(void *context);
|
||||
}
|
||||
|
||||
typedef enum DWRITE_FONT_AXIS_TAG
|
||||
{
|
||||
DWRITE_FONT_AXIS_TAG_WEIGHT = 0x74686777, /* 'wght' */
|
||||
DWRITE_FONT_AXIS_TAG_WIDTH = 0x68746477, /* 'wdth' */
|
||||
DWRITE_FONT_AXIS_TAG_SLANT = 0x746e6c73, /* 'slnt' */
|
||||
DWRITE_FONT_AXIS_TAG_OPTICAL_SIZE = 0x7a73706f, /* 'opsz' */
|
||||
DWRITE_FONT_AXIS_TAG_ITALIC = 0x6c617469, /* 'ital' */
|
||||
} DWRITE_FONT_AXIS_TAG;
|
||||
|
||||
typedef struct DWRITE_FONT_AXIS_VALUE
|
||||
{
|
||||
DWRITE_FONT_AXIS_TAG axisTag;
|
||||
FLOAT value;
|
||||
} DWRITE_FONT_AXIS_VALUE;
|
||||
|
||||
[
|
||||
local,
|
||||
object,
|
||||
uuid(98eff3a5-b667-479a-b145-e2fa5b9fdc29)
|
||||
]
|
||||
interface IDWriteFontFace5 : IDWriteFontFace4
|
||||
{
|
||||
UINT32 GetFontAxisValueCount();
|
||||
HRESULT GetFontAxisValues(
|
||||
DWRITE_FONT_AXIS_VALUE *values,
|
||||
UINT32 value_count);
|
||||
BOOL HasVariations();
|
||||
HRESULT GetFontResource(IDWriteFontResource **resource);
|
||||
BOOL Equals(IDWriteFontFace *fontface);
|
||||
}
|
||||
|
||||
typedef struct DWRITE_COLOR_GLYPH_RUN1
|
||||
{
|
||||
DWRITE_GLYPH_RUN glyphRun;
|
||||
|
|
Loading…
Reference in New Issue