#include "wine/test.h"
+static int get_dpiy(void)
+{
+ HDC hdc;
+ int result;
+
+ hdc = GetDC(0);
+ result = GetDeviceCaps(hdc, LOGPIXELSY);
+ ReleaseDC(0, hdc);
+
+ return result;
+}
+
static UINT_PTR CALLBACK CFHookProcOK(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
{
switch (msg)
LOGFONTA lfa;
CHOOSEFONTA cfa;
BOOL ret;
+ int dpiy = get_dpiy();
+ int expected_pointsize, expected_lfheight;
memset(&lfa, 0, sizeof(LOGFONTA));
lfa.lfHeight = -16;
ret = ChooseFontA(&cfa);
+ expected_pointsize = MulDiv(16, 72, dpiy) * 10;
+ expected_lfheight = -MulDiv(expected_pointsize, dpiy, 720);
+
ok(ret == TRUE, "ChooseFontA returned FALSE\n");
- ok(lfa.lfHeight == -16, "Expected -16, got %i\n", lfa.lfHeight);
+ ok(cfa.iPointSize == expected_pointsize, "Expected %i, got %i\n", expected_pointsize, cfa.iPointSize);
+ ok(lfa.lfHeight == expected_lfheight, "Expected %i, got %i\n", expected_lfheight, lfa.lfHeight);
ok(lfa.lfWeight == FW_NORMAL, "Expected FW_NORMAL, got %i\n", lfa.lfWeight);
ok(strcmp(lfa.lfFaceName, "Symbol") == 0, "Expected Symbol, got %s\n", lfa.lfFaceName);
}