Ignore:
Timestamp:
May 24, 2004, 10:51:25 AM (21 years ago)
Author:
sandervl
Message:

KOM: update

File:
1 edited

Legend:

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

    r10373 r10605  
    1 /* $Id: font.cpp,v 1.35 2004-01-11 11:42:11 sandervl Exp $ */
     1/* $Id: font.cpp,v 1.36 2004-05-24 08:50:31 sandervl Exp $ */
    22
    33/*
     
    319319        strcpy( afont.lfFaceName, "WarpSans Combined" );
    320320    }
     321
     322#if 1
     323    if( afont.lfCharSet == ANSI_CHARSET )
     324        afont.lfCharSet = DEFAULT_CHARSET;
     325#endif
    321326  }
    322327
     
    901906    else {
    902907        switch(charset) {
    903         case OEM_CHARSET:
    904             cp = GetOEMCP();
    905             break;
    906         case DEFAULT_CHARSET:
    907             cp = GetACP();
    908             break;
    909 
    910         case VISCII_CHARSET:
    911         case TCVN_CHARSET:
    912         case KOI8_CHARSET:
    913         case ISO3_CHARSET:
    914         case ISO4_CHARSET:
    915           /* FIXME: These have no place here, but because x11drv
    916              enumerates fonts with these (made up) charsets some apps
    917              might use them and then the FIXME below would become
    918              annoying.  Now we could pick the intended codepage for
    919              each of these, but since it's broken anyway we'll just
    920              use CP_ACP and hope it'll go away...
    921           */
    922             cp = CP_ACP;
    923             break;
    924 
    925 
    926         default:
    927             dprintf(("Can't find codepage for charset %d\n", charset));
    928             break;
    929         }
     908    case OEM_CHARSET:
     909        cp = GetOEMCP();
     910        break;
     911    case DEFAULT_CHARSET:
     912        cp = GetACP();
     913        break;
     914
     915    case VISCII_CHARSET:
     916    case TCVN_CHARSET:
     917    case KOI8_CHARSET:
     918    case ISO3_CHARSET:
     919    case ISO4_CHARSET:
     920      /* FIXME: These have no place here, but because x11drv
     921         enumerates fonts with these (made up) charsets some apps
     922         might use them and then the FIXME below would become
     923         annoying.  Now we could pick the intended codepage for
     924         each of these, but since it's broken anyway we'll just
     925         use CP_ACP and hope it'll go away...
     926      */
     927        cp = CP_ACP;
     928        break;
     929
     930
     931    default:
     932        dprintf(("Can't find codepage for charset %d\n", charset));
     933        break;
     934    }
    930935    }
    931936
     
    935940    if(cp != CP_SYMBOL) {
    936941        lenW = MultiByteToWideChar(cp, 0, str, count, NULL, 0);
    937         strW = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, (lenW + 1) * sizeof(WCHAR));
    938         MultiByteToWideChar(cp, 0, str, count, strW, lenW);
     942    strW = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, (lenW + 1) * sizeof(WCHAR));
     943    MultiByteToWideChar(cp, 0, str, count, strW, lenW);
    939944    } else {
    940945        lenW = count;
    941         strW = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, (lenW + 1) * sizeof(WCHAR));
    942         for(i = 0; i < count; i++) strW[i] = (BYTE)str[i];
     946    strW = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, (lenW + 1) * sizeof(WCHAR));
     947    for(i = 0; i < count; i++) strW[i] = (BYTE)str[i];
    943948    }
    944949    strW[lenW] = '\0';
     
    953958 */
    954959DWORD WINAPI GetGlyphIndicesA(HDC hdc, LPCSTR lpstr, INT count,
    955                               LPWORD pgi, DWORD flags)
     960                  LPWORD pgi, DWORD flags)
    956961{
    957962    DWORD ret;
     
    973978 */
    974979DWORD WINAPI GetGlyphIndicesW(HDC hdc, LPCWSTR lpstr, INT count,
    975                               LPWORD pgi, DWORD flags)
     980                  LPWORD pgi, DWORD flags)
    976981{
    977982    DWORD ret;
     
    982987    if(!hdc) return GDI_ERROR;
    983988
    984     ret = FT2Module.Ft2GetGlyphIndices(hdc, lpstr, count , pgi, flags); 
     989    ret = FT2Module.Ft2GetGlyphIndices(hdc, lpstr, count , pgi, flags);
    985990    if(ret != GDI_ERROR) {
    986991        for(int i=0;i<ret;i++) {
     
    10071012        if (p)
    10081013        {
    1009             c = p[0];
    1010         }
    1011         else
    1012         {
     1014        c = p[0];
     1015    }
     1016    else
     1017    {
    10131018            SetLastError(ERROR_NOT_ENOUGH_MEMORY);
    1014             return GDI_ERROR;
    1015         }
     1019        return GDI_ERROR;
     1020    }
    10161021    }
    10171022    else
     
    10191024        c = uChar;
    10201025    }
    1021    
     1026
    10221027    ret = GetGlyphOutlineW (hdc, c, fuFormat, lpgm, cbBuffer, lpBuffer, lpmat2);
    1023    
     1028
    10241029    if (p != NULL)
    10251030    {
    10261031        HeapFree (GetProcessHeap(), 0, p);
    10271032    }
    1028    
     1033
    10291034    return ret;
    10301035}
Note: See TracChangeset for help on using the changeset viewer.