Nikolay Sivov : dwrite: Fix setting oblique simulation on font creation.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Nov 5 08:59:37 CST 2014
Module: wine
Branch: master
Commit: c0796ecb4940825d717dc320cbdf188cfe82ac8f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c0796ecb4940825d717dc320cbdf188cfe82ac8f
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Tue Nov 4 18:31:31 2014 +0300
dwrite: Fix setting oblique simulation on font creation.
---
dlls/dwrite/font.c | 4 ++--
dlls/dwrite/tests/font.c | 16 +++++++++++-----
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index c9edd91..165e395 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -698,7 +698,7 @@ HRESULT convert_fontface_to_logfont(IDWriteFontFace *face, LOGFONTW *logfont)
logfont->lfCharSet = DEFAULT_CHARSET;
logfont->lfWeight = weight;
- logfont->lfItalic = style == DWRITE_FONT_STYLE_ITALIC || (simulations | DWRITE_FONT_SIMULATIONS_OBLIQUE);
+ logfont->lfItalic = style == DWRITE_FONT_STYLE_ITALIC || (simulations & DWRITE_FONT_SIMULATIONS_OBLIQUE);
logfont->lfOutPrecision = OUT_OUTLINE_PRECIS;
/* TODO: set facename */
@@ -1120,7 +1120,7 @@ static HRESULT WINAPI dwritefontfamily_GetFirstMatchingFont(IDWriteFontFamily *i
DWRITE_FONT_SIMULATIONS simulations = DWRITE_FONT_SIMULATIONS_NONE;
if (((style == DWRITE_FONT_STYLE_ITALIC) || (style == DWRITE_FONT_STYLE_OBLIQUE)) &&
- This->data->fonts[found]->style == DWRITE_FONT_STYLE_ITALIC) {
+ This->data->fonts[found]->style == DWRITE_FONT_STYLE_NORMAL) {
simulations = DWRITE_FONT_SIMULATIONS_OBLIQUE;
}
return create_font(This->data->fonts[found], iface, simulations, font);
diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c
index 890bb2c..a93ee33 100644
--- a/dlls/dwrite/tests/font.c
+++ b/dlls/dwrite/tests/font.c
@@ -1126,6 +1126,7 @@ static void test_system_fontcollection(void)
static void test_ConvertFontFaceToLOGFONT(void)
{
+ DWRITE_FONT_SIMULATIONS sim;
IDWriteGdiInterop *interop;
IDWriteFontFace *fontface;
IDWriteFactory *factory;
@@ -1154,6 +1155,13 @@ static void test_ConvertFontFaceToLOGFONT(void)
hr = IDWriteFont_CreateFontFace(font, &fontface);
ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ sim = IDWriteFont_GetSimulations(font);
+ ok(sim == DWRITE_FONT_SIMULATIONS_OBLIQUE, "sim %d\n", sim);
+
+ sim = IDWriteFontFace_GetSimulations(fontface);
+ ok(sim == DWRITE_FONT_SIMULATIONS_OBLIQUE, "sim %d\n", sim);
+
IDWriteFont_Release(font);
if (0) /* crashes on native */
@@ -1830,7 +1838,6 @@ static void test_GetFirstMatchingFont(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
simulations = IDWriteFont_GetSimulations(font);
-todo_wine
ok(simulations == DWRITE_FONT_SIMULATIONS_OBLIQUE, "%d\n", simulations);
IDWriteFont_Release(font);
@@ -2009,12 +2016,10 @@ static void test_GetSimulations(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
simulations = IDWriteFont_GetSimulations(font);
-todo_wine
ok(simulations == DWRITE_FONT_SIMULATIONS_OBLIQUE, "got %d\n", simulations);
hr = IDWriteFont_CreateFontFace(font, &fontface);
ok(hr == S_OK, "got 0x%08x\n", hr);
simulations = IDWriteFontFace_GetSimulations(fontface);
-todo_wine
ok(simulations == DWRITE_FONT_SIMULATIONS_OBLIQUE, "got %d\n", simulations);
IDWriteFontFace_Release(fontface);
IDWriteFont_Release(font);
@@ -2030,11 +2035,12 @@ todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
simulations = IDWriteFont_GetSimulations(font);
- ok(simulations == 0, "got %d\n", simulations);
+ ok(simulations == DWRITE_FONT_SIMULATIONS_NONE, "got %d\n", simulations);
hr = IDWriteFont_CreateFontFace(font, &fontface);
ok(hr == S_OK, "got 0x%08x\n", hr);
simulations = IDWriteFontFace_GetSimulations(fontface);
- ok(simulations == 0, "got %d\n", simulations);
+todo_wine
+ ok(simulations == DWRITE_FONT_SIMULATIONS_NONE, "got %d\n", simulations);
IDWriteFontFace_Release(fontface);
IDWriteFont_Release(font);
More information about the wine-cvs
mailing list