Removed no longer used average width calculation.
diff --git a/windows/dialog.c b/windows/dialog.c
index f0d77b6..c439bc5 100644
--- a/windows/dialog.c
+++ b/windows/dialog.c
@@ -155,40 +155,13 @@
TEXTMETRICA tm;
memset(&tm,0,sizeof(tm));
if (hFont) hFontPrev = SelectFont(hDC,hFont);
- if (GetTextMetricsA(hDC,&tm))
+ if ((Success = GetTextMetricsA(hDC,&tm)))
{
pSize->cx = tm.tmAveCharWidth;
pSize->cy = tm.tmHeight;
-
- /* if variable width font */
- if (tm.tmPitchAndFamily & TMPF_FIXED_PITCH)
- {
- SIZE total;
- const char* szAvgChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
-
- /* Calculate a true average as opposed to the one returned
- * by tmAveCharWidth. This works better when dealing with
- * proportional spaced fonts and (more important) that's
- * how Microsoft's dialog creation code calculates the size
- * of the font
- */
- if (GetTextExtentPointA(hDC,szAvgChars,sizeof(szAvgChars),&total))
- {
- /* round up */
- pSize->cx = ((2*total.cx/sizeof(szAvgChars)) + 1)/2;
- Success = TRUE;
- }
- }
- else
- {
- Success = TRUE;
- }
- /* Use the text metrics */
- TRACE("Using tm: %ldx%ld (dlg: %ld x %ld) (%s)\n",
+ TRACE("Using tm: %ldx%ld (dlg: %ld x %ld) (%s)\n",
tm.tmAveCharWidth, tm.tmHeight, pSize->cx, pSize->cy,
- tm.tmPitchAndFamily & TMPF_FIXED_PITCH ? "variable" : "fixed");
- pSize->cx = tm.tmAveCharWidth;
- pSize->cy = tm.tmHeight;
+ tm.tmPitchAndFamily & TMPF_FIXED_PITCH ? "variable" : "fixed");
}
/* select the original font */
if (hFontPrev) SelectFont(hDC,hFontPrev);