Changeset 5795 for trunk/src


Ignore:
Timestamp:
May 24, 2001, 9:26:31 PM (24 years ago)
Author:
sandervl
Message:

GetTextExtentPointA fix; call WGSS

Location:
trunk/src/gdi32
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/font.cpp

    r5585 r5795  
    1 /* $Id: font.cpp,v 1.18 2001-04-25 20:53:02 sandervl Exp $ */
     1/* $Id: font.cpp,v 1.19 2001-05-24 19:26:30 sandervl Exp $ */
    22
    33/*
     
    164164  HFONT hFont;
    165165
     166  if(lpszFace == NULL)
     167      lpszFace = "";
     168
     169  if(strlen(lpszFace) >= LF_FACESIZE)
     170  {
     171      dprintf(("ERROR: Invalid string length for font name!!"));
     172      SetLastError(ERROR_INVALID_PARAMETER);
     173      return 0;
     174  }
     175
    166176  iFontRename(lpszFace, lpstrFaceNew);
    167177
    168178  dprintf(("lpszFace = %s -> %s\n", lpszFace, lpstrFaceNew));
    169179
    170   hFont = O32_CreateFont(nHeight,
    171                          nWidth,
    172                          nEscapement,
    173                          nOrientation,
    174                          fnWeight,
    175                          fdwItalic,
    176                          fdwUnderline,
    177                          fdwStrikeOut,
    178                          fdwCharSet,
    179                          fdwOutputPrecision,
    180                          fdwClipPrecision,
    181                          fdwQuality,
    182                          fdwPitchAndFamily,
    183                          lpszFace != NULL ? lpstrFaceNew : NULL);
    184   return hFont;
     180  LOGFONTA logFont =
     181  {
     182      nHeight,
     183      nWidth,
     184      nEscapement,
     185      nOrientation,
     186      fnWeight,
     187      (BYTE)fdwItalic,
     188      (BYTE)fdwUnderline,
     189      (BYTE)fdwStrikeOut,
     190      (BYTE)fdwCharSet,
     191      (BYTE)fdwOutputPrecision,
     192      (BYTE)fdwClipPrecision,
     193      (BYTE)fdwQuality,
     194      (BYTE)fdwPitchAndFamily
     195  };
     196  strcpy(logFont.lfFaceName, lpszFace);
     197
     198  return CreateFontIndirectA(&logFont);
    185199}
    186200//******************************************************************************
  • trunk/src/gdi32/text.cpp

    r5755 r5795  
    1 /* $Id: text.cpp,v 1.20 2001-05-19 13:50:19 sandervl Exp $ */
     1/* $Id: text.cpp,v 1.21 2001-05-24 19:26:31 sandervl Exp $ */
    22
    33/*
     
    870870                                  LPSIZE lpsSize)
    871871{
     872#if 1
     873   //SvL: This works better than the code below. Can been seen clearly
     874   //     in the Settings dialog box of VirtualPC. Strings are clipped.
     875   //     (e.g.: Hard Disk 1 -> Hard Disk)
     876   return O32_GetTextExtentPoint(hdc, lpsz, cbString, lpsSize);
     877#else
    872878   BOOL       rc;
    873879   POINTLOS2  pts[TXTBOXOS_COUNT];
     
    940946   SetLastError(ERROR_SUCCESS);
    941947   return TRUE;
     948#endif
    942949}
    943950//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.