diff --git a/win32ss/gdi/gdi32/objects/font.c b/win32ss/gdi/gdi32/objects/font.c index 0d88defc57..57359716fa 100644 --- a/win32ss/gdi/gdi32/objects/font.c +++ b/win32ss/gdi/gdi32/objects/font.c @@ -2153,7 +2153,32 @@ GdiGetCharDimensions(HDC hdc, LPTEXTMETRICW lptm, LONG *height) 'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',0 }; +#if 1 /* This is a hack. See CORE-1091. */ + /* It is needed because ReactOS does not support raster fonts now */ + /* After Raster Font support is added, then it can be removed */ + /* Determine the current font's Pitch and Family to save for later */ + LOGFONT lf; + HFONT hCurrentFont; + + hCurrentFont = (HFONT)GetCurrentObject(hdc, OBJ_FONT); + GetObject(hCurrentFont, sizeof(LOGFONT), &lf); + + /* This function currently in ReactOS will always return a Truetype font */ + /* because we cannot yet handle raster fonts. So it will return flags */ + /* TMPF_VECTOR and TMPF_TRUETYPE, which can cause problems in edit boxes */ + if (!GetTextMetricsW(hdc, &tm)) + return 0; + + /* To compensate for the GetTextMetricsW call changing the PitchAndFamily */ + /* to a Truetype one when we have a 'helv' font as our input we and (&) */ + /* our current PitchAndFamily with 0xF9 to remove the two problem bits */ + if (wcsicmp(lf.lfFaceName, L"helv")==0) + { + tm.tmPitchAndFamily = tm.tmPitchAndFamily & 0xF9; + } +#else if(!GetTextMetricsW(hdc, &tm)) return 0; +#endif if(!GetTextExtentPointW(hdc, alphabet, 52, &sz)) return 0;