From 054af17366ec668111be9152a2e1416ad4c0dc17 Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Mon, 14 Aug 2000 13:54:50 +0000 Subject: [PATCH] css button and caption font is set to be two point sizes larger than the default GUI size. caption font shouldn't (and now doesn't) use the actual Windows platform specific "caption" font b=33312 r=kmcclusk --- gfx/src/windows/nsDeviceContextWin.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/gfx/src/windows/nsDeviceContextWin.cpp b/gfx/src/windows/nsDeviceContextWin.cpp index 50bd3dcaeea3..1c8f0564269e 100644 --- a/gfx/src/windows/nsDeviceContextWin.cpp +++ b/gfx/src/windows/nsDeviceContextWin.cpp @@ -351,9 +351,10 @@ nsresult GetSysFontInfo(HDC aHDC, nsSystemAttrID anID, nsFont* aFont) switch (anID) { - case eSystemAttr_Font_Caption: - ptrLogFont = &ncm.lfCaptionFont; - break; + // Caption in CSS is NOT the same as Caption on Windows + //case eSystemAttr_Font_Caption: + // ptrLogFont = &ncm.lfCaptionFont; + // break; case eSystemAttr_Font_Icon: ptrLogFont = &logFont; @@ -388,6 +389,7 @@ nsresult GetSysFontInfo(HDC aHDC, nsSystemAttrID anID, nsFont* aFont) case eSystemAttr_Font_PullDownMenu: case eSystemAttr_Font_List: case eSystemAttr_Font_Field: + case eSystemAttr_Font_Caption: hGDI = ::GetStockObject(DEFAULT_GUI_FONT); if (hGDI != NULL) { @@ -433,6 +435,16 @@ nsresult GetSysFontInfo(HDC aHDC, nsSystemAttrID anID, nsFont* aFont) // Do Size int pointSize = -MulDiv(ptrLogFont->lfHeight, 72, ::GetDeviceCaps(aHDC, LOGPIXELSY)); + //printf("\n\n Default Font size: %dpt\n", pointSize); + // As far as I can tell the Default size 8pt + // increase it by 2 points to match Windows GUI + if (anID == eSystemAttr_Font_Button || + anID == eSystemAttr_Font_Field || + anID == eSystemAttr_Font_List || + anID == eSystemAttr_Font_Widget || + anID == eSystemAttr_Font_Caption) { + pointSize += 2; + } aFont->size = NSIntPointsToTwips(pointSize); return NS_OK;