From c04b7c5b0f8dbe77bb88fc8915fff37b17982ffb Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Mon, 24 Nov 2008 10:21:44 +0100 Subject: [PATCH] gdiplus: Implement GdipGetLineSpacing. --- dlls/gdiplus/font.c | 14 +++++++++----- dlls/gdiplus/tests/font.c | 6 ------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index 32713c7c26b..9348f5b7c3c 100644 --- a/dlls/gdiplus/font.c +++ b/dlls/gdiplus/font.c @@ -667,8 +667,7 @@ GpStatus WINGDIPAPI GdipGetEmHeight(GDIPCONST GpFontFamily *family, INT style, U { if (!(family && EmHeight)) return InvalidParameter; - TRACE("%p (%s), %d, %p, stub!\n", family, - debugstr_w(family->FamilyName), style, EmHeight); + TRACE("%p (%s), %d, %p\n", family, debugstr_w(family->FamilyName), style, EmHeight); *EmHeight = family->tmw.ntmSizeEM; @@ -693,11 +692,16 @@ GpStatus WINGDIPAPI GdipGetEmHeight(GDIPCONST GpFontFamily *family, INT style, U GpStatus WINGDIPAPI GdipGetLineSpacing(GDIPCONST GpFontFamily *family, INT style, UINT16* LineSpacing) { - if (!(family && LineSpacing)) return InvalidParameter; + TRACE("%p, %d, %p\n", family, style, LineSpacing); - FIXME("stub!\n"); + if (!(family && LineSpacing)) + return InvalidParameter; - return NotImplemented; + if (style) FIXME("ignoring style\n"); + + *LineSpacing = family->tmw.tmAscent + family->tmw.tmDescent + family->tmw.tmExternalLeading; + + return Ok; } GpStatus WINGDIPAPI GdipIsStyleAvailable(GDIPCONST GpFontFamily* family, diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c index ab6d28c720b..7ff5afc6aff 100644 --- a/dlls/gdiplus/tests/font.c +++ b/dlls/gdiplus/tests/font.c @@ -246,12 +246,9 @@ static void test_fontfamily_properties (void) skip("Arial not installed\n"); else { -todo_wine -{ stat = GdipGetLineSpacing(FontFamily, FontStyleRegular, &result); expect(Ok, stat); ok (result == 2355, "Expected 2355, got %d\n", result); -} result = 0; stat = GdipGetEmHeight(FontFamily, FontStyleRegular, &result); expect(Ok, stat); @@ -272,12 +269,9 @@ todo_wine else { result = 0; -todo_wine -{ stat = GdipGetLineSpacing(FontFamily, FontStyleRegular, &result); expect(Ok, stat); ok(result == 2355, "Expected 2355, got %d\n", result); -} result = 0; stat = GdipGetEmHeight(FontFamily, FontStyleRegular, &result); expect(Ok, stat);