Changeset 44015 in webkit


Ignore:
Timestamp:
May 21, 2009 5:15:48 PM (15 years ago)
Author:
levin@chromium.org
Message:

2009-05-21 Evan Martin <evan@chromium.org>

Reviewed by Eric Seidel.

Flesh out font fallback for Chromium's Skia port.
getLastResortFallbackFont should fall back on well-known fonts.
https://bugs.webkit.org/show_bug.cgi?id=25860

  • platform/graphics/chromium/FontCacheLinux.cpp: (WebCore::FontCache::getLastResortFallbackFont): try known font names.
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r44011 r44015  
     12009-05-21  Evan Martin  <evan@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Flesh out font fallback for Chromium's Skia port.
     6        getLastResortFallbackFont should fall back on well-known fonts.
     7        https://bugs.webkit.org/show_bug.cgi?id=25860
     8
     9        * platform/graphics/chromium/FontCacheLinux.cpp:
     10        (WebCore::FontCache::getLastResortFallbackFont): try known font names.
     11
    1122009-05-21  Dan Bernstein  <mitz@apple.com>
    213
  • trunk/WebCore/platform/graphics/chromium/FontCacheLinux.cpp

    r43756 r44015  
    4646#include "SkTypeface.h"
    4747#include "SkUtils.h"
     48
     49#include <wtf/Assertions.h>
    4850
    4951namespace WebCore {
     
    98100FontPlatformData* FontCache::getLastResortFallbackFont(const FontDescription& description)
    99101{
    100     static AtomicString arialStr("Arial");
    101     return getCachedFontPlatformData(description, arialStr);
     102    static const AtomicString sansStr("Sans");
     103    static const AtomicString serifStr("Serif");
     104    static const AtomicString monospaceStr("Monospace");
     105
     106    FontPlatformData* fontPlatformData = 0;
     107    switch (description.genericFamily()) {
     108    case FontDescription::SerifFamily:
     109        fontPlatformData = getCachedFontPlatformData(description, serifStr);
     110        break;
     111    case FontDescription::MonospaceFamily:
     112        fontPlatformData = getCachedFontPlatformData(description, monospaceStr);
     113        break;
     114    case FontDescription::SansSerifFamily:
     115    default:
     116        fontPlatformData = getCachedFontPlatformData(description, sansStr);
     117        break;
     118    }
     119
     120    ASSERT(fontPlatformData);
     121    return fontPlatformData;
    102122}
    103123
Note: See TracChangeset for help on using the changeset viewer.