Changeset 215461 in webkit
- Timestamp:
- Apr 18, 2017 9:15:32 AM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r215458 r215461 1 2017-04-18 Per Arne Vollan <pvollan@apple.com> 2 3 Add fallback fonts to video captions stylesheet. 4 https://bugs.webkit.org/show_bug.cgi?id=170495 5 6 Reviewed by Eric Carlson. 7 8 The kCTFontCascadeListAttribute key is used to obtain the cascade list for a font reference. 9 10 I have not added a test, since CaptionUserPreferences::testingMode() returns true when running tests, 11 preventing this code path from being executed. 12 13 * page/CaptionUserPreferencesMediaAF.cpp: 14 (WebCore::CaptionUserPreferencesMediaAF::captionsDefaultFontCSS): 15 * platform/spi/win/CoreTextSPIWin.h: 16 1 17 2017-04-18 Miguel Gomez <magomez@igalia.com> 2 18 -
trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp
r215185 r215461 33 33 34 34 #include "AudioTrackList.h" 35 #if PLATFORM(WIN) 36 #include "CoreTextSPIWin.h" 37 #endif 35 38 #include "FloatConversion.h" 36 39 #include "HTMLMediaElement.h" … … 79 82 #define SOFT_LINK_AVF_FRAMEWORK_IMPORT_OPTIONAL(Lib, Fun, ReturnType, Arguments) SOFT_LINK_DLL_IMPORT_OPTIONAL(Lib, Fun, ReturnType, __cdecl, Arguments) 80 83 81 // CoreText only needs to be soft-linked on Windows.82 SOFT_LINK_AVF_FRAMEWORK(CoreText)83 SOFT_LINK_AVF_FRAMEWORK_IMPORT(CoreText, CTFontDescriptorCopyAttribute, CFTypeRef, (CTFontDescriptorRef descriptor, CFStringRef attribute), (descriptor, attribute));84 SOFT_LINK_AVF_POINTER(CoreText, kCTFontNameAttribute, CFStringRef)85 #define kCTFontNameAttribute getkCTFontNameAttribute()86 87 #define CTFontDescriptorCopyAttribute softLink_CTFontDescriptorCopyAttribute88 89 84 SOFT_LINK_AVF_FRAMEWORK(CoreMedia) 90 85 SOFT_LINK_AVF_FRAMEWORK_IMPORT_OPTIONAL(CoreMedia, MTEnableCaption2015Behavior, Boolean, ()) … … 425 420 if (!name) 426 421 return emptyString(); 427 422 428 423 StringBuilder builder; 429 424 … … 432 427 builder.append(static_cast<CFStringRef>(name.get())); 433 428 builder.append('"'); 429 430 auto cascadeList = adoptCF(static_cast<CFArrayRef>(CTFontDescriptorCopyAttribute(font.get(), kCTFontCascadeListAttribute))); 431 432 if (cascadeList) { 433 for (CFIndex i = 0; i < CFArrayGetCount(cascadeList.get()); i++) { 434 auto fontCascade = static_cast<CTFontDescriptorRef>(CFArrayGetValueAtIndex(cascadeList.get(), i)); 435 if (!fontCascade) 436 continue; 437 auto fontCascadeName = adoptCF(CTFontDescriptorCopyAttribute(fontCascade, kCTFontNameAttribute)); 438 if (!fontCascadeName) 439 continue; 440 builder.append(", \""); 441 builder.append(static_cast<CFStringRef>(fontCascadeName.get())); 442 builder.append('"'); 443 } 444 } 445 434 446 if (behavior == kMACaptionAppearanceBehaviorUseValue) 435 447 builder.appendLiteral(" !important"); -
trunk/Source/WebCore/platform/spi/win/CoreTextSPIWin.h
r213227 r215461 38 38 39 39 CT_EXPORT const CFStringRef kCTFontAttributeName; 40 CT_EXPORT const CFStringRef kCTFontCascadeListAttribute; 41 CT_EXPORT const CFStringRef kCTFontNameAttribute; 40 42 CT_EXPORT const CFStringRef kCTForegroundColorFromContextAttributeName; 41 43 CT_EXPORT const CFStringRef kCTStrokeWidthAttributeName;
Note: See TracChangeset
for help on using the changeset viewer.