Title: [177292] trunk
- Revision
- 177292
- Author
- [email protected]
- Date
- 2014-12-15 11:05:14 -0800 (Mon, 15 Dec 2014)
Log Message
[iOS] Codepoints not associated with languages are drawn as boxes
https://bugs.webkit.org/show_bug.cgi?id=138906
Patch by Myles C. Maxfield <[email protected]> on 2014-12-15
Reviewed by Darin Adler.
Source/WebCore:
Use SPI CTFontCreateForCharacters(), but only if we don't already know what to do
with the characters.
Test: platform/ios-simulator/fast/text/non-language-font-fallback.html
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::FontCache::systemFallbackForCharacters):
* platform/spi/cocoa/CoreTextSPI.h:
LayoutTests:
* platform/ios-simulator/fast/text/non-language-font-fallback-expected.html: Added.
* platform/ios-simulator/fast/text/non-language-font-fallback.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (177291 => 177292)
--- trunk/LayoutTests/ChangeLog 2014-12-15 19:05:11 UTC (rev 177291)
+++ trunk/LayoutTests/ChangeLog 2014-12-15 19:05:14 UTC (rev 177292)
@@ -1,3 +1,13 @@
+2014-12-15 Myles C. Maxfield <[email protected]>
+
+ [iOS] Codepoints not associated with languages are drawn as boxes
+ https://bugs.webkit.org/show_bug.cgi?id=138906
+
+ Reviewed by Darin Adler.
+
+ * platform/ios-simulator/fast/text/non-language-font-fallback-expected.html: Added.
+ * platform/ios-simulator/fast/text/non-language-font-fallback.html: Added.
+
2014-12-15 Alexey Proskuryakov <[email protected]>
http/tests/misc/webtiming-origins.html is flaky
Added: trunk/LayoutTests/platform/ios-simulator/fast/text/non-language-font-fallback-expected.html (0 => 177292)
--- trunk/LayoutTests/platform/ios-simulator/fast/text/non-language-font-fallback-expected.html (rev 0)
+++ trunk/LayoutTests/platform/ios-simulator/fast/text/non-language-font-fallback-expected.html 2014-12-15 19:05:14 UTC (rev 177292)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+This test makes sure that glyphs not associated with a particular language have an appropriate font chosen for them.
+<div style="font-size: 256px; font-family: Menlo-Regular;">☚</div>
+</body>
+</html>
Added: trunk/LayoutTests/platform/ios-simulator/fast/text/non-language-font-fallback.html (0 => 177292)
--- trunk/LayoutTests/platform/ios-simulator/fast/text/non-language-font-fallback.html (rev 0)
+++ trunk/LayoutTests/platform/ios-simulator/fast/text/non-language-font-fallback.html 2014-12-15 19:05:14 UTC (rev 177292)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+This test makes sure that glyphs not associated with a particular language have an appropriate font chosen for them.
+<div style="font-size: 256px;">☚</div>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (177291 => 177292)
--- trunk/Source/WebCore/ChangeLog 2014-12-15 19:05:11 UTC (rev 177291)
+++ trunk/Source/WebCore/ChangeLog 2014-12-15 19:05:14 UTC (rev 177292)
@@ -1,3 +1,19 @@
+2014-12-15 Myles C. Maxfield <[email protected]>
+
+ [iOS] Codepoints not associated with languages are drawn as boxes
+ https://bugs.webkit.org/show_bug.cgi?id=138906
+
+ Reviewed by Darin Adler.
+
+ Use SPI CTFontCreateForCharacters(), but only if we don't already know what to do
+ with the characters.
+
+ Test: platform/ios-simulator/fast/text/non-language-font-fallback.html
+
+ * platform/graphics/ios/FontCacheIOS.mm:
+ (WebCore::FontCache::systemFallbackForCharacters):
+ * platform/spi/cocoa/CoreTextSPI.h:
+
2014-12-15 Bem Jones-Bey <[email protected]>
[CSS Shapes] Fix StyleBuilder code to use CSSValueNone to match spec and other code
Modified: trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm (177291 => 177292)
--- trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm 2014-12-15 19:05:11 UTC (rev 177291)
+++ trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm 2014-12-15 19:05:14 UTC (rev 177292)
@@ -427,6 +427,11 @@
}
if (useEmojiFont)
simpleFontData = getCachedFontData(description, appleColorEmoji, false, DoNotRetain);
+ else {
+ RetainPtr<CTFontRef> fallbackFont = adoptCF(CTFontCreateForCharacters(originalFontData->getCTFont(), characters, length, nullptr));
+ if (RetainPtr<CFStringRef> foundFontName = adoptCF(CTFontCopyPostScriptName(fallbackFont.get())))
+ simpleFontData = getCachedFontData(description, foundFontName.get(), false, DoNotRetain);
+ }
break;
}
}
Modified: trunk/Source/WebCore/platform/spi/cocoa/CoreTextSPI.h (177291 => 177292)
--- trunk/Source/WebCore/platform/spi/cocoa/CoreTextSPI.h 2014-12-15 19:05:11 UTC (rev 177291)
+++ trunk/Source/WebCore/platform/spi/cocoa/CoreTextSPI.h 2014-12-15 19:05:14 UTC (rev 177292)
@@ -90,6 +90,7 @@
bool CTFontIsAppleColorEmoji(CTFontRef);
bool CTFontDescriptorIsSystemUIFont(CTFontDescriptorRef);
CTFontRef CTFontCreateForCSS(CFStringRef name, uint16_t weight, CTFontSymbolicTraits, CGFloat size);
+CTFontRef CTFontCreateForCharacters(CTFontRef currentFont, const UTF16Char *characters, CFIndex length, CFIndex *coveredLength);
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes