haikuwebkit/LayoutTests/fast/text/chinese-font-name-aliases.html

23 lines
1006 B
HTML
Raw Permalink Normal View History

[Cocoa] Map commonly used Chinese Windows font names to names present on Cocoa operating systems https://bugs.webkit.org/show_bug.cgi?id=158649 <rdar://problem/13258122> Reviewed by Darin Adler. Source/WebCore: There are many Chinese websites which hardcode Windows font names. We should map these to fonts which best match them on Cocoa operating systems. We can do this by using our existing fallback font name infrastructure. Tests: fast/text/chinese-font-name-aliases-2.html fast/text/chinese-font-name-aliases.html * platform/graphics/FontCache.cpp: (WebCore::FontCache::alternateFamilyName): (WebCore::alternateFamilyName): Deleted. * platform/graphics/FontCache.h: * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontCache::platformAlternateFamilyName): * platform/graphics/freetype/FontCacheFreeType.cpp: (WebCore::FontCache::platformAlternateFamilyName): * platform/graphics/win/FontCacheWin.cpp: (WebCore::FontCache::platformAlternateFamilyName): Source/WTF: * wtf/text/StringCommon.h: (WTF::naiveEqualWithoutPerformingUnicodeNormalization): Added. Tools: * TestWebKitAPI/Tests/WTF/WTFString.h: (TestWebKitAPI::TEST): LayoutTests: Because this tests platform-specific font names, the test must be platform-specific. Because it's a ref test, make two tests which are mutually-exclusive on Cocoa platforms, and expected to fail everywhere else. * fast/text/chinese-font-name-aliases-2-expected.html: Added. * fast/text/chinese-font-name-aliases-2.html: Added. * fast/text/chinese-font-name-aliases-expected.html: Added. * fast/text/chinese-font-name-aliases.html: Added. * platform/efl/TestExpectations: * platform/gtk/TestExpectations: * platform/ios-simulator/TestExpectations: * platform/mac/TestExpectations: * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/176757@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201978 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-06-11 21:48:15 +00:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
.item {
font-size: 48px;
}
</style>
</head>
<body>
This test makes sure that Windows font names are aliased to specific fonts which exist on Cocoa platforms. Note the expected results of this test will vary depending on which operating system is used.
<span class="item" style="font-family: '宋体';">纸牌屋雪</span>
<span class="item" style="font-family: '\5b8b\4f53';">纸牌屋雪</span>
<span class="item" style="font-family: 'SimSun';">纸牌屋雪</span>
<span class="item" style="font-family: '微软雅黑';">纸牌屋雪</span>
<span class="item" style="font-family: '黑体';">纸牌屋雪</span>
<span class="item" style="font-family: 'Microsoft JhengHei';">纸牌屋雪</span>
<span class="item" style="font-family: '微軟正黑體';">纸牌屋雪</span>
<span class="item" style="font-family: 'MS MingLiU';">纸牌屋雪</span>
<span class="item" style="font-family: '微軟新細明體';">纸牌屋雪</span>
</body>
</html>