Ignore:
Timestamp:
Jul 14, 2001, 10:36:19 AM (24 years ago)
Author:
sandervl
Message:

query menu font from os2.ini

File:
1 edited

Legend:

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

    r6177 r6327  
    1 /* $Id: user32.cpp,v 1.106 2001-07-05 18:10:56 sandervl Exp $ */
     1/* $Id: user32.cpp,v 1.107 2001-07-14 08:36:19 sandervl Exp $ */
    22
    33/*
     
    730730            LPLOGFONTA lpLogFont = &(lpnm->lfMenuFont);
    731731            if(fOS2Look) {
    732                 GetProfileStringA("Desktop", "MenuFont", "WarpSans",
    733                                   lpLogFont->lfFaceName, LF_FACESIZE);
    734                 lpLogFont->lfWeight = FW_BOLD;
    735                 lpLogFont->lfHeight = -GetProfileIntA("Desktop","MenuFontSize", 16);
     732                char fontname[128];
     733                char *pszFontName;
     734                BOOL fFound = TRUE;
     735
     736                if(OSLibPrfQueryProfileString(OSLIB_HINI_USER, "PM_SystemFonts", "Menus", "", fontname, sizeof(fontname)) == 1) {
     737                    if(OSLibPrfQueryProfileString(OSLIB_HINI_USER, "PM_SystemFonts", "DefaultFont", "", fontname, sizeof(fontname)) == 1) {
     738                        fFound = FALSE;
     739                    }
     740                }
     741                if(fFound) {
     742                    pszFontName = fontname;
     743                    while(*pszFontName != '.' && *pszFontName != 0) pszFontName++;
     744                    if(*pszFontName) {
     745                        *pszFontName++ = 0;
     746
     747                        strncpy(lpLogFont->lfFaceName, pszFontName, sizeof(lpLogFont->lfFaceName));
     748                        lpLogFont->lfFaceName[sizeof(lpLogFont->lfFaceName)-1] = 0;
     749                        lpLogFont->lfWeight = FW_NORMAL;
     750                        lpLogFont->lfHeight = 16; //atoi(fontname);
     751                    }
     752                    else fFound = FALSE;
     753                }
     754                if(!fFound) {
     755                    GetProfileStringA("Desktop", "MenuFont", "WarpSans",
     756                                      lpLogFont->lfFaceName, LF_FACESIZE);
     757                    lpLogFont->lfWeight = FW_BOLD;
     758                    lpLogFont->lfHeight = -GetProfileIntA("Desktop","MenuFontSize", 16);
     759                }
    736760                lpLogFont->lfWidth = 0;
    737761                lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
Note: See TracChangeset for help on using the changeset viewer.