18e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*
2231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
3231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
4dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block * Copyright (C) 2010 Stephan Aßmus <superstippi@gmx.de>
5231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block *
6231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * All rights reserved.
78e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
88e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Redistribution and use in source and binary forms, with or without
98e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * modification, are permitted provided that the following conditions
108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * are met:
118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * 1.  Redistributions of source code must retain the above copyright
138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     notice, this list of conditions and the following disclaimer.
148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * 2.  Redistributions in binary form must reproduce the above copyright
158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     notice, this list of conditions and the following disclaimer in the
168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     documentation and/or other materials provided with the distribution.
178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     its contributors may be used to endorse or promote products derived
198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     from this software without specific prior written permission.
208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
33231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#include "config.h"
34231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#include "FontCache.h"
358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
36231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#include "Font.h"
37231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#include "FontData.h"
38231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#include "FontPlatformData.h"
39231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#include "NotImplemented.h"
40231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#include <String.h>
41dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block#include <interface/Font.h>
428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectnamespace WebCore {
448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
45231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Blockvoid FontCache::platformInit()
46231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block{
47231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block}
48231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
49231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Blockconst SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length)
50231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block{
51231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    FontPlatformData data(font.fontDescription(), font.family().family());
52231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    return getCachedFontData(&data);
53231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block}
54231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
558a0914b749bbe7da7768e07a7db5c6d4bb09472bSteve BlockSimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font)
56231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block{
57231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    notImplemented();
58231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    return 0;
59231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block}
60231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
618a0914b749bbe7da7768e07a7db5c6d4bb09472bSteve BlockSimpleFontData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription)
62231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block{
63dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block    font_family family;
64dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block    font_style style;
65dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block    be_plain_font->GetFamilyAndStyle(&family, &style);
66dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block    AtomicString plainFontFamily(family);
67dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block    return getCachedFontData(fontDescription, plainFontFamily);
68231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block}
698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
70231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve BlockFontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family)
71231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block{
72231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    return new FontPlatformData(fontDescription, family);
73231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block}
748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
75231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Blockvoid FontCache::getTraitsInFamily(const AtomicString& familyName, Vector<unsigned>& traitsMasks)
76231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block{
77231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    notImplemented();
78231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block}
798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project} // namespace WebCore
818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
82