Changeset 7691 for trunk/src


Ignore:
Timestamp:
Dec 26, 2001, 8:05:35 PM (24 years ago)
Author:
achimha
Message:

read system font height from graphics driver instead of hardcoding - only enabled for menus

Location:
trunk/src/user32
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/pmwindow.cpp

    r7403 r7691  
    1 /* $Id: pmwindow.cpp,v 1.165 2001-11-20 09:53:56 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.166 2001-12-26 19:05:34 achimha Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    7171       HWND  hwndCD = 0;
    7272
     73// this holds the font height that the display driver returns using DevQueryCaps
     74// 13 would be small fonts, 16 medium fonts and 20 large fonts
     75LONG CapsCharHeight = 0;
     76
    7377// Note:
    7478// For a "lonekey"-press of AltGr, we only receive WM_KEYUP
     
    204208
    205209    DevQueryCaps(hdc, CAPS_COLOR_BITCOUNT, 1, (PLONG)&ScreenBitsPerPel);
     210
     211    // query the font height to find out whether we have small or large fonts
     212    DevQueryCaps(hdc, CAPS_GRAPHICS_CHAR_HEIGHT, 1, (PLONG)&CapsCharHeight);
     213
    206214    DevCloseDC(hdc);
    207215
  • trunk/src/user32/pmwindow.h

    r7403 r7691  
    1 /* $Id: pmwindow.h,v 1.14 2001-11-20 09:53:57 sandervl Exp $ */
     1/* $Id: pmwindow.h,v 1.15 2001-12-26 19:05:35 achimha Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    2727extern BOOL  fOS2Look;
    2828extern HWND  hwndCD;
     29extern LONG CapsCharHeight;
    2930
    3031#define TFOS_LEFT                    0x0001
  • trunk/src/user32/user32.cpp

    r7685 r7691  
    1 /* $Id: user32.cpp,v 1.117 2001-12-26 14:47:22 achimha Exp $ */
     1/* $Id: user32.cpp,v 1.118 2001-12-26 19:05:35 achimha Exp $ */
    22
    33/*
     
    746746                        lpLogFont->lfFaceName[sizeof(lpLogFont->lfFaceName)-1] = 0;
    747747                        lpLogFont->lfWeight = FW_NORMAL;
    748                         // AH 2001-12-26 special case for WarpSans
    749                         if (strncmp(lpLogFont->lfFaceName, "WarpSans", 8) == 0)
    750                             lpLogFont->lfHeight = 9;
    751                         else
    752                             lpLogFont->lfHeight = 16; //atoi(fontname);
     748
     749                        // AH 2001-12-26 use the font size returned by the graphics
     750                        // driver as the font height. This will take font size settings
     751                        // such as small, medium and large fonts into account
     752                        lpLogFont->lfHeight = CapsCharHeight;
    753753                    }
    754754                    else fFound = FALSE;
     
    758758                                      lpLogFont->lfFaceName, LF_FACESIZE);
    759759                    lpLogFont->lfWeight = FW_BOLD;
    760                     lpLogFont->lfHeight = -GetProfileIntA("Desktop","MenuFontSize", 16);
     760                    // AH 2001-12-26 take graphics driver font size setting
     761                    lpLogFont->lfHeight = -GetProfileIntA("Desktop","MenuFontSize", CapsCharHeight);
    761762                }
    762763                lpLogFont->lfWidth = 0;
Note: See TracChangeset for help on using the changeset viewer.