dwrite: Fail earlier in TranslateColorGlyphRun() for fonts without color info.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
d829c50cbe
commit
9441b26dc5
|
@ -4556,8 +4556,23 @@ HRESULT create_colorglyphenum(FLOAT originX, FLOAT originY, const DWRITE_GLYPH_R
|
|||
DWRITE_MEASURING_MODE mode, const DWRITE_MATRIX *transform, UINT32 palette, IDWriteColorGlyphRunEnumerator **ret)
|
||||
{
|
||||
struct dwrite_colorglyphenum *colorglyphenum;
|
||||
IDWriteFontFace2 *fontface2;
|
||||
BOOL colorfont;
|
||||
HRESULT hr;
|
||||
|
||||
*ret = NULL;
|
||||
|
||||
hr = IDWriteFontFace_QueryInterface(run->fontFace, &IID_IDWriteFontFace2, (void**)&fontface2);
|
||||
if (FAILED(hr)) {
|
||||
WARN("failed to get IDWriteFontFace2, 0x%08x\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
colorfont = IDWriteFontFace2_IsColorFont(fontface2);
|
||||
IDWriteFontFace2_Release(fontface2);
|
||||
if (!colorfont)
|
||||
return DWRITE_E_NOCOLOR;
|
||||
|
||||
colorglyphenum = heap_alloc(sizeof(*colorglyphenum));
|
||||
if (!colorglyphenum)
|
||||
return E_OUTOFMEMORY;
|
||||
|
|
|
@ -5074,10 +5074,8 @@ static void test_TranslateColorGlyphRun(void)
|
|||
layers = (void*)0xdeadbeef;
|
||||
hr = IDWriteFactory2_TranslateColorGlyphRun(factory2, 0.0, 0.0, &run, NULL,
|
||||
DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers);
|
||||
todo_wine {
|
||||
ok(hr == DWRITE_E_NOCOLOR, "got 0x%08x\n", hr);
|
||||
ok(layers == NULL, "got %p\n", layers);
|
||||
}
|
||||
IDWriteFontFace_Release(fontface);
|
||||
|
||||
/* Segoe UI Emoji, with color support */
|
||||
|
|
Loading…
Reference in New Issue