2009-01-13 Dimitri Glazkov <dglazkov@chromium.org>
authordglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Jan 2009 20:55:04 +0000 (20:55 +0000)
committerdglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Jan 2009 20:55:04 +0000 (20:55 +0000)
        Reviewed by Eric Seidel.

        Land portions of platform/graphics/chromium.
        https://bugs.webkit.org/show_bug.cgi?id=23297

        * platform/graphics/chromium/FontCustomPlatformData.cpp: Added.
        (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
        (WebCore::FontCustomPlatformData::fontPlatformData):
        (WebCore::EOTStream::EOTStream):
        (WebCore::EOTStream::read):
        (WebCore::readEmbedProc):
        (WebCore::createUniqueFontName):
        (WebCore::createFontCustomPlatformData):
        * platform/graphics/chromium/FontCustomPlatformData.h: Added.
        (WebCore::FontCustomPlatformData::FontCustomPlatformData):
        * platform/graphics/chromium/FontLinux.cpp: Added.
        (WebCore::Font::drawGlyphs):
        (WebCore::Font::drawComplexText):
        (WebCore::Font::floatWidthForComplexText):
        (WebCore::Font::offsetForPositionForComplexText):
        (WebCore::Font::selectionRectForComplexText):
        * platform/graphics/chromium/FontPlatformData.h: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@39875 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/graphics/chromium/FontCustomPlatformData.cpp [new file with mode: 0644]
WebCore/platform/graphics/chromium/FontCustomPlatformData.h [new file with mode: 0644]
WebCore/platform/graphics/chromium/FontLinux.cpp [new file with mode: 0644]
WebCore/platform/graphics/chromium/FontPlatformData.h [new file with mode: 0644]

index 62e20877b9b04407b78743e5f6baf18bed38919f..90a78e4ce85ff277ee98b2800abed987c476b96a 100644 (file)
@@ -1,3 +1,28 @@
+2009-01-13  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Land portions of platform/graphics/chromium.
+        https://bugs.webkit.org/show_bug.cgi?id=23297
+
+        * platform/graphics/chromium/FontCustomPlatformData.cpp: Added.
+        (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
+        (WebCore::FontCustomPlatformData::fontPlatformData):
+        (WebCore::EOTStream::EOTStream):
+        (WebCore::EOTStream::read):
+        (WebCore::readEmbedProc):
+        (WebCore::createUniqueFontName):
+        (WebCore::createFontCustomPlatformData):
+        * platform/graphics/chromium/FontCustomPlatformData.h: Added.
+        (WebCore::FontCustomPlatformData::FontCustomPlatformData):
+        * platform/graphics/chromium/FontLinux.cpp: Added.
+        (WebCore::Font::drawGlyphs):
+        (WebCore::Font::drawComplexText):
+        (WebCore::Font::floatWidthForComplexText):
+        (WebCore::Font::offsetForPositionForComplexText):
+        (WebCore::Font::selectionRectForComplexText):
+        * platform/graphics/chromium/FontPlatformData.h: Added.
+
 2009-01-13  Mark Rowe  <mrowe@apple.com>
 
         Rubber-stamped by Oliver Hunt.
diff --git a/WebCore/platform/graphics/chromium/FontCustomPlatformData.cpp b/WebCore/platform/graphics/chromium/FontCustomPlatformData.cpp
new file mode 100644 (file)
index 0000000..8f8df88
--- /dev/null
@@ -0,0 +1,232 @@
+/*
+ * Copyright (C) 2007 Apple Computer, Inc.
+ * Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "FontCustomPlatformData.h"
+
+#if PLATFORM(WIN_OS)
+#include "Base64.h"
+#include "ChromiumBridge.h"
+#include "OpenTypeUtilities.h"
+#endif
+
+#include "FontPlatformData.h"
+#include "NotImplemented.h"
+#include "SharedBuffer.h"
+
+#if PLATFORM(WIN_OS)
+#include <objbase.h>
+#include <t2embapi.h>
+#pragma comment(lib, "t2embed")
+#endif
+
+namespace WebCore {
+
+FontCustomPlatformData::~FontCustomPlatformData()
+{
+#if PLATFORM(WIN_OS)
+    if (m_fontReference) {
+        if (m_name.isNull()) {
+            ULONG status;
+            TTDeleteEmbeddedFont(m_fontReference, 0, &status);
+        } else
+            RemoveFontMemResourceEx(m_fontReference);
+    }
+#endif
+}
+
+FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode mode)
+{
+#if PLATFORM(WIN_OS)
+    ASSERT(m_fontReference);
+
+    LOGFONT logFont;
+    if (m_name.isNull())
+        TTGetNewFontName(&m_fontReference, logFont.lfFaceName, LF_FACESIZE, 0, 0);
+    else {
+        // m_name comes from createUniqueFontName, which, in turn, gets
+        // it from base64-encoded uuid (128-bit). So, m_name
+        // can never be longer than LF_FACESIZE (32).
+        if (m_name.length() + 1 >= LF_FACESIZE) {
+            ASSERT_NOT_REACHED();
+            return FontPlatformData();
+        }
+        memcpy(logFont.lfFaceName, m_name.charactersWithNullTermination(),
+               sizeof(logFont.lfFaceName[0]) * (1 + m_name.length()));
+    }
+
+    // FIXME: almost identical to FillLogFont in FontCacheWin.cpp.
+    // Need to refactor. 
+    logFont.lfHeight = -size;
+    logFont.lfWidth = 0;
+    logFont.lfEscapement = 0;
+    logFont.lfOrientation = 0;
+    logFont.lfUnderline = false;
+    logFont.lfStrikeOut = false;
+    logFont.lfCharSet = DEFAULT_CHARSET;
+    logFont.lfOutPrecision = OUT_TT_ONLY_PRECIS;
+    logFont.lfQuality = ChromiumBridge::layoutTestMode() ?
+                        NONANTIALIASED_QUALITY :
+                        DEFAULT_QUALITY; // Honor user's desktop settings.
+    logFont.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
+    logFont.lfItalic = italic;
+    logFont.lfWeight = bold ? 700 : 400;
+
+    HFONT hfont = CreateFontIndirect(&logFont);
+    return FontPlatformData(hfont, size);
+#else
+    notImplemented();
+    return FontPlatformData();
+#endif
+}
+
+#if PLATFORM(WIN_OS)
+// FIXME: EOTStream class and static functions in this #if block are
+// duplicated from platform/graphics/win/FontCustomPlatformData.cpp
+// and need to be shared.
+
+// Streams the concatenation of a header and font data.
+class EOTStream {
+public:
+    EOTStream(const Vector<UInt8, 512>& eotHeader, const SharedBuffer* fontData, size_t overlayDst, size_t overlaySrc, size_t overlayLength)
+        : m_eotHeader(eotHeader)
+        , m_fontData(fontData)
+        , m_overlayDst(overlayDst)
+        , m_overlaySrc(overlaySrc)
+        , m_overlayLength(overlayLength)
+        , m_offset(0)
+        , m_inHeader(true)
+    {
+    }
+
+    size_t read(void* buffer, size_t count);
+
+private:
+    const Vector<UInt8, 512>& m_eotHeader;
+    const SharedBuffer* m_fontData;
+    size_t m_overlayDst;
+    size_t m_overlaySrc;
+    size_t m_overlayLength;
+    size_t m_offset;
+    bool m_inHeader;
+};
+
+size_t EOTStream::read(void* buffer, size_t count)
+{
+    size_t bytesToRead = count;
+    if (m_inHeader) {
+        size_t bytesFromHeader = std::min(m_eotHeader.size() - m_offset, count);
+        memcpy(buffer, m_eotHeader.data() + m_offset, bytesFromHeader);
+        m_offset += bytesFromHeader;
+        bytesToRead -= bytesFromHeader;
+        if (m_offset == m_eotHeader.size()) {
+            m_inHeader = false;
+            m_offset = 0;
+        }
+    }
+    if (bytesToRead && !m_inHeader) {
+        size_t bytesFromData = std::min(m_fontData->size() - m_offset, bytesToRead);
+        memcpy(buffer, m_fontData->data() + m_offset, bytesFromData);
+        if (m_offset < m_overlayDst + m_overlayLength && m_offset + bytesFromData >= m_overlayDst) {
+            size_t dstOffset = std::max<int>(m_overlayDst - m_offset, 0);
+            size_t srcOffset = std::max<int>(0, m_offset - m_overlayDst);
+            size_t bytesToCopy = std::min(bytesFromData - dstOffset, m_overlayLength - srcOffset);
+            memcpy(reinterpret_cast<char*>(buffer) + dstOffset, m_fontData->data() + m_overlaySrc + srcOffset, bytesToCopy);
+        }
+        m_offset += bytesFromData;
+        bytesToRead -= bytesFromData;
+    }
+    return count - bytesToRead;
+}
+
+static unsigned long WINAPIV readEmbedProc(void* stream, void* buffer, unsigned long length)
+{
+    return static_cast<EOTStream*>(stream)->read(buffer, length);
+}
+
+// Creates a unique and unpredictable font name, in order to avoid collisions and to
+// not allow access from CSS.
+static String createUniqueFontName()
+{
+    Vector<char> fontUuid(sizeof(GUID));
+    CoCreateGuid(reinterpret_cast<GUID*>(fontUuid.data()));
+
+    Vector<char> fontNameVector;
+    base64Encode(fontUuid, fontNameVector);
+    ASSERT(fontNameVector.size() < LF_FACESIZE);
+    return String(fontNameVector.data(), fontNameVector.size());
+}
+#endif
+
+FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
+{
+    ASSERT_ARG(buffer, buffer);
+
+#if PLATFORM(WIN_OS)
+    // Introduce the font to GDI. AddFontMemResourceEx cannot be used, because it will pollute the process's
+    // font namespace (Windows has no API for creating an HFONT from data without exposing the font to the
+    // entire process first). TTLoadEmbeddedFont lets us override the font family name, so using a unique name
+    // we avoid namespace collisions.
+
+    String fontName = createUniqueFontName();
+
+    // TTLoadEmbeddedFont works only with Embedded OpenType (.eot) data,
+    // so we need to create an EOT header and prepend it to the font data.
+    Vector<UInt8, 512> eotHeader;
+    size_t overlayDst;
+    size_t overlaySrc;
+    size_t overlayLength;
+
+    if (!getEOTHeader(buffer, eotHeader, overlayDst, overlaySrc, overlayLength))
+        return 0;
+
+    HANDLE fontReference;
+    ULONG privStatus;
+    ULONG status;
+    EOTStream eotStream(eotHeader, buffer, overlayDst, overlaySrc, overlayLength);
+
+    LONG loadEmbeddedFontResult = TTLoadEmbeddedFont(&fontReference, TTLOAD_PRIVATE, &privStatus, LICENSE_PREVIEWPRINT, &status, readEmbedProc, &eotStream, const_cast<LPWSTR>(fontName.charactersWithNullTermination()), 0, 0);
+    if (loadEmbeddedFontResult == E_NONE)
+        fontName = String();
+    else {
+        fontReference = renameAndActivateFont(buffer, fontName);
+        if (!fontReference)
+            return 0;
+    }
+
+    return new FontCustomPlatformData(fontReference, fontName);
+#else
+    notImplemented();;
+    return 0;
+#endif
+}
+
+}
diff --git a/WebCore/platform/graphics/chromium/FontCustomPlatformData.h b/WebCore/platform/graphics/chromium/FontCustomPlatformData.h
new file mode 100644 (file)
index 0000000..2f1a597
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2007 Apple Computer, Inc.
+ * Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FontCustomPlatformData_h
+#define FontCustomPlatformData_h
+
+#include <wtf/Noncopyable.h>
+
+#if PLATFORM(WIN_OS)
+#include "FontRenderingMode.h"
+#include "PlatformString.h"
+#include <windows.h>
+#endif
+
+namespace WebCore {
+
+class FontPlatformData;
+class SharedBuffer;
+
+struct FontCustomPlatformData : Noncopyable {
+#if PLATFORM(WIN_OS)
+    FontCustomPlatformData(HANDLE fontReference, const String& name)
+        : m_fontReference(fontReference)
+        , m_name(name)
+    {}
+#endif
+
+    ~FontCustomPlatformData();
+
+    FontPlatformData fontPlatformData(int size, bool bold, bool italic,
+                                      FontRenderingMode = NormalRenderingMode);
+
+#if PLATFORM(WIN_OS)
+    HANDLE m_fontReference;
+    String m_name;
+#endif
+};
+
+FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer*);
+}
+
+#endif // FontCustomPlatformData_h
diff --git a/WebCore/platform/graphics/chromium/FontLinux.cpp b/WebCore/platform/graphics/chromium/FontLinux.cpp
new file mode 100644 (file)
index 0000000..7a3e614
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2007, 2008, Google Inc. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "Font.h"
+
+#include "FloatRect.h"
+#include "GlyphBuffer.h"
+#include "GraphicsContext.h"
+#include "NotImplemented.h"
+#include "PlatformContextSkia.h"
+#include "SimpleFontData.h"
+
+#include "SkCanvas.h"
+#include "SkPaint.h"
+#include "SkTemplates.h"
+#include "SkTypeface.h"
+#include "SkUtils.h"
+
+namespace WebCore {
+
+void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
+                      const GlyphBuffer& glyphBuffer,  int from, int numGlyphs,
+                      const FloatPoint& point) const {
+    SkCanvas* canvas = gc->platformContext()->canvas();
+    SkPaint paint;
+
+    gc->platformContext()->setupPaintCommon(&paint);
+    font->platformData().setupPaint(&paint);
+    paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
+    paint.setColor(gc->fillColor().rgb());
+
+    SkASSERT(sizeof(GlyphBufferGlyph) == sizeof(uint16_t));  // compile-time assert
+
+    const GlyphBufferGlyph* glyphs = glyphBuffer.glyphs(from);
+    SkScalar x = SkFloatToScalar(point.x());
+    SkScalar y = SkFloatToScalar(point.y());
+
+    // FIXME: text rendering speed:
+    // Android has code in their WebCore fork to special case when the
+    // GlyphBuffer has no advances other than the defaults. In that case the
+    // text drawing can proceed faster. However, it's unclear when those
+    // patches may be upstreamed to WebKit so we always use the slower path
+    // here.
+    const GlyphBufferAdvance* adv = glyphBuffer.advances(from);
+    SkAutoSTMalloc<32, SkPoint> storage(numGlyphs);
+    SkPoint* pos = storage.get();
+
+    for (int i = 0; i < numGlyphs; i++) {
+        pos[i].set(x, y);
+        x += SkFloatToScalar(adv[i].width());
+        y += SkFloatToScalar(adv[i].height());
+    }
+    canvas->drawPosText(glyphs, numGlyphs << 1, pos, paint);
+}
+
+void Font::drawComplexText(GraphicsContext* context, const TextRun& run,
+                           const FloatPoint& point, int from, int to) const
+{
+    notImplemented();
+}
+
+float Font::floatWidthForComplexText(const TextRun& run) const
+{
+    notImplemented();
+    return 0;
+}
+
+int Font::offsetForPositionForComplexText(const TextRun& run, int x,
+                                          bool includePartialGlyphs) const
+{
+    notImplemented();
+    return 0;
+}
+
+FloatRect Font::selectionRectForComplexText(const TextRun& run,
+                                            const IntPoint& point, int h,
+                                            int from, int to) const
+{
+    notImplemented();
+    return FloatRect();
+}
+
+}  // namespace WebCore
diff --git a/WebCore/platform/graphics/chromium/FontPlatformData.h b/WebCore/platform/graphics/chromium/FontPlatformData.h
new file mode 100644 (file)
index 0000000..c6f1912
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2007, 2008, Google Inc. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FontPlatformData_h
+#define FontPlatformData_h
+
+#if PLATFORM(WIN_OS)
+#include "FontPlatformDataChromiumWin.h"
+#elif defined(__linux__)
+#include "FontPlatformDataLinux.h"
+#endif
+
+#endif  // FontPlatformData_h