Changeset 12283


Ignore:
Timestamp:
Nov 10, 1999, 11:44:19 PM (25 years ago)
Author:
phaller
Message:

Fix: code cleaning + debug info

File:
1 edited

Legend:

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

    r12260 r12283  
    1 /* $Id: font.cpp,v 1.2 1999-11-09 19:52:33 phaller Exp $ */
     1/* $Id: font.cpp,v 1.3 1999-11-10 22:44:19 phaller Exp $ */
    22
    33/*
     
    3737//******************************************************************************
    3838//******************************************************************************
    39 HFONT WIN32API CreateFontA(int arg1, int arg2, int arg3, int arg4, int arg5,
    40                                DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9,
    41                                DWORD arg10, DWORD arg11, DWORD arg12, DWORD arg13, LPCSTR arg14)
    42 {
    43  HFONT hfont;
    44 
    45     hfont = O32_CreateFont(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14);
    46     dprintf(("GDI32: CreateFontA '%s' returned %D\n", arg14, hfont));
    47     return(hfont);
    48 }
    49 //******************************************************************************
    50 //******************************************************************************
    51 HFONT WIN32API CreateFontW(int arg1, int arg2, int arg3, int arg4, int arg5,
    52                               DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9,
    53                               DWORD arg10, DWORD arg11, DWORD arg12, DWORD arg13, LPCWSTR arg14)
    54 {
    55  char *astring = UnicodeToAsciiString((LPWSTR)arg14);
    56  HFONT rc;
    57 
    58    dprintf(("GDI32: OS2CreateFontW\n"));
    59    rc = O32_CreateFont(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, astring);
    60    FreeAsciiString(astring);
    61    return(rc);
    62 }
     39ODINFUNCTION14(HFONT,  CreateFontA,
     40               int,    nHeight,
     41               int,    nWidth,
     42               int,    nEscapement,
     43               int,    nOrientation,
     44               int,    fnWeight,
     45               DWORD,  fdwItalic,
     46               DWORD,  fdwUnderline,
     47               DWORD,  fdwStrikeOut,
     48               DWORD,  fdwCharSet,
     49               DWORD,  fdwOutputPrecision,
     50               DWORD,  fdwClipPrecision,
     51               DWORD,  fdwQuality,
     52               DWORD,  fdwPitchAndFamily,
     53               LPCSTR, lpszFace)
     54{
     55  dprintf(("lpszFace = %s\n", lpszFace));
     56
     57  return  O32_CreateFont(nHeight,
     58                         nWidth,
     59                         nEscapement,
     60                         nOrientation,
     61                         fnWeight,
     62                         fdwItalic,
     63                         fdwUnderline,
     64                         fdwStrikeOut,
     65                         fdwCharSet,
     66                         fdwOutputPrecision,
     67                         fdwClipPrecision,
     68                         fdwQuality,
     69                         fdwPitchAndFamily,
     70                         lpszFace);
     71}
     72//******************************************************************************
     73//******************************************************************************
     74ODINFUNCTION14(HFONT,  CreateFontW,
     75               int,    nHeight,
     76               int,    nWidth,
     77               int,    nEscapement,
     78               int,    nOrientation,
     79               int,    fnWeight,
     80               DWORD,  fdwItalic,
     81               DWORD,  fdwUnderline,
     82               DWORD,  fdwStrikeOut,
     83               DWORD,  fdwCharSet,
     84               DWORD,  fdwOutputPrecision,
     85               DWORD,  fdwClipPrecision,
     86               DWORD,  fdwQuality,
     87               DWORD,  fdwPitchAndFamily,
     88               LPCWSTR,lpszFace)
     89{
     90  char *astring;
     91  HFONT hFont;
     92
     93  // NULL is valid for lpszFace
     94  if(lpszFace != NULL)
     95    astring = UnicodeToAsciiString((LPWSTR)lpszFace);
     96  else
     97    astring = NULL;
     98
     99  // @@@PH switch to ODIN_ later
     100  hFont =    CreateFontA(nHeight,
     101                         nWidth,
     102                         nEscapement,
     103                         nOrientation,
     104                         fnWeight,
     105                         fdwItalic,
     106                         fdwUnderline,
     107                         fdwStrikeOut,
     108                         fdwCharSet,
     109                         fdwOutputPrecision,
     110                         fdwClipPrecision,
     111                         fdwQuality,
     112                         fdwPitchAndFamily,
     113                         astring);
     114  if (astring != NULL)
     115    FreeAsciiString(astring);
     116
     117  return(hFont);
     118}
     119
    63120//******************************************************************************
    64121//******************************************************************************
     
    95152  //memcpy(&afont, lplf, ((int)&afont.lfFaceName - (int)&afont));
    96153  memcpy(&afont, lplf, sizeof(LOGFONTA));
     154  memset(afont.lfFaceName, 0, LF_FACESIZE);
    97155  UnicodeToAsciiN((WCHAR *)lplf->lfFaceName, afont.lfFaceName, LF_FACESIZE-1);
    98156  hfont = CreateFontIndirectA(&afont);
Note: See TracChangeset for help on using the changeset viewer.