From 9daf1655d7e4eaaa6ed5f44055a4b4fd399fd25c Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Wed, 28 Sep 2016 16:39:37 +0300 Subject: Imported WebKit commit eb954cdcf58f9b915b2fcb6f8e4cb3a60650a4f3 Change-Id: I8dda875c38075d43b76fe3a21acb0ffa102bb82d Reviewed-by: Konstantin Tokarev --- .../platform/graphics/qt/FontCustomPlatformDataQt.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp') diff --git a/Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp b/Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp index 39cd47ce2..78e159aa0 100644 --- a/Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp +++ b/Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp @@ -24,9 +24,7 @@ #include "FontPlatformData.h" #include "SharedBuffer.h" -#if USE(ZLIB) #include "WOFFFileFormat.h" -#endif #include namespace WebCore { @@ -41,7 +39,6 @@ FontPlatformData FontCustomPlatformData::fontPlatformData(const FontDescription& std::unique_ptr createFontCustomPlatformData(SharedBuffer& buffer) { -#if USE(ZLIB) SharedBuffer* fontBuffer = &buffer; RefPtr sfntBuffer; if (isWOFF(&buffer)) { @@ -52,15 +49,9 @@ std::unique_ptr createFontCustomPlatformData(SharedBuffe sfntBuffer = SharedBuffer::adoptVector(sfnt); fontBuffer = sfntBuffer.get(); } -#endif // USE(ZLIB) const QByteArray fontData(fontBuffer->data(), fontBuffer->size()); -#if !USE(ZLIB) - if (fontData.startsWith("wOFF")) { - qWarning("WOFF support requires QtWebKit to be built with zlib support."); - return 0; - } -#endif // !USE(ZLIB) + // Pixel size doesn't matter at this point, it is set in FontCustomPlatformData::fontPlatformData. QRawFont rawFont(fontData, /*pixelSize = */0, QFont::PreferDefaultHinting); if (!rawFont.isValid()) @@ -75,8 +66,9 @@ bool FontCustomPlatformData::supportsFormat(const String& format) { return equalLettersIgnoringASCIICase(format, "truetype") || equalLettersIgnoringASCIICase(format, "opentype") -#if USE(ZLIB) || equalLettersIgnoringASCIICase(format, "woff") +#if USE(WOFF2) + || equalLettersIgnoringASCIICase(format, "woff2") #endif ; } -- cgit v1.2.3