Changeset 41366 in webkit


Ignore:
Timestamp:
Mar 2, 2009, 1:55:51 PM (16 years ago)
Author:
mitz@apple.com
Message:

Reviewed by Adam Roben.

  • platform/graphics/win/FontCacheWin.cpp: (WebCore::createGDIFont): Added back code to verify that the created HFONT has the requested face name.
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r41365 r41366  
     12009-03-02  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        - fix https://bugs.webkit.org/show_bug.cgi?id=21811
     6          REGRESSION: Windows Build Not Selecting Proper Font
     7
     8        * platform/graphics/win/FontCacheWin.cpp:
     9        (WebCore::createGDIFont): Added back code to verify that the created
     10        HFONT has the requested face name.
     11
    1122009-03-02  Timothy Hatcher  <timothy@apple.com>
    213
  • trunk/WebCore/platform/graphics/win/FontCacheWin.cpp

    r39823 r41366  
    423423    matchData.m_chosen.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
    424424
    425     return CreateFontIndirect(&matchData.m_chosen);
     425    HFONT result = CreateFontIndirect(&matchData.m_chosen);
     426    if (!result)
     427        return 0;
     428
     429    HDC dc = GetDC(0);
     430    SaveDC(dc);
     431    SelectObject(dc, result);
     432    WCHAR actualName[LF_FACESIZE];
     433    GetTextFace(dc, LF_FACESIZE, actualName);
     434    RestoreDC(dc, -1);
     435    ReleaseDC(0, dc);
     436
     437    if (wcsicmp(matchData.m_chosen.lfFaceName, actualName)) {
     438        DeleteObject(result);
     439        result = 0;
     440    }
     441
     442    return result;
    426443}
    427444
Note: See TracChangeset for help on using the changeset viewer.