Nikolay Sivov : dwrite: Support outlines with oblique simulation.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Dec 16 15:06:06 CST 2014


Module: wine
Branch: master
Commit: bbe6655280082fd39d4a90a36719f13b37de9df1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=bbe6655280082fd39d4a90a36719f13b37de9df1

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon Dec 15 13:35:03 2014 +0300

dwrite: Support outlines with oblique simulation.

---

 dlls/dwrite/dwrite_private.h |  2 +-
 dlls/dwrite/font.c           |  2 +-
 dlls/dwrite/freetype.c       | 10 +++++-----
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h
index 07d894c..3558bf8 100644
--- a/dlls/dwrite/dwrite_private.h
+++ b/dlls/dwrite/dwrite_private.h
@@ -149,7 +149,7 @@ extern void release_freetype(void) DECLSPEC_HIDDEN;
 extern HRESULT freetype_get_design_glyph_metrics(IDWriteFontFace2*,UINT16,UINT16,DWRITE_GLYPH_METRICS*) DECLSPEC_HIDDEN;
 extern void freetype_notify_cacheremove(IDWriteFontFace2*) DECLSPEC_HIDDEN;
 extern BOOL freetype_is_monospaced(IDWriteFontFace2*) DECLSPEC_HIDDEN;
-extern HRESULT freetype_get_glyph_outline(IDWriteFontFace2*,FLOAT,UINT16,struct glyph_outline**) DECLSPEC_HIDDEN;
+extern HRESULT freetype_get_glyph_outline(IDWriteFontFace2*,FLOAT,UINT16,USHORT,struct glyph_outline**) DECLSPEC_HIDDEN;
 
 /* Glyph shaping */
 enum SCRIPT_JUSTIFY
diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index 9611050..61d370b 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -515,7 +515,7 @@ static HRESULT WINAPI dwritefontface_GetGlyphRunOutline(IDWriteFontFace2 *iface,
 
         /* FIXME: cache outlines */
 
-        hr = freetype_get_glyph_outline(iface, emSize, glyphs[g], &outline);
+        hr = freetype_get_glyph_outline(iface, emSize, glyphs[g], This->simulations, &outline);
         if (FAILED(hr))
             return hr;
 
diff --git a/dlls/dwrite/freetype.c b/dlls/dwrite/freetype.c
index b4d9859..43fa4df 100644
--- a/dlls/dwrite/freetype.c
+++ b/dlls/dwrite/freetype.c
@@ -339,7 +339,7 @@ static HRESULT get_outline_data(const FT_Outline *outline, struct glyph_outline
     return S_OK;
 }
 
-HRESULT freetype_get_glyph_outline(IDWriteFontFace2 *fontface, FLOAT emSize, UINT16 index, struct glyph_outline **ret)
+HRESULT freetype_get_glyph_outline(IDWriteFontFace2 *fontface, FLOAT emSize, UINT16 index, USHORT simulations, struct glyph_outline **ret)
 {
     FTC_ScalerRec scaler;
     HRESULT hr = S_OK;
@@ -358,10 +358,10 @@ HRESULT freetype_get_glyph_outline(IDWriteFontFace2 *fontface, FLOAT emSize, UIN
              FT_Outline *outline = &size->face->glyph->outline;
              FT_Matrix m;
 
-             m.xx = 1.0 * 0x10000;
-             m.xy = 0;
+             m.xx = 1 << 16;
+             m.xy = simulations & DWRITE_FONT_SIMULATIONS_OBLIQUE ? (1 << 16) / 3 : 0;
              m.yx = 0;
-             m.yy = -1.0 * 0x10000; /* flip Y axis */
+             m.yy = -(1 << 16); /* flip Y axis */
 
              pFT_Outline_Transform(outline, &m);
 
@@ -400,7 +400,7 @@ BOOL freetype_is_monospaced(IDWriteFontFace2 *fontface)
     return FALSE;
 }
 
-HRESULT freetype_get_glyph_outline(IDWriteFontFace2 *fontface, FLOAT emSize, UINT16 index, struct glyph_outline **ret)
+HRESULT freetype_get_glyph_outline(IDWriteFontFace2 *fontface, FLOAT emSize, UINT16 index, USHORT simulations, struct glyph_outline **ret)
 {
     *ret = NULL;
     return E_NOTIMPL;




More information about the wine-cvs mailing list