Ignore:
Timestamp:
Jun 18, 2009, 12:12:33 PM (16 years ago)
Author:
ydario
Message:

Gdi32 updates.

File:
1 edited

Legend:

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

    r10600 r21304  
    9696       else pfnFt2EnableFontEngine(bEnabled);
    9797
     98       pfnGetGlyphIndices = (PFN_FT2GETGLYPHINDICES)QueryProcAddress("Ft2GetGlyphIndices");
     99       if(!pfnGetGlyphIndices) dprintf(("Ft2GetGlyphIndices not found!!"));
     100
    98101       pfnFt2GetTextExtentW  = (PFN_FT2GETTEXTEXTENTW)QueryProcAddress("Ft2GetTextExtentW");
    99102       if(!pfnFt2GetTextExtentW) dprintf(("Ft2GetTextExtentW not found!!"));
     
    104107       if(!pfnFt2CharStringPosAtW) dprintf(("Ft2CharStringPosAtW not found!!"));
    105108
     109       pfnFt2GetGlyphOutline = (PFN_FT2GETGLYPHOUTLINE)QueryProcAddress("Ft2GetGlyphOutline");
     110       if(!pfnFt2GetGlyphOutline) dprintf(("Ft2GetGlyphOutline not found!!"));
     111
     112       pfnFt2GetFontData = (PFN_FT2GETFONTDATA)QueryProcAddress("Ft2GetFontData");
     113       if(!pfnFt2GetFontData) dprintf(("Ft2GetFontData not found!!"));
     114
    106115       pfnFt2QueryFontType = (PFN_FT2QUERYFONTTYPE)QueryProcAddress("Ft2QueryFontType");
    107116       if(!pfnFt2QueryFontType) dprintf(("Ft2QueryFontType not found!!"));
     
    109118       pfnFt2QueryStringWidthW = (PFN_FT2QUERYSTRINGWIDTHW)QueryProcAddress("Ft2QueryStringWidthW");
    110119       if(!pfnFt2QueryStringWidthW) dprintf(("Ft2QueryStringWidthW not found!!"));
     120
     121       pfnFt2GetCharacterPlacementW = (PFN_FT2GETCHARACTERPLACEMENTW)QueryProcAddress("Ft2GetCharacterPlacementW");
     122       if(!pfnFt2GetCharacterPlacementW) dprintf(("pfnFt2GetCharacterPlacementW not found!!"));
    111123
    112124       // Do not register functions for Mozilla plugins
     
    187199DWORD CFT2Module::Ft2GetGlyphIndices(HPS hps, LPCWSTR str, int c, LPWORD pgi, DWORD fl)
    188200{
     201    DWORD  ret;
     202    USHORT sel;
     203
     204    // All FreeType calls should be wrapped for saving FS
     205    if(pfnGetGlyphIndices) {
     206        sel  = RestoreOS2FS();
     207        ret  = pfnGetGlyphIndices(hps, (WCHAR*)str, c, (ULONG*)pgi, fl);
     208        SetFS(sel);
     209        return ret;
     210    }
    189211    //no fallback
    190212    SetLastError(ERROR_CALL_NOT_IMPLEMENTED_W);
     
    195217DWORD CFT2Module::Ft2GetGlyphOutline(HPS hps, UINT glyph, UINT format, LPGLYPHMETRICS lpgm, DWORD buflen, LPVOID buf, const MAT2* lpmat)
    196218{
     219    DWORD  ret;
     220    USHORT sel;
     221
     222    // All FreeType calls should be wrapped for saving FS
     223    if (pfnFt2GetGlyphOutline)
     224    {
     225        sel  = RestoreOS2FS();
     226        ret  = pfnFt2GetGlyphOutline (hps, glyph, format, lpgm, buflen, buf, lpmat);
     227        SetFS(sel);
     228        return ret;
     229    }
     230   
    197231    //no fallback
    198232    SetLastError(ERROR_INVALID_FUNCTION_W);
     
    353387                                 LPVOID lpvBuffer, DWORD cbData)
    354388{
     389    DWORD  ret;
     390    USHORT sel;
     391
     392    // All FreeType calls should be wrapped for saving FS
     393    if(pfnFt2GetFontData) {
     394        sel  = RestoreOS2FS();
     395        ret  = pfnFt2GetFontData(hps, dwTable, dwOffset, lpvBuffer, cbData);
     396        SetFS(sel);
     397        if(ret || (ret == GDI_ERROR && ERRORIDERROR(WinGetLastError(0)) != PMERR_FUNCTION_NOT_SUPPORTED))
     398            return ret;
     399    }
    355400    //no fallback
    356401    SetLastError(ERROR_CALL_NOT_IMPLEMENTED_W);
     
    501546            lpResults->lpOrder[i] = i;
    502547
     548    // All FreeType calls should be wrapped for saving FS
     549    if(pfnFt2GetCharacterPlacementW) {
     550        sel  = RestoreOS2FS();
     551        ret  = pfnFt2GetCharacterPlacementW((HPS)hdc, lpString, nSet, nMaxExtent, lpResults, dwFlags);
     552        SetFS(sel);
     553        if(ret || (ret == 0 && ERRORIDERROR(WinGetLastError(0)) != PMERR_FUNCTION_NOT_SUPPORTED))
     554        {
     555#ifdef DEBUG
     556           if(ret && lpResults->lpDx) {
     557               for (i = 0; i < nSet; i++)
     558               {
     559                   dprintf(("%c pWidthArray[%d] = %d", lpString[i], i, lpResults->lpDx[i]));
     560               }
     561           }
     562#endif
     563           if(pHps && pHps->isPrinter && pHps->hdc)
     564           {//scale for printer dcs
     565               LONG alArray[2];
     566
     567               if(OSLibDevQueryCaps(pHps, OSLIB_CAPS_HORIZONTAL_RESOLUTION, 2, &alArray[0]) &&
     568                  alArray[0] != alArray[1])
     569               {
     570                   dprintf(("Different hor/vert resolutions (%d,%d)", alArray[0], alArray[1]));
     571                   if(lpResults->lpDx) {
     572                       for (i = 0; i < nSet; i++)
     573                       {
     574                           lpResults->lpDx[i] = lpResults->lpDx[i] * alArray[0] / alArray[1];
     575                       }
     576                   }
     577                   ULONG x = (ret & 0xffff);
     578                   x = x * alArray[0] / alArray[1];
     579                   ret &= ~0xffff;
     580                   ret |= (x & 0xffff);
     581               }
     582           }
     583           return ret;
     584        }
     585    }
    503586    //fallback method
    504587
Note: See TracChangeset for help on using the changeset viewer.