mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
dwrite: Implement HasCharacter().
This commit is contained in:
parent
8f34bee25a
commit
9b46e19aa4
2 changed files with 31 additions and 2 deletions
|
@ -835,8 +835,26 @@ static void WINAPI dwritefont_GetMetrics(IDWriteFont2 *iface, DWRITE_FONT_METRIC
|
||||||
static HRESULT WINAPI dwritefont_HasCharacter(IDWriteFont2 *iface, UINT32 value, BOOL *exists)
|
static HRESULT WINAPI dwritefont_HasCharacter(IDWriteFont2 *iface, UINT32 value, BOOL *exists)
|
||||||
{
|
{
|
||||||
struct dwrite_font *This = impl_from_IDWriteFont2(iface);
|
struct dwrite_font *This = impl_from_IDWriteFont2(iface);
|
||||||
FIXME("(%p)->(0x%08x %p): stub\n", This, value, exists);
|
IDWriteFontFace *fontface;
|
||||||
return E_NOTIMPL;
|
UINT16 index;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
TRACE("(%p)->(0x%08x %p)\n", This, value, exists);
|
||||||
|
|
||||||
|
*exists = FALSE;
|
||||||
|
|
||||||
|
hr = IDWriteFont2_CreateFontFace(iface, &fontface);
|
||||||
|
if (FAILED(hr))
|
||||||
|
return hr;
|
||||||
|
|
||||||
|
index = 0;
|
||||||
|
hr = IDWriteFontFace_GetGlyphIndices(fontface, &value, 1, &index);
|
||||||
|
IDWriteFontFace_Release(fontface);
|
||||||
|
if (FAILED(hr))
|
||||||
|
return hr;
|
||||||
|
|
||||||
|
*exists = index != 0;
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI dwritefont_CreateFontFace(IDWriteFont2 *iface, IDWriteFontFace **face)
|
static HRESULT WINAPI dwritefont_CreateFontFace(IDWriteFont2 *iface, IDWriteFontFace **face)
|
||||||
|
|
|
@ -218,6 +218,7 @@ static void test_CreateFontFromLOGFONT(void)
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
HFONT hfont;
|
HFONT hfont;
|
||||||
|
BOOL exists;
|
||||||
int i;
|
int i;
|
||||||
UINT r;
|
UINT r;
|
||||||
|
|
||||||
|
@ -251,6 +252,16 @@ if (0)
|
||||||
DeleteDC(hdc);
|
DeleteDC(hdc);
|
||||||
DeleteObject(hfont);
|
DeleteObject(hfont);
|
||||||
|
|
||||||
|
exists = TRUE;
|
||||||
|
hr = IDWriteFont_HasCharacter(font, 0xd800, &exists);
|
||||||
|
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||||
|
ok(exists == FALSE, "got %d\n", exists);
|
||||||
|
|
||||||
|
exists = FALSE;
|
||||||
|
hr = IDWriteFont_HasCharacter(font, 0x20, &exists);
|
||||||
|
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||||
|
ok(exists == TRUE, "got %d\n", exists);
|
||||||
|
|
||||||
/* now check properties */
|
/* now check properties */
|
||||||
weight = IDWriteFont_GetWeight(font);
|
weight = IDWriteFont_GetWeight(font);
|
||||||
ok(weight == DWRITE_FONT_WEIGHT_NORMAL, "got %d\n", weight);
|
ok(weight == DWRITE_FONT_WEIGHT_NORMAL, "got %d\n", weight);
|
||||||
|
|
Loading…
Reference in a new issue