diff options
author | Konstantin Tokarev <annulen@yandex.ru> | 2016-09-28 16:39:37 +0300 |
---|---|---|
committer | Konstantin Tokarev <annulen@yandex.ru> | 2017-02-02 12:31:01 +0000 |
commit | 9daf1655d7e4eaaa6ed5f44055a4b4fd399fd25c (patch) | |
tree | 322337ad0acbc75732f916376ec6d36e7ec0e5bc /Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp | |
parent | 6882a04fb36642862b11efe514251d32070c3d65 (diff) |
Imported WebKit commit eb954cdcf58f9b915b2fcb6f8e4cb3a60650a4f3
Change-Id: I8dda875c38075d43b76fe3a21acb0ffa102bb82d
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
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 <QStringList> namespace WebCore { @@ -41,7 +39,6 @@ FontPlatformData FontCustomPlatformData::fontPlatformData(const FontDescription& std::unique_ptr<FontCustomPlatformData> createFontCustomPlatformData(SharedBuffer& buffer) { -#if USE(ZLIB) SharedBuffer* fontBuffer = &buffer; RefPtr<SharedBuffer> sfntBuffer; if (isWOFF(&buffer)) { @@ -52,15 +49,9 @@ std::unique_ptr<FontCustomPlatformData> 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 ; } |