Module: wine Branch: master Commit: 23c2ef2fcde3aef1ecc3021a3440c47db0007d84 URL: http://source.winehq.org/git/wine.git/?a=commit;h=23c2ef2fcde3aef1ecc3021a34...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Fri Mar 13 22:42:30 2015 +0300
dwrite: Implement HasKerningPairs().
---
dlls/dwrite/dwrite_private.h | 1 + dlls/dwrite/font.c | 4 ++-- dlls/dwrite/freetype.c | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h index 9481c74..92f0427 100644 --- a/dlls/dwrite/dwrite_private.h +++ b/dlls/dwrite/dwrite_private.h @@ -162,6 +162,7 @@ extern BOOL freetype_is_monospaced(IDWriteFontFace2*) DECLSPEC_HIDDEN; extern HRESULT freetype_get_glyph_outline(IDWriteFontFace2*,FLOAT,UINT16,USHORT,struct glyph_outline**) DECLSPEC_HIDDEN; extern UINT16 freetype_get_glyphcount(IDWriteFontFace2*) DECLSPEC_HIDDEN; extern UINT16 freetype_get_glyphindex(IDWriteFontFace2*,UINT32) DECLSPEC_HIDDEN; +extern BOOL freetype_has_kerning_pairs(IDWriteFontFace2*) DECLSPEC_HIDDEN;
/* Glyph shaping */ enum SCRIPT_JUSTIFY diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index c4b8818..66dbc68 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -669,8 +669,8 @@ static HRESULT WINAPI dwritefontface1_GetKerningPairAdjustments(IDWriteFontFace2 static BOOL WINAPI dwritefontface1_HasKerningPairs(IDWriteFontFace2 *iface) { struct dwrite_fontface *This = impl_from_IDWriteFontFace2(iface); - FIXME("(%p): stub\n", This); - return FALSE; + TRACE("(%p)\n", This); + return freetype_has_kerning_pairs(iface); }
static HRESULT WINAPI dwritefontface1_GetRecommendedRenderingMode(IDWriteFontFace2 *iface, diff --git a/dlls/dwrite/freetype.c b/dlls/dwrite/freetype.c index 84c9cad..325f156 100644 --- a/dlls/dwrite/freetype.c +++ b/dlls/dwrite/freetype.c @@ -407,6 +407,19 @@ UINT16 freetype_get_glyphindex(IDWriteFontFace2 *fontface, UINT32 codepoint) return glyph; }
+BOOL freetype_has_kerning_pairs(IDWriteFontFace2 *fontface) +{ + BOOL has_kerning_pairs = FALSE; + FT_Face face; + + EnterCriticalSection(&freetype_cs); + if (pFTC_Manager_LookupFace(cache_manager, fontface, &face) == 0) + has_kerning_pairs = FT_HAS_KERNING(face); + LeaveCriticalSection(&freetype_cs); + + return has_kerning_pairs; +} + #else /* HAVE_FREETYPE */
BOOL init_freetype(void) @@ -448,4 +461,9 @@ UINT16 freetype_get_glyphindex(IDWriteFontFace2 *fontface, UINT32 codepoint) return 0; }
+BOOL freetype_has_kerning_pairs(IDWriteFontFace2 *fontface) +{ + return FALSE; +} + #endif /* HAVE_FREETYPE */