Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/gdi32/tests/font.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index bd04a8b6b1..b732cde854 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -1790,17 +1790,18 @@ static void test_GetKerningPairs(void) kd[i].otmMacDescent, otm.otmMacDescent); ok(near_match(kd[i].otmMacAscent, otm.otmMacAscent), "expected %d, got %d\n", kd[i].otmMacAscent, otm.otmMacAscent); -todo_wine { +todo_wine ok(kd[i].otmsCapEmHeight == otm.otmsCapEmHeight, "expected %u, got %u\n", kd[i].otmsCapEmHeight, otm.otmsCapEmHeight); +todo_wine ok(kd[i].otmsXHeight == otm.otmsXHeight, "expected %u, got %u\n", kd[i].otmsXHeight, otm.otmsXHeight); - /* FIXME: this one sometimes succeeds due to expected 0, enable it when removing todo */ - if (0) ok(kd[i].otmMacLineGap == otm.otmMacLineGap, "expected %u, got %u\n", +todo_wine_if(kd[i].otmMacLineGap) + ok(kd[i].otmMacLineGap == otm.otmMacLineGap, "expected %u, got %u\n", kd[i].otmMacLineGap, otm.otmMacLineGap); +todo_wine ok(kd[i].otmusMinimumPPEM == otm.otmusMinimumPPEM, "expected %u, got %u\n", kd[i].otmusMinimumPPEM, otm.otmusMinimumPPEM); -}
total_kern_pairs = GetKerningPairsW(hdc, 0, NULL); trace("total_kern_pairs %u\n", total_kern_pairs);
Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/gdi32/font.c | 10 +++++----- dlls/gdi32/freetype.c | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 3b3f0b5051..d059f97c24 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -1664,16 +1664,16 @@ UINT WINAPI GetOutlineTextMetricsW( output->otmTextMetrics.tmOverhang = width_to_LP( dc, output->otmTextMetrics.tmOverhang ); output->otmAscent = height_to_LP( dc, output->otmAscent); output->otmDescent = height_to_LP( dc, output->otmDescent); - output->otmLineGap = abs(INTERNAL_YDSTOWS(dc,output->otmLineGap)); - output->otmsCapEmHeight = abs(INTERNAL_YDSTOWS(dc,output->otmsCapEmHeight)); - output->otmsXHeight = abs(INTERNAL_YDSTOWS(dc,output->otmsXHeight)); + output->otmLineGap = INTERNAL_YDSTOWS(dc, output->otmLineGap); + output->otmsCapEmHeight = INTERNAL_YDSTOWS(dc, output->otmsCapEmHeight); + output->otmsXHeight = INTERNAL_YDSTOWS(dc, output->otmsXHeight); output->otmrcFontBox.top = height_to_LP( dc, output->otmrcFontBox.top); output->otmrcFontBox.bottom = height_to_LP( dc, output->otmrcFontBox.bottom); output->otmrcFontBox.left = width_to_LP( dc, output->otmrcFontBox.left); output->otmrcFontBox.right = width_to_LP( dc, output->otmrcFontBox.right); output->otmMacAscent = height_to_LP( dc, output->otmMacAscent); output->otmMacDescent = height_to_LP( dc, output->otmMacDescent); - output->otmMacLineGap = abs(INTERNAL_YDSTOWS(dc,output->otmMacLineGap)); + output->otmMacLineGap = INTERNAL_YDSTOWS(dc, output->otmMacLineGap); output->otmptSubscriptSize.x = width_to_LP( dc, output->otmptSubscriptSize.x); output->otmptSubscriptSize.y = height_to_LP( dc, output->otmptSubscriptSize.y); output->otmptSubscriptOffset.x = width_to_LP( dc, output->otmptSubscriptOffset.x); @@ -1682,7 +1682,7 @@ UINT WINAPI GetOutlineTextMetricsW( output->otmptSuperscriptSize.y = height_to_LP( dc, output->otmptSuperscriptSize.y); output->otmptSuperscriptOffset.x = width_to_LP( dc, output->otmptSuperscriptOffset.x); output->otmptSuperscriptOffset.y = height_to_LP( dc, output->otmptSuperscriptOffset.y); - output->otmsStrikeoutSize = abs(INTERNAL_YDSTOWS(dc,output->otmsStrikeoutSize)); + output->otmsStrikeoutSize = INTERNAL_YDSTOWS(dc, output->otmsStrikeoutSize); output->otmsStrikeoutPosition = height_to_LP( dc, output->otmsStrikeoutPosition); output->otmsUnderscoreSize = height_to_LP( dc, output->otmsUnderscoreSize); output->otmsUnderscorePosition = height_to_LP( dc, output->otmsUnderscorePosition); diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 7c5a7ef979..660900a56e 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -7576,8 +7576,9 @@ static void scale_outline_font_metrics(const GdiFont *font, OUTLINETEXTMETRICW *
scale_font_metrics(font, &potm->otmTextMetrics);
-#define SCALE_X(x) (x) = GDI_ROUND((double)(x) * (scale_x)) -#define SCALE_Y(y) (y) = GDI_ROUND((double)(y) * (scale_y)) +/* Windows scales these values as signed integers even if they are unsigned */ +#define SCALE_X(x) (x) = GDI_ROUND((int)(x) * (scale_x)) +#define SCALE_Y(y) (y) = GDI_ROUND((int)(y) * (scale_y))
SCALE_Y(potm->otmAscent); SCALE_Y(potm->otmDescent);
Signed-off-by: Huw Davies huw@codeweavers.com
On Mon, Dec 18, 2017 at 08:31:05PM -0700, Alex Henrie wrote:
Signed-off-by: Alex Henrie alexhenrie24@gmail.com
dlls/gdi32/tests/font.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index bd04a8b6b1..b732cde854 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -1790,17 +1790,18 @@ static void test_GetKerningPairs(void) kd[i].otmMacDescent, otm.otmMacDescent); ok(near_match(kd[i].otmMacAscent, otm.otmMacAscent), "expected %d, got %d\n", kd[i].otmMacAscent, otm.otmMacAscent); -todo_wine { +todo_wine ok(kd[i].otmsCapEmHeight == otm.otmsCapEmHeight, "expected %u, got %u\n", kd[i].otmsCapEmHeight, otm.otmsCapEmHeight); +todo_wine ok(kd[i].otmsXHeight == otm.otmsXHeight, "expected %u, got %u\n", kd[i].otmsXHeight, otm.otmsXHeight);
/* FIXME: this one sometimes succeeds due to expected 0, enable it when removing todo */
if (0) ok(kd[i].otmMacLineGap == otm.otmMacLineGap, "expected %u, got %u\n",
+todo_wine_if(kd[i].otmMacLineGap)
ok(kd[i].otmMacLineGap == otm.otmMacLineGap, "expected %u, got %u\n", kd[i].otmMacLineGap, otm.otmMacLineGap);
+todo_wine ok(kd[i].otmusMinimumPPEM == otm.otmusMinimumPPEM, "expected %u, got %u\n", kd[i].otmusMinimumPPEM, otm.otmusMinimumPPEM); -}
This causes a test failure for me. It turns out that the otmMacLineGap value should come from the hhea table - I've sent in a patch that implements this.
Huw.