1 /* 2 Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 Copyright (C) 2008 Holger Hans Peter Freyther 4 Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 5 Copyright (C) 2007 Nicholas Shanks <webkit (at) nickshanks.com> 6 7 This library is free software; you can redistribute it and/or 8 modify it under the terms of the GNU Library General Public 9 License as published by the Free Software Foundation; either 10 version 2 of the License, or (at your option) any later version. 11 12 This library is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 Library General Public License for more details. 16 17 You should have received a copy of the GNU Library General Public License 18 along with this library; see the file COPYING.LIB. If not, write to 19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 Boston, MA 02110-1301, USA. 21 22 This class provides all functionality needed for loading images, style sheets and html 23 pages from the web. It has a memory cache for these objects. 24 */ 25 #include "config.h" 26 #include "FontCache.h" 27 28 #include "FontDescription.h" 29 #include "FontPlatformData.h" 30 #include "Font.h" 31 #include "PlatformString.h" 32 #include "StringHash.h" 33 #include <utility> 34 #include <wtf/ListHashSet.h> 35 #include <wtf/StdLibExtras.h> 36 37 #include <QFont> 38 39 using namespace WTF; 40 41 namespace WebCore { 42 43 void FontCache::platformInit() 44 { 45 } 46 47 const SimpleFontData* FontCache::getFontDataForCharacters(const Font&, const UChar*, int) 48 { 49 return 0; 50 } 51 52 SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font) 53 { 54 return 0; 55 } 56 57 SimpleFontData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription) 58 { 59 const AtomicString fallbackFamily = QFont(fontDescription.family().family()).lastResortFamily(); 60 return getCachedFontData(new FontPlatformData(fontDescription, fallbackFamily)); 61 } 62 63 void FontCache::getTraitsInFamily(const AtomicString&, Vector<unsigned>&) 64 { 65 } 66 67 FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& familyName) 68 { 69 return new FontPlatformData(fontDescription, familyName); 70 } 71 72 } // namespace WebCore 73