Commit fa6c255f authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Update to IDWriteFont3.

parent 27ca16c7
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "windows.h" #include "windows.h"
#include "winternl.h" #include "winternl.h"
#include "dwrite_2.h" #include "dwrite_3.h"
#include "initguid.h" #include "initguid.h"
#include "d2d1.h" #include "d2d1.h"
...@@ -2415,8 +2415,6 @@ static void test_GetFontFromFontFace(void) ...@@ -2415,8 +2415,6 @@ static void test_GetFontFromFontFace(void)
DELETE_FONTFILE(path); DELETE_FONTFILE(path);
} }
static void test_GetFirstMatchingFont(void) static void test_GetFirstMatchingFont(void)
{ {
DWRITE_FONT_SIMULATIONS simulations; DWRITE_FONT_SIMULATIONS simulations;
...@@ -5268,6 +5266,39 @@ static void test_TranslateColorGlyphRun(void) ...@@ -5268,6 +5266,39 @@ static void test_TranslateColorGlyphRun(void)
IDWriteFactory2_Release(factory2); IDWriteFactory2_Release(factory2);
} }
static void test_HasCharacter(void)
{
IDWriteFactory3 *factory3;
IDWriteFactory *factory;
IDWriteFont3 *font3;
IDWriteFont *font;
HRESULT hr;
BOOL ret;
factory = create_factory();
font = get_tahoma_instance(factory, DWRITE_FONT_STYLE_NORMAL);
ok(font != NULL, "failed to create font\n");
/* Win8 is broken, QI claims to support IDWriteFont3, but in fact it does not */
hr = IDWriteFactory_QueryInterface(factory, &IID_IDWriteFactory3, (void**)&factory3);
if (hr == S_OK) {
hr = IDWriteFont_QueryInterface(font, &IID_IDWriteFont3, (void**)&font3);
ok(hr == S_OK, "got 0x%08x\n", hr);
ret = IDWriteFont3_HasCharacter(font3, 'A');
ok(ret, "got %d\n", ret);
IDWriteFont3_Release(font3);
IDWriteFactory3_Release(factory3);
}
else
skip("IDWriteFont3 is not supported.\n");
IDWriteFont_Release(font);
IDWriteFactory_Release(factory);
}
START_TEST(font) START_TEST(font)
{ {
IDWriteFactory *factory; IDWriteFactory *factory;
...@@ -5320,6 +5351,7 @@ START_TEST(font) ...@@ -5320,6 +5351,7 @@ START_TEST(font)
test_IsSymbolFont(); test_IsSymbolFont();
test_GetPaletteEntries(); test_GetPaletteEntries();
test_TranslateColorGlyphRun(); test_TranslateColorGlyphRun();
test_HasCharacter();
IDWriteFactory_Release(factory); IDWriteFactory_Release(factory);
} }
...@@ -252,3 +252,12 @@ interface IDWriteTextLayout3 : IDWriteTextLayout2 ...@@ -252,3 +252,12 @@ interface IDWriteTextLayout3 : IDWriteTextLayout2
HRESULT GetLineSpacing(DWRITE_LINE_SPACING *spacing); HRESULT GetLineSpacing(DWRITE_LINE_SPACING *spacing);
HRESULT GetLineMetrics(DWRITE_LINE_METRICS1 *metrics, UINT32 max_count, UINT32 *count); HRESULT GetLineMetrics(DWRITE_LINE_METRICS1 *metrics, UINT32 max_count, UINT32 *count);
} }
[
local,
object,
uuid(9a1b41c3-d3bb-466a-87fc-fe67556a3b65)
]
interface IDWriteFactory3 : IDWriteFactory2
{
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment