1 /*
   2  * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #include "config.h"
  27 
  28 #include "NotImplemented.h"
  29 #include <wtf/text/AtomicString.h>
  30 #include "FontCache.h"
  31 #include "FontRanges.h"
  32 #include "FontPlatformData.h"
  33 #include "Font.h"
  34 #include "FontSelector.h"
  35 
  36 namespace WebCore {
  37 
  38 void FontCache::platformInit()
  39 {
  40 }
  41 
  42 RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription&, const Font*, bool, const UChar*, unsigned)
  43 {
  44     return nullptr;
  45 }
  46 
  47 
  48 std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family, const FontFeatureSettings*, const FontVariantSettings*, FontSelectionSpecifiedCapabilities) {
  49 
  50     return FontPlatformData::create(fontDescription, family);
  51 }
  52 
  53 Ref<Font> FontCache::lastResortFallbackFont(const FontDescription& fontDescription)
  54 {
  55     // We want to return a fallback font here, otherwise the logic preventing FontConfig
  56     // matches for non-fallback fonts might return 0. See isFallbackFontAllowed.
  57     static AtomicString timesStr("serif");
  58     return *fontForFamily(fontDescription, timesStr);
  59 }
  60 
  61 Vector<String> FontCache::systemFontFamilies()
  62 {
  63     // FIXME: <https://webkit.org/b/147018> Web Inspector: [Freetype] Allow inspector to retrieve a list of system fonts
  64     // FIXME: JDK-8146864
  65     notImplemented();
  66     return Vector<String>();
  67 }
  68 
  69 const AtomicString& FontCache::platformAlternateFamilyName(const AtomicString&)
  70 {
  71     notImplemented();
  72     return nullAtom();
  73 }
  74 
  75 Vector<FontSelectionCapabilities> FontCache::getFontSelectionCapabilitiesInFamily(const AtomicString&, AllowUserInstalledFonts)
  76 {
  77     notImplemented();
  78     return { };
  79 }
  80 
  81 }
  82