1 /* 2 * Copyright (C) 2006 Dirk Mueller <mueller (at) kde.org> 3 * Copyright (C) 2007 Ryan Leavengood <leavengood (at) gmail.com> 4 * Copyright (C) 2010 Stephan Amus <superstippi (at) gmx.de> 5 * 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 12 * 1. Redistributions of source code must retain the above copyright 13 * notice, this list of conditions and the following disclaimer. 14 * 2. Redistributions in binary form must reproduce the above copyright 15 * notice, this list of conditions and the following disclaimer in the 16 * documentation and/or other materials provided with the distribution. 17 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of 18 * its contributors may be used to endorse or promote products derived 19 * from this software without specific prior written permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY 22 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY 25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33 #include "config.h" 34 #include "FontCache.h" 35 36 #include "Font.h" 37 #include "FontData.h" 38 #include "FontPlatformData.h" 39 #include "NotImplemented.h" 40 #include <String.h> 41 #include <interface/Font.h> 42 43 namespace WebCore { 44 45 void FontCache::platformInit() 46 { 47 } 48 49 const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length) 50 { 51 FontPlatformData data(font.fontDescription(), font.family().family()); 52 return getCachedFontData(&data); 53 } 54 55 SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font) 56 { 57 notImplemented(); 58 return 0; 59 } 60 61 SimpleFontData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription) 62 { 63 font_family family; 64 font_style style; 65 be_plain_font->GetFamilyAndStyle(&family, &style); 66 AtomicString plainFontFamily(family); 67 return getCachedFontData(fontDescription, plainFontFamily); 68 } 69 70 FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family) 71 { 72 return new FontPlatformData(fontDescription, family); 73 } 74 75 void FontCache::getTraitsInFamily(const AtomicString& familyName, Vector<unsigned>& traitsMasks) 76 { 77 notImplemented(); 78 } 79 80 } // namespace WebCore 81 82