return ret;
}
+/*************************************************************************
+ * GetScreenDPI [internal]
+ */
+static inline int GetScreenDPI(void)
+{
+ HDC hdc;
+ int result;
+
+ hdc = GetDC(0);
+ result = GetDeviceCaps(hdc, LOGPIXELSY);
+ ReleaseDC(0, hdc);
+
+ return result;
+}
+
/*************************************************************************
* CFn_ReleaseDC [internal]
*/
if (nFontType & RASTER_FONTTYPE)
{
INT points;
- if(!(hdc = CFn_GetDC(lpcf))) return 0;
points = MulDiv( lpNTM->ntmTm.tmHeight - lpNTM->ntmTm.tmInternalLeading,
- 72, GetDeviceCaps(hdc, LOGPIXELSY));
- CFn_ReleaseDC(lpcf, hdc);
+ 72, GetScreenDPI());
i = AddFontSizeToCombo3(hcmb3, points, lpcf);
if(i) return 0;
} else if (SetFontSizesToCombo3(hcmb3, lpcf)) return 0;
lpxx->lfHeight;
INT points;
int charset = lpxx->lfCharSet;
- points = MulDiv( height, 72, GetDeviceCaps(hdc, LOGPIXELSY));
+ points = MulDiv( height, 72, GetScreenDPI());
pstyle = MAKELONG(lpxx->lfWeight > FW_MEDIUM ? FW_BOLD:
FW_NORMAL,lpxx->lfItalic !=0);
SendDlgItemMessageW(hDlg, cmb1, CB_SETCURSEL, j, 0);
CB_GETITEMDATA , i, 0));
else
lpcf->iPointSize = 100;
- hdc = CFn_GetDC(lpcf);
- if( hdc)
- {
- lpxx->lfHeight = - MulDiv( lpcf->iPointSize ,
- GetDeviceCaps(hdc, LOGPIXELSY), 720);
- CFn_ReleaseDC(lpcf, hdc);
- } else
- lpxx->lfHeight = -lpcf->iPointSize / 10;
+ lpxx->lfHeight = - MulDiv( lpcf->iPointSize ,
+ GetScreenDPI(), 720);
i=SendDlgItemMessageW(hDlg, cmb5, CB_GETCURSEL, 0, 0);
if (i!=CB_ERR)
lpxx->lfCharSet=SendDlgItemMessageW(hDlg, cmb5, CB_GETITEMDATA, i, 0);
expected_lfheight = -MulDiv(expected_pointsize, dpiy, 720);
ok(ret == TRUE, "ChooseFontA returned FALSE\n");
- todo_wine ok(cfa.iPointSize == expected_pointsize, "Expected %i, got %i\n", expected_pointsize, cfa.iPointSize);
- todo_wine ok(lfa.lfHeight == expected_lfheight, "Expected %i, got %i\n", expected_lfheight, 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);