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