Changeset 31322 in webkit


Ignore:
Timestamp:
Mar 26, 2008 12:01:31 PM (16 years ago)
Author:
hyatt@apple.com
Message:

2008-03-26 David Hyatt <hyatt@apple.com>

Make the Ahem font antialias correctly on Acid3.

Reviewed by Dan

  • platform/graphics/SimpleFontData.h:
  • platform/graphics/mac/FontMac.mm: (WebCore::Font::drawGlyphs):
  • platform/graphics/mac/SimpleFontDataMac.mm: (WebCore::SimpleFontData::platformInit):
  • platform/graphics/win/FontCGWin.cpp: (WebCore::Font::drawGlyphs):
  • platform/graphics/win/SimpleFontDataCGWin.cpp: (WebCore::SimpleFontData::platformInit):
Location:
trunk/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r31321 r31322  
     12008-03-26  David Hyatt  <hyatt@apple.com>
     2
     3        Make the Ahem font antialias correctly on Acid3.
     4
     5        Reviewed by Dan
     6
     7        * platform/graphics/SimpleFontData.h:
     8        * platform/graphics/mac/FontMac.mm:
     9        (WebCore::Font::drawGlyphs):
     10        * platform/graphics/mac/SimpleFontDataMac.mm:
     11        (WebCore::SimpleFontData::platformInit):
     12        * platform/graphics/win/FontCGWin.cpp:
     13        (WebCore::Font::drawGlyphs):
     14        * platform/graphics/win/SimpleFontDataCGWin.cpp:
     15        (WebCore::SimpleFontData::platformInit):
     16
    1172008-03-26  Mark Rowe  <mrowe@apple.com>
    218
  • trunk/WebCore/platform/graphics/SimpleFontData.h

    r30441 r31322  
    162162#if PLATFORM(CG)
    163163    float m_syntheticBoldOffset;
     164    bool m_allowFontSmoothing;
    164165#endif
    165166
  • trunk/WebCore/platform/graphics/mac/FontMac.mm

    r30997 r31322  
    609609
    610610    bool originalShouldUseFontSmoothing = wkCGContextGetShouldSmoothFonts(cgContext);
    611     bool newShouldUseFontSmoothing = WebCoreShouldUseFontSmoothing();
     611    bool newShouldUseFontSmoothing = WebCoreShouldUseFontSmoothing() && font->m_allowFontSmoothing;
    612612   
    613613    if (originalShouldUseFontSmoothing != newShouldUseFontSmoothing)
  • trunk/WebCore/platform/graphics/mac/SimpleFontDataMac.mm

    r30997 r31322  
    257257    } else
    258258        m_xHeight = [m_font.font() xHeight];
     259       
     260    // Workaround for strange CG antialiasing of the Ahem font. Limit to the Web font version.
     261    if (isCustomFont()) {
     262        RetainPtr<CFStringRef> fullName(AdoptCF, CGFontCopyFullName(m_font.cgFont()));
     263        String nameStr(fullName.get());
     264        m_allowFontSmoothing = (nameStr != "Ahem");
     265    }
    259266}
    260267
  • trunk/WebCore/platform/graphics/win/FontCGWin.cpp

    r31246 r31322  
    267267    CGContextRef cgContext = graphicsContext->platformContext();
    268268
    269     uint32_t oldFontSmoothingStyle = wkSetFontSmoothingStyle(cgContext);
     269    uint32_t oldFontSmoothingStyle = wkSetFontSmoothingStyle(cgContext, font->m_allowFontSmoothing);
    270270
    271271    const FontPlatformData& platformData = font->platformData();
  • trunk/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp

    r30441 r31322  
    113113        m_xHeight = scaleEmToUnits(iXHeight, m_unitsPerEm) * pointSize;
    114114    }
     115   
     116    // Workaround for strange CG antialiasing of the Ahem font. Limit to the Web font version.
     117    if (isCustomFont()) {
     118        RetainPtr<CFStringRef> fullName(AdoptCF, CGFontCopyFullName(m_font.cgFont()));
     119        String nameStr(fullName.get());
     120        m_allowFontSmoothing = (nameStr != "Ahem");
     121    }
    115122}
    116123
Note: See TracChangeset for help on using the changeset viewer.