Commit 96757205 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

gdi32: Initialize otmMacAscent, otmMacDescent, otmMacLineGap in outline text metrics.

parent e3787959
......@@ -5103,7 +5103,6 @@ UINT WineEngGetOutlineTextMetrics(GdiFont *font, UINT cbSize,
}
TM.tmCharSet = font->charset;
#undef TM
font->potm->otmFiller = 0;
memcpy(&font->potm->otmPanoseNumber, pOS2->panose, PANOSE_COUNT);
......@@ -5122,9 +5121,9 @@ UINT WineEngGetOutlineTextMetrics(GdiFont *font, UINT cbSize,
font->potm->otmrcFontBox.right = (pFT_MulFix(ft_face->bbox.xMax, x_scale) + 32) >> 6;
font->potm->otmrcFontBox.top = (pFT_MulFix(ft_face->bbox.yMax, y_scale) + 32) >> 6;
font->potm->otmrcFontBox.bottom = (pFT_MulFix(ft_face->bbox.yMin, y_scale) + 32) >> 6;
font->potm->otmMacAscent = 0; /* where do these come from ? */
font->potm->otmMacDescent = 0;
font->potm->otmMacLineGap = 0;
font->potm->otmMacAscent = TM.tmAscent;
font->potm->otmMacDescent = -TM.tmDescent;
font->potm->otmMacLineGap = font->potm->otmLineGap;
font->potm->otmusMinimumPPEM = 0; /* TT Header */
font->potm->otmptSubscriptSize.x = (pFT_MulFix(pOS2->ySubscriptXSize, x_scale) + 32) >> 6;
font->potm->otmptSubscriptSize.y = (pFT_MulFix(pOS2->ySubscriptYSize, y_scale) + 32) >> 6;
......@@ -5143,6 +5142,7 @@ UINT WineEngGetOutlineTextMetrics(GdiFont *font, UINT cbSize,
font->potm->otmsUnderscoreSize = (pFT_MulFix(pPost->underlineThickness, y_scale) + 32) >> 6;
font->potm->otmsUnderscorePosition = (pFT_MulFix(pPost->underlinePosition, y_scale) + 32) >> 6;
}
#undef TM
/* otmp* members should clearly have type ptrdiff_t, but M$ knows best */
cp = (char*)font->potm + sizeof(*font->potm);
......
......@@ -30,6 +30,7 @@
#include "wine/test.h"
#define near_match(a, b) (abs((a) - (b)) <= 4)
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
LONG (WINAPI *pGdiGetCharDimensions)(HDC hdc, LPTEXTMETRICW lptm, LONG *height);
......@@ -781,6 +782,8 @@ static void test_GetKerningPairs(void)
kd[i].otmDescent, otm.otmDescent);
ok(kd[i].otmLineGap == otm.otmLineGap, "expected %u, got %u\n",
kd[i].otmLineGap, otm.otmLineGap);
ok(near_match(kd[i].otmMacDescent, otm.otmMacDescent), "expected %d, got %d\n",
kd[i].otmMacDescent, otm.otmMacDescent);
todo_wine {
ok(kd[i].otmsCapEmHeight == otm.otmsCapEmHeight, "expected %u, got %u\n",
kd[i].otmsCapEmHeight, otm.otmsCapEmHeight);
......@@ -788,8 +791,6 @@ todo_wine {
kd[i].otmsXHeight, otm.otmsXHeight);
ok(kd[i].otmMacAscent == otm.otmMacAscent, "expected %d, got %d\n",
kd[i].otmMacAscent, otm.otmMacAscent);
ok(kd[i].otmMacDescent == otm.otmMacDescent, "expected %d, got %d\n",
kd[i].otmMacDescent, otm.otmMacDescent);
/* 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",
kd[i].otmMacLineGap, otm.otmMacLineGap);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment