Changeset 64434 in webkit
- Timestamp:
- Jul 31, 2010, 10:04:57 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r64433 r64434 1 2010-07-31 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 <rdar://problem/8234766> Add WOFF support for @font-face 6 https://bugs.webkit.org/show_bug.cgi?id=31302 7 8 * platform/mac/Skipped: Enabled fast/css/font-face-woff.html. 9 * platform/mac/fast/css/font-face-woff-expected.checksum: Added. 10 * platform/mac/fast/css/font-face-woff-expected.png: Added. 11 * platform/mac/fast/css/font-face-woff-expected.txt: Added. 12 1 13 2010-07-31 Sam Weinig <sam@webkit.org> 2 14 -
trunk/LayoutTests/platform/mac/Skipped
r64424 r64434 156 156 # https://bugs.webkit.org/show_bug.cgi?id=33812 157 157 fast/dom/icon-url-property.html 158 159 # Doesn't support WOFF yet.160 fast/css/font-face-woff.html161 158 162 159 # EventSendingController does not send events on areas outside the WebView. -
trunk/WebCore/ChangeLog
r64432 r64434 1 2010-07-31 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 <rdar://problem/8234766> Add WOFF support for @font-face 6 https://bugs.webkit.org/show_bug.cgi?id=31302 7 8 * WebCore.vcproj/WebCore.vcproj: Added WOFFFileFormat.{cpp,h}. 9 * WebCore.vcproj/WebCoreCommon.vsprops: Added $(WebKitLibraries)\include\zlib to the header search path. 10 * WebCore.xcodeproj/project.pbxproj: Added WOFFFileFormat.{cpp,h} and linking against libz. 11 * css/CSSFontFaceSrcValue.cpp: 12 (WebCore::CSSFontFaceSrcValue::isSupportedFormat): Replaced hard-coded list of supported formats with 13 call to FontCustomPlatformData::supportsFormat(). 14 * platform/graphics/WOFFFileFormat.cpp: Added. 15 (WebCore::isWOFF): Checks if the buffer has the WOFF signature. 16 (WebCore::convertWOFFToSfnt): Extracts the sfnt payload of a WOFF package. 17 * platform/graphics/WOFFFileFormat.h: Added. 18 * platform/graphics/cairo/FontCustomPlatformData.cpp: 19 (WebCore::FontCustomPlatformData::supportsFormat): Added. Returns true for truetype and opentype. 20 * platform/graphics/cairo/FontCustomPlatformData.h: 21 * platform/graphics/chromium/FontCustomPlatformData.cpp: 22 (WebCore::FontCustomPlatformData::supportsFormat): Added. Returns true for truetype and opentype, 23 and also for woff if the OpenType sanitizer is enabled. 24 * platform/graphics/chromium/FontCustomPlatformData.h: 25 * platform/graphics/gtk/FontCustomPlatformDataPango.cpp: 26 (WebCore::FontCustomPlatformData::supportsFormat): Added. Returns false. 27 * platform/graphics/haiku/FontCustomPlatformData.cpp: 28 (WebCore::FontCustomPlatformData::supportsFormat): Ditto. 29 * platform/graphics/haiku/FontCustomPlatformData.h: 30 * platform/graphics/mac/FontCustomPlatformData.cpp: 31 (WebCore::freeSfntData): 32 (WebCore::createFontCustomPlatformData): If the OpenType font sanitizer is not enabled, use convertWOFFToSfnt(). 33 (WebCore::FontCustomPlatformData::supportsFormat): Added. Returns true for truetype, opentype and woff. 34 * platform/graphics/mac/FontCustomPlatformData.h: 35 * platform/graphics/qt/FontCustomPlatformData.h: 36 * platform/graphics/qt/FontCustomPlatformDataQt.cpp: 37 (WebCore::FontCustomPlatformData::supportsFormat): Added. Returns true for truetype and opentype. 38 * platform/graphics/win/FontCustomPlatformData.cpp: 39 (WebCore::createFontCustomPlatformData): If the OpenType font sanitizer is not enabled, use convertWOFFToSfnt(). 40 (WebCore::FontCustomPlatformData::supportsFormat): Added. Returns true for truetype, opentype and woff. 41 * platform/graphics/win/FontCustomPlatformData.h: 42 * platform/graphics/win/FontCustomPlatformDataCairo.cpp: 43 (WebCore::FontCustomPlatformData::supportsFormat): Added. Returns true for truetype and opentype. 44 * platform/graphics/win/FontCustomPlatformDataCairo.h: 45 * platform/graphics/wince/FontCustomPlatformData.cpp: 46 (WebCore::FontCustomPlatformData::supportsFormat): Ditto. 47 * platform/graphics/wince/FontCustomPlatformData.h: 48 1 49 2010-07-31 Ryosuke Niwa <rniwa@webkit.org> 2 50 -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r64425 r64434 24361 24361 </File> 24362 24362 <File 24363 RelativePath="..\platform\graphics\WOFFFileFormat.cpp" 24364 > 24365 </File> 24366 <File 24367 RelativePath="..\platform\graphics\WOFFFileFormat.h" 24368 > 24369 </File> 24370 <File 24363 24371 RelativePath="..\platform\graphics\UnitBezier.h" 24364 24372 > -
trunk/WebCore/WebCore.vcproj/WebCoreCommon.vsprops
r63833 r64434 8 8 <Tool 9 9 Name="VCCLCompilerTool" 10 AdditionalIncludeDirectories=""$(ProjectDir)..";"$(ProjectDir)..\accessibility";"$(ProjectDir)..\accessibility\win";"$(ProjectDir)..\bridge";"$(ProjectDir)..\bridge\c";"$(ProjectDir)..\bridge\jsc";"$(ProjectDir)..\css";"$(ProjectDir)..\editing";"$(ProjectDir)..\rendering";"$(ProjectDir)..\rendering\style";"$(ProjectDir)..\bindings";"$(ProjectDir)..\bindings\generic";"$(ProjectDir)..\bindings\js";"$(ProjectDir)..\dom";"$(ProjectDir)..\dom\default";"$(ProjectDir)..\history";"$(ProjectDir)..\html";"$(ProjectDir)..\html\canvas";"$(ProjectDir)..\inspector";"$(ProjectDir)..\loader";"$(ProjectDir)..\loader\appcache";"$(ProjectDir)..\loader\archive";"$(ProjectDir)..\loader\archive\cf";"$(ProjectDir)..\loader\icon";"$(ProjectDir)..\notifications";"$(ProjectDir)..\page";"$(ProjectDir)..\page\animation";"$(ProjectDir)..\page\win";"$(ProjectDir)..\platform";"$(ProjectDir)..\platform\animation";"$(ProjectDir)..\platform\mock";"$(ProjectDir)..\platform\sql";"$(ProjectDir)..\platform\win";"$(ProjectDir)..\platform\network";"$(ProjectDir)..\platform\network\win";"$(ProjectDir)..\platform\cf";"$(ProjectDir)..\platform\graphics";"$(ProjectDir)..\platform\graphics\filters";"$(ProjectDir)..\platform\graphics\opentype";"$(ProjectDir)..\platform\graphics\transforms";"$(ProjectDir)..\platform\text";"$(ProjectDir)..\platform\text\transcoder";"$(ProjectDir)..\platform\graphics\win";"$(ProjectDir)..\xml";"$(WebKitOutputDir)\obj\WebCore\DerivedSources";"$(ProjectDir)..\plugins";"$(ProjectDir)..\plugins\win";"$(ProjectDir)..\svg\animation";"$(ProjectDir)..\svg\graphics";"$(ProjectDir)..\svg\graphics\filters";"$(ProjectDir)..\svg";"$(ProjectDir)..\wml";"$(ProjectDir)..\storage";"$(ProjectDir)..\websockets";"$(ProjectDir)..\workers";"$(WebKitOutputDir)\include";"$(WebKitOutputDir)\include\private";"$(WebKitOutputDir)\include\JavaScriptCore";"$(WebKitOutputDir)\include\private\JavaScriptCore";"$(ProjectDir)..\ForwardingHeaders";"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\include\private";"$(WebKitLibrariesDir)\include\private\JavaScriptCore";"$(WebKitLibrariesDir)\include\pthreads";"$(WebKitLibrariesDir)\include\sqlite";"$(WebKitLibrariesDir)\include\JavaScriptCore" "10 AdditionalIncludeDirectories=""$(ProjectDir)..";"$(ProjectDir)..\accessibility";"$(ProjectDir)..\accessibility\win";"$(ProjectDir)..\bridge";"$(ProjectDir)..\bridge\c";"$(ProjectDir)..\bridge\jsc";"$(ProjectDir)..\css";"$(ProjectDir)..\editing";"$(ProjectDir)..\rendering";"$(ProjectDir)..\rendering\style";"$(ProjectDir)..\bindings";"$(ProjectDir)..\bindings\generic";"$(ProjectDir)..\bindings\js";"$(ProjectDir)..\dom";"$(ProjectDir)..\dom\default";"$(ProjectDir)..\history";"$(ProjectDir)..\html";"$(ProjectDir)..\html\canvas";"$(ProjectDir)..\inspector";"$(ProjectDir)..\loader";"$(ProjectDir)..\loader\appcache";"$(ProjectDir)..\loader\archive";"$(ProjectDir)..\loader\archive\cf";"$(ProjectDir)..\loader\icon";"$(ProjectDir)..\notifications";"$(ProjectDir)..\page";"$(ProjectDir)..\page\animation";"$(ProjectDir)..\page\win";"$(ProjectDir)..\platform";"$(ProjectDir)..\platform\animation";"$(ProjectDir)..\platform\mock";"$(ProjectDir)..\platform\sql";"$(ProjectDir)..\platform\win";"$(ProjectDir)..\platform\network";"$(ProjectDir)..\platform\network\win";"$(ProjectDir)..\platform\cf";"$(ProjectDir)..\platform\graphics";"$(ProjectDir)..\platform\graphics\filters";"$(ProjectDir)..\platform\graphics\opentype";"$(ProjectDir)..\platform\graphics\transforms";"$(ProjectDir)..\platform\text";"$(ProjectDir)..\platform\text\transcoder";"$(ProjectDir)..\platform\graphics\win";"$(ProjectDir)..\xml";"$(WebKitOutputDir)\obj\WebCore\DerivedSources";"$(ProjectDir)..\plugins";"$(ProjectDir)..\plugins\win";"$(ProjectDir)..\svg\animation";"$(ProjectDir)..\svg\graphics";"$(ProjectDir)..\svg\graphics\filters";"$(ProjectDir)..\svg";"$(ProjectDir)..\wml";"$(ProjectDir)..\storage";"$(ProjectDir)..\websockets";"$(ProjectDir)..\workers";"$(WebKitOutputDir)\include";"$(WebKitOutputDir)\include\private";"$(WebKitOutputDir)\include\JavaScriptCore";"$(WebKitOutputDir)\include\private\JavaScriptCore";"$(ProjectDir)..\ForwardingHeaders";"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\include\private";"$(WebKitLibrariesDir)\include\private\JavaScriptCore";"$(WebKitLibrariesDir)\include\pthreads";"$(WebKitLibrariesDir)\include\sqlite";"$(WebKitLibrariesDir)\include\JavaScriptCore";"$(WebKitLibrariesDir)\include\zlib"" 11 11 PreprocessorDefinitions="__WIN32__;DISABLE_3D_RENDERING;WEBCORE_CONTEXT_MENUS" 12 12 UsePrecompiledHeader="2" -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r64425 r64434 784 784 37919C230B7D188600A56998 /* PositionIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37919C210B7D188600A56998 /* PositionIterator.cpp */; }; 785 785 37919C240B7D188600A56998 /* PositionIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 37919C220B7D188600A56998 /* PositionIterator.h */; settings = {ATTRIBUTES = (); }; }; 786 379919961200DDF400EA041C /* WOFFFileFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 379919941200DDF400EA041C /* WOFFFileFormat.cpp */; }; 787 379919971200DDF400EA041C /* WOFFFileFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 379919951200DDF400EA041C /* WOFFFileFormat.h */; }; 788 379919B21200DE5000EA041C /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 379919B11200DE5000EA041C /* libz.dylib */; }; 786 789 37ACCE420DA2980F0089E602 /* FontRenderingMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 37ACCE410DA2980F0089E602 /* FontRenderingMode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 787 790 37ACCF690DA414E70089E602 /* FontDescription.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37ACCE620DA2AA960089E602 /* FontDescription.cpp */; }; … … 6524 6527 37919C210B7D188600A56998 /* PositionIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PositionIterator.cpp; sourceTree = "<group>"; }; 6525 6528 37919C220B7D188600A56998 /* PositionIterator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PositionIterator.h; sourceTree = "<group>"; }; 6529 379919941200DDF400EA041C /* WOFFFileFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WOFFFileFormat.cpp; sourceTree = "<group>"; }; 6530 379919951200DDF400EA041C /* WOFFFileFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WOFFFileFormat.h; sourceTree = "<group>"; }; 6531 379919B11200DE5000EA041C /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = /usr/lib/libz.dylib; sourceTree = "<absolute>"; }; 6526 6532 37ACCE410DA2980F0089E602 /* FontRenderingMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontRenderingMode.h; sourceTree = "<group>"; }; 6527 6533 37ACCE620DA2AA960089E602 /* FontDescription.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontDescription.cpp; sourceTree = "<group>"; }; … … 11072 11078 A88AD52F09524B92001DD196 /* QuartzCore.framework in Frameworks */, 11073 11079 1A7FA7CC0DDA4B770028F8A5 /* SystemConfiguration.framework in Frameworks */, 11080 379919B21200DE5000EA041C /* libz.dylib in Frameworks */, 11074 11081 ); 11075 11082 runOnlyForDeploymentPostprocessing = 0; … … 11138 11145 1CFAE3220A6D6A3F0032593D /* libobjc.dylib */, 11139 11146 DD763BB10992C2C900740B8E /* libxml2.dylib */, 11147 379919B11200DE5000EA041C /* libz.dylib */, 11140 11148 49C7BA781042EFAE0009D447 /* OpenGL.framework */, 11141 11149 A85D7A2F0879EBA9006A9172 /* QuartzCore.framework */, … … 15626 15634 939B02EC0EA2DBC400C54570 /* WidthIterator.cpp */, 15627 15635 939B02ED0EA2DBC400C54570 /* WidthIterator.h */, 15636 379919941200DDF400EA041C /* WOFFFileFormat.cpp */, 15637 379919951200DDF400EA041C /* WOFFFileFormat.h */, 15628 15638 ); 15629 15639 path = graphics; … … 19984 19994 D39D006D11F8E308006041F2 /* PopupMenuMac.h in Headers */, 19985 19995 D39D009D11F907E6006041F2 /* SearchPopupMenuMac.h in Headers */, 19996 379919971200DDF400EA041C /* WOFFFileFormat.h in Headers */, 19986 19997 ); 19987 19998 runOnlyForDeploymentPostprocessing = 0; … … 22385 22396 C572EE0D1201C736007D8F82 /* IDBIndexBackendImpl.cpp in Sources */, 22386 22397 C572EE1E1201C9BC007D8F82 /* JSIDBIndex.cpp in Sources */, 22398 379919961200DDF400EA041C /* WOFFFileFormat.cpp in Sources */, 22387 22399 ); 22388 22400 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/css/CSSFontFaceSrcValue.cpp
r58517 r64434 1 1 /* 2 * Copyright (C) 2007 Apple Inc. All rights reserved.2 * Copyright (C) 2007, 2010 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 27 27 #include "CSSFontFaceSrcValue.h" 28 28 #include "CSSStyleSheet.h" 29 #include "FontCustomPlatformData.h" 29 30 #include "Node.h" 30 31 … … 49 50 } 50 51 51 return equalIgnoringCase(m_format, "truetype") || equalIgnoringCase(m_format, "opentype") 52 #if ENABLE(OPENTYPE_SANITIZER) 53 || equalIgnoringCase(m_format, "woff") 54 #endif 52 return FontCustomPlatformData::supportsFormat(m_format) 55 53 #if ENABLE(SVG_FONTS) 56 54 || isSVGFontFaceSrc() -
trunk/WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp
r55510 r64434 22 22 #include "FontCustomPlatformData.h" 23 23 24 #include "FontPlatformData.h" 24 25 #include "SharedBuffer.h" 25 #include "FontPlatformData.h"26 26 27 27 namespace WebCore { … … 71 71 } 72 72 73 bool FontCustomPlatformData::supportsFormat(const String& format) 74 { 75 return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype"); 73 76 } 77 78 } -
trunk/WebCore/platform/graphics/cairo/FontCustomPlatformData.h
r55510 r64434 31 31 class FontPlatformData; 32 32 class SharedBuffer; 33 class String; 33 34 34 35 struct FontCustomPlatformData : Noncopyable { … … 41 42 FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode); 42 43 44 static bool supportsFormat(const String&); 45 43 46 cairo_font_face_t* m_fontFace; 44 47 }; -
trunk/WebCore/platform/graphics/chromium/FontCustomPlatformData.cpp
r55089 r64434 202 202 } 203 203 204 } 204 bool FontCustomPlatformData::supportsFormat(const String& format) 205 { 206 return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype") 207 #if ENABLE(OPENTYPE_SANITIZER) 208 || equalIgnoringCase(format, "woff") 209 #endif 210 ; 211 } 212 213 } -
trunk/WebCore/platform/graphics/chromium/FontCustomPlatformData.h
r52791 r64434 47 47 class FontPlatformData; 48 48 class SharedBuffer; 49 class String; 49 50 50 51 struct FontCustomPlatformData : Noncopyable { … … 65 66 FontRenderingMode = NormalRenderingMode); 66 67 68 static bool supportsFormat(const String&); 69 67 70 #if OS(WINDOWS) 68 71 HANDLE m_fontReference; -
trunk/WebCore/platform/graphics/gtk/FontCustomPlatformDataPango.cpp
r31574 r64434 47 47 } 48 48 49 bool FontCustomPlatformData::supportsFormat(const String& /* format */) 50 { 51 return false; 49 52 } 53 54 } -
trunk/WebCore/platform/graphics/haiku/FontCustomPlatformData.cpp
r48006 r64434 43 43 } 44 44 45 bool FontCustomPlatformData::supportsFormat(const String& /* format */) 46 { 47 return false; 45 48 } 49 50 } -
trunk/WebCore/platform/graphics/haiku/FontCustomPlatformData.h
r48006 r64434 29 29 class FontPlatformData; 30 30 class SharedBuffer; 31 class String; 31 32 32 33 struct FontCustomPlatformData : Noncopyable { … … 34 35 FontCustomPlatformData() { } 35 36 ~FontCustomPlatformData(); 37 38 static bool supportsFormat(const String&); 36 39 37 40 FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode); -
trunk/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
r51623 r64434 1 1 /* 2 * Copyright (C) 2007 Apple Computer, Inc.2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. 3 3 * 4 4 * This library is free software; you can redistribute it and/or … … 22 22 #include "FontCustomPlatformData.h" 23 23 24 #include <ApplicationServices/ApplicationServices.h>25 #include "SharedBuffer.h"26 24 #include "FontPlatformData.h" 27 25 #include "OpenTypeSanitizer.h" 26 #include "SharedBuffer.h" 27 #include "WOFFFileFormat.h" 28 #include <ApplicationServices/ApplicationServices.h> 28 29 29 30 namespace WebCore { … … 51 52 return 0; // validation failed. 52 53 buffer = transcodeBuffer.get(); 54 #else 55 RefPtr<SharedBuffer> sfntBuffer; 56 if (isWOFF(buffer)) { 57 Vector<char> sfnt; 58 if (!convertWOFFToSfnt(buffer, sfnt)) 59 return 0; 60 61 sfntBuffer = SharedBuffer::adoptVector(sfnt); 62 buffer = sfntBuffer.get(); 63 } 53 64 #endif 54 65 … … 61 72 RetainPtr<CFDataRef> bufferData(AdoptCF, buffer->createCFData()); 62 73 RetainPtr<CGDataProviderRef> dataProvider(AdoptCF, CGDataProviderCreateWithCFData(bufferData.get())); 63 74 64 75 cgFontRef.adoptCF(CGFontCreateWithDataProvider(dataProvider.get())); 65 76 if (!cgFontRef) … … 102 113 } 103 114 115 bool FontCustomPlatformData::supportsFormat(const String& format) 116 { 117 return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype") || equalIgnoringCase(format, "woff"); 104 118 } 119 120 } -
trunk/WebCore/platform/graphics/mac/FontCustomPlatformData.h
r41939 r64434 34 34 class FontPlatformData; 35 35 class SharedBuffer; 36 class String; 36 37 37 38 struct FontCustomPlatformData : Noncopyable { … … 42 43 43 44 FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode); 45 46 static bool supportsFormat(const String&); 44 47 45 48 ATSFontContainerRef m_atsContainer; -
trunk/WebCore/platform/graphics/qt/FontCustomPlatformData.h
r61663 r64434 28 28 namespace WebCore { 29 29 30 class FontPlatformData; 30 31 class SharedBuffer; 31 class FontPlatformData;32 class String; 32 33 33 34 struct FontCustomPlatformData : Noncopyable { … … 38 39 39 40 FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode); 41 42 static bool supportsFormat(const String&); 40 43 }; 41 44 -
trunk/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp
r54490 r64434 62 62 } 63 63 64 bool FontCustomPlatformData::supportsFormat(const String& format) 65 { 66 return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype"); 64 67 } 65 68 69 } -
trunk/WebCore/platform/graphics/win/FontCustomPlatformData.cpp
r55975 r64434 1 1 /* 2 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 3 * 4 4 * This library is free software; you can redistribute it and/or … … 27 27 #include "SharedBuffer.h" 28 28 #include "SoftLinking.h" 29 #include "WOFFFileFormat.h" 29 30 #include <ApplicationServices/ApplicationServices.h> 30 31 #include <WebKitSystemInterface/WebKitSystemInterface.h> … … 168 169 ASSERT(T2embedLibrary()); 169 170 171 RefPtr<SharedBuffer> sfntBuffer; 172 if (isWOFF(buffer)) { 173 Vector<char> sfnt; 174 if (!convertWOFFToSfnt(buffer, sfnt)) 175 return 0; 176 177 sfntBuffer = SharedBuffer::adoptVector(sfnt); 178 buffer = sfntBuffer.get(); 179 } 180 170 181 // Introduce the font to GDI. AddFontMemResourceEx cannot be used, because it will pollute the process's 171 182 // font namespace (Windows has no API for creating an HFONT from data without exposing the font to the … … 201 212 } 202 213 203 } 214 bool FontCustomPlatformData::supportsFormat(const String& format) 215 { 216 return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype") || equalIgnoringCase(format, "woff"); 217 } 218 219 } -
trunk/WebCore/platform/graphics/win/FontCustomPlatformData.h
r55975 r64434 32 32 class FontPlatformData; 33 33 class SharedBuffer; 34 class String; 34 35 35 36 struct FontCustomPlatformData : Noncopyable { … … 44 45 FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode); 45 46 47 static bool supportsFormat(const String&); 48 46 49 HANDLE m_fontReference; 47 50 String m_name; -
trunk/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp
r30441 r64434 59 59 } 60 60 61 bool FontCustomPlatformData::supportsFormat(const String& format) 62 { 63 return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype"); 61 64 } 65 66 } -
trunk/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.h
r30441 r64434 30 30 class FontPlatformData; 31 31 class SharedBuffer; 32 class String; 32 33 33 34 struct FontCustomPlatformDataCairo : Noncopyable { … … 40 41 FontPlatformData fontPlatformData(int size, bool bold, bool italic); 41 42 43 static bool supportsFormat(const String&); 44 42 45 cairo_font_face_t* m_fontFace; 43 46 }; -
trunk/WebCore/platform/graphics/wince/FontCustomPlatformData.cpp
r58941 r64434 84 84 } 85 85 86 bool FontCustomPlatformData::supportsFormat(const String& format) 87 { 88 return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype"); 86 89 } 90 91 } -
trunk/WebCore/platform/graphics/wince/FontCustomPlatformData.h
r47975 r64434 46 46 47 47 FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode); 48 49 static bool supportsFormat(const String&); 50 48 51 String m_name; 49 52 };
Note:
See TracChangeset
for help on using the changeset viewer.