haikuwebkit/LayoutTests/css3/font-variant-all-expected.html

161 lines
8.1 KiB
HTML
Raw Permalink Normal View History

Test font-variant-* and font-feature-settings with mocked preinstalled fonts https://bugs.webkit.org/show_bug.cgi?id=149777 Reviewed by Simon Fraser. Tools: Include FontWithFeatures in DumpRenderTree and WebKitTestRunner. Add it to the list of tests to preinstall at startup time. Also, update the generation of the 'name' table in the FontWithFeatures font. * DumpRenderTree/mac/DumpRenderTree.mm: (allowedFontFamilySet): (activateTestingFonts): (activateFontsIOS): * FontWithFeatures/FontWithFeatures/FontCreator.cpp: (Generator::generate): (Generator::appendCFFTable): (Generator::appendNameSubtable): (Generator::appendNAMETable): * FontWithFeatures/FontWithFeatures/main.cpp: (main): * WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm: (WTR::allowedFontFamilySet): (WTR::activateFonts): * WebKitTestRunner/mac/TestControllerMac.mm: (WTR::allowedFontFamilySet): LayoutTests: See per-file comments. * css3/font-feature-settings-preinstalled-fonts.html: Removed. Superseded by css3/font-feature-settings-rendering.html. * css3/font-feature-settings-rendering-2-expected.html: Removed. * css3/font-feature-settings-rendering-2.html: Removed. Renamed to css3/font-feature-settings-rendering.html * css3/font-feature-settings-rendering-expected.html: Added. * css3/font-feature-settings-rendering.html: * css3/font-variant-all-expected.html: * css3/font-variant-all.html: * css3/resources/FontWithFeatures.otf: Update for new 'name' table. * css3/resources/FontWithFeatures.ttf: Ditto. Canonical link: https://commits.webkit.org/168142@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190848 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-11 20:23:26 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
@font-face {
font-family: "FontFeaturesTestOTF";
src: url("resources/FontWithFeatures.otf") format("opentype");
}
@font-face {
font-family: "FontFeaturesTestTTF";
src: url("resources/FontWithFeatures.ttf") format("truetype");
}
.fontWithFeaturesTTF {
font-family: "FontWithFeaturesTTF";
}
</style>
</head>
<body>
<p>This test is a dump-render-tree test which makes sure that the following properties are appropriately applied:</p>
<ul>
<li>-webkit-font-variant-ligatures</li>
<li>-webkit-font-variant-position</li>
<li>-webkit-font-variant-caps</li>
<li>-webkit-font-variant-numeric</li>
<li>-webkit-font-variant-alternates</li>
<li>-webkit-font-variant-east-asian</li>
</ul>
The test passes if there is a particular sequence of checks and x characters below. Note that some x characters are expected.
font-variant-caps does not work if the font does not support font features https://bugs.webkit.org/show_bug.cgi?id=149774 Reviewed by Antti Koivisto. Source/WebCore: This test implements synthesis for small-caps and all-small-caps. It does so by moving font variant selection into a higher level (ComplexTextController). In general, the approach is to use the pure font feature until we encounter a character which needs to be uppercased, and which the font feature does not support uppercasing. In this situation, we try again with synthesis. In this case, synthesis means artificially uppercasing letters and rendering them with a smaller font. We require system support to know which glyphs a particular font feature supports. Therefore, on operating systems which do not include this support, we will simply say that the font feature does not support any glyphs. Test: css3/font-variant-small-caps-synthesis.html css3/font-variant-petite-caps-synthesis.html * platform/graphics/Font.cpp: (WebCore::Font::noSmallCapsFont): Return the same font, but without smcp or c2sc. This function utilizes a cache. * platform/graphics/Font.h: (WebCore::Font::variantFont): Small caps should never go through this function anymore. * platform/graphics/FontCascade.h: Because we're moving variant selection into a higher level, we remove the FontVariant argument from the lower-level call. * platform/graphics/FontCascadeFonts.cpp: (WebCore::FontCascadeFonts::glyphDataForVariant): Use early-return style. (WebCore::FontCascadeFonts::glyphDataForNormalVariant): Ditto. * platform/graphics/cocoa/FontCascadeCocoa.mm: (WebCore::FontCascade::fontForCombiningCharacterSequence): Because we're moving variant selection into a higher level, we remove the FontVariant argument from the lower-level call. * platform/graphics/cocoa/FontCocoa.mm: (WebCore::Font::smallCapsSupportsCharacter): (WebCore::Font::allSmallCapsSupportsCharacter): (WebCore::smallCapsOpenTypeDictionary): Helper function for smallCapsSupportsCharacter(). (WebCore::smallCapsTrueTypeDictionary): Ditto. (WebCore::unionBitVectors): (WebCore::Font::glyphsSupportedBySmallCaps): Compute a bit vector of supported glyphs. (WebCore::Font::glyphsSupportedByAllSmallCaps): Ditto. (WebCore::createDerivativeFont): Moving common code into its own helper function. (WebCore::Font::createFontWithoutSmallCaps): (WebCore::Font::platformCreateScaledFont): Use the common code. * platform/graphics/mac/ComplexTextController.cpp: (WebCore::capitalized): What is the capitalized form of a character? (WebCore::ComplexTextController::collectComplexTextRuns): Implement the core logic of this patch. This includes the retry when we encounter a character which is not supported by the font feature. * platform/spi/cocoa/CoreTextSPI.h: LayoutTests: Adding two new font which include lowercase characters which respond to 'smcp' and 'c2sc'. The character mappings are: OpenType: 'smcp': f 'c2sc': g TrueType: kLowerCaseType / kLowerCaseSmallCapsSelector: r kUpperCaseType / kUpperCaseSmallCapsSelector: u * css3/font-variant-all-expected.html: * css3/font-variant-all.html: * css3/font-variant-small-caps-synthesis-expected.html: Added. * css3/font-variant-small-caps-synthesis.html: Added. * css3/font-variant-petite-caps-synthesis-expected.html: Added. * css3/font-variant-petite-caps-synthesis.html: Added. * css3/resources/FontWithFeaturesLowercaseSmallCaps.otf: Added. * css3/resources/FontWithFeaturesLowercaseSmallCaps.ttf: Added. * platform/mac/TestExpectations: * platform/mac/fast/writing-mode/broken-ideograph-small-caps-expected.txt: Canonical link: https://commits.webkit.org/170248@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193894 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-10 08:37:03 +00:00
<div id="insertionpoint" style="font-size: 20px;"><span style="font-family: FontFeaturesTestOTF;">A</span>
Test font-variant-* and font-feature-settings with mocked preinstalled fonts https://bugs.webkit.org/show_bug.cgi?id=149777 Reviewed by Simon Fraser. Tools: Include FontWithFeatures in DumpRenderTree and WebKitTestRunner. Add it to the list of tests to preinstall at startup time. Also, update the generation of the 'name' table in the FontWithFeatures font. * DumpRenderTree/mac/DumpRenderTree.mm: (allowedFontFamilySet): (activateTestingFonts): (activateFontsIOS): * FontWithFeatures/FontWithFeatures/FontCreator.cpp: (Generator::generate): (Generator::appendCFFTable): (Generator::appendNameSubtable): (Generator::appendNAMETable): * FontWithFeatures/FontWithFeatures/main.cpp: (main): * WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm: (WTR::allowedFontFamilySet): (WTR::activateFonts): * WebKitTestRunner/mac/TestControllerMac.mm: (WTR::allowedFontFamilySet): LayoutTests: See per-file comments. * css3/font-feature-settings-preinstalled-fonts.html: Removed. Superseded by css3/font-feature-settings-rendering.html. * css3/font-feature-settings-rendering-2-expected.html: Removed. * css3/font-feature-settings-rendering-2.html: Removed. Renamed to css3/font-feature-settings-rendering.html * css3/font-feature-settings-rendering-expected.html: Added. * css3/font-feature-settings-rendering.html: * css3/font-variant-all-expected.html: * css3/font-variant-all.html: * css3/resources/FontWithFeatures.otf: Update for new 'name' table. * css3/resources/FontWithFeatures.ttf: Ditto. Canonical link: https://commits.webkit.org/168142@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190848 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-11 20:23:26 +00:00
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">B</span>
<span style="font-family: FontFeaturesTestOTF;">B</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">B</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">B</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">B</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
<span style="font-family: FontFeaturesTestOTF;">A</span>
</div>
font-variant-caps does not work if the font does not support font features https://bugs.webkit.org/show_bug.cgi?id=149774 Reviewed by Antti Koivisto. Source/WebCore: This test implements synthesis for small-caps and all-small-caps. It does so by moving font variant selection into a higher level (ComplexTextController). In general, the approach is to use the pure font feature until we encounter a character which needs to be uppercased, and which the font feature does not support uppercasing. In this situation, we try again with synthesis. In this case, synthesis means artificially uppercasing letters and rendering them with a smaller font. We require system support to know which glyphs a particular font feature supports. Therefore, on operating systems which do not include this support, we will simply say that the font feature does not support any glyphs. Test: css3/font-variant-small-caps-synthesis.html css3/font-variant-petite-caps-synthesis.html * platform/graphics/Font.cpp: (WebCore::Font::noSmallCapsFont): Return the same font, but without smcp or c2sc. This function utilizes a cache. * platform/graphics/Font.h: (WebCore::Font::variantFont): Small caps should never go through this function anymore. * platform/graphics/FontCascade.h: Because we're moving variant selection into a higher level, we remove the FontVariant argument from the lower-level call. * platform/graphics/FontCascadeFonts.cpp: (WebCore::FontCascadeFonts::glyphDataForVariant): Use early-return style. (WebCore::FontCascadeFonts::glyphDataForNormalVariant): Ditto. * platform/graphics/cocoa/FontCascadeCocoa.mm: (WebCore::FontCascade::fontForCombiningCharacterSequence): Because we're moving variant selection into a higher level, we remove the FontVariant argument from the lower-level call. * platform/graphics/cocoa/FontCocoa.mm: (WebCore::Font::smallCapsSupportsCharacter): (WebCore::Font::allSmallCapsSupportsCharacter): (WebCore::smallCapsOpenTypeDictionary): Helper function for smallCapsSupportsCharacter(). (WebCore::smallCapsTrueTypeDictionary): Ditto. (WebCore::unionBitVectors): (WebCore::Font::glyphsSupportedBySmallCaps): Compute a bit vector of supported glyphs. (WebCore::Font::glyphsSupportedByAllSmallCaps): Ditto. (WebCore::createDerivativeFont): Moving common code into its own helper function. (WebCore::Font::createFontWithoutSmallCaps): (WebCore::Font::platformCreateScaledFont): Use the common code. * platform/graphics/mac/ComplexTextController.cpp: (WebCore::capitalized): What is the capitalized form of a character? (WebCore::ComplexTextController::collectComplexTextRuns): Implement the core logic of this patch. This includes the retry when we encounter a character which is not supported by the font feature. * platform/spi/cocoa/CoreTextSPI.h: LayoutTests: Adding two new font which include lowercase characters which respond to 'smcp' and 'c2sc'. The character mappings are: OpenType: 'smcp': f 'c2sc': g TrueType: kLowerCaseType / kLowerCaseSmallCapsSelector: r kUpperCaseType / kUpperCaseSmallCapsSelector: u * css3/font-variant-all-expected.html: * css3/font-variant-all.html: * css3/font-variant-small-caps-synthesis-expected.html: Added. * css3/font-variant-small-caps-synthesis.html: Added. * css3/font-variant-petite-caps-synthesis-expected.html: Added. * css3/font-variant-petite-caps-synthesis.html: Added. * css3/resources/FontWithFeaturesLowercaseSmallCaps.otf: Added. * css3/resources/FontWithFeaturesLowercaseSmallCaps.ttf: Added. * platform/mac/TestExpectations: * platform/mac/fast/writing-mode/broken-ideograph-small-caps-expected.txt: Canonical link: https://commits.webkit.org/170248@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193894 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-10 08:37:03 +00:00
<div id="insertionPoint2" style="font-size: 20px;"><span style="font-family: FontFeaturesTestTTF;">A</span>
Test font-variant-* and font-feature-settings with mocked preinstalled fonts https://bugs.webkit.org/show_bug.cgi?id=149777 Reviewed by Simon Fraser. Tools: Include FontWithFeatures in DumpRenderTree and WebKitTestRunner. Add it to the list of tests to preinstall at startup time. Also, update the generation of the 'name' table in the FontWithFeatures font. * DumpRenderTree/mac/DumpRenderTree.mm: (allowedFontFamilySet): (activateTestingFonts): (activateFontsIOS): * FontWithFeatures/FontWithFeatures/FontCreator.cpp: (Generator::generate): (Generator::appendCFFTable): (Generator::appendNameSubtable): (Generator::appendNAMETable): * FontWithFeatures/FontWithFeatures/main.cpp: (main): * WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm: (WTR::allowedFontFamilySet): (WTR::activateFonts): * WebKitTestRunner/mac/TestControllerMac.mm: (WTR::allowedFontFamilySet): LayoutTests: See per-file comments. * css3/font-feature-settings-preinstalled-fonts.html: Removed. Superseded by css3/font-feature-settings-rendering.html. * css3/font-feature-settings-rendering-2-expected.html: Removed. * css3/font-feature-settings-rendering-2.html: Removed. Renamed to css3/font-feature-settings-rendering.html * css3/font-feature-settings-rendering-expected.html: Added. * css3/font-feature-settings-rendering.html: * css3/font-variant-all-expected.html: * css3/font-variant-all.html: * css3/resources/FontWithFeatures.otf: Update for new 'name' table. * css3/resources/FontWithFeatures.ttf: Ditto. Canonical link: https://commits.webkit.org/168142@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190848 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-11 20:23:26 +00:00
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">B</span>
<span style="font-family: FontFeaturesTestTTF;">B</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">B</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">B</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">B</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
<span style="font-family: FontFeaturesTestTTF;">A</span>
</div>
font-variant-caps does not work if the font does not support font features https://bugs.webkit.org/show_bug.cgi?id=149774 Reviewed by Antti Koivisto. Source/WebCore: This test implements synthesis for small-caps and all-small-caps. It does so by moving font variant selection into a higher level (ComplexTextController). In general, the approach is to use the pure font feature until we encounter a character which needs to be uppercased, and which the font feature does not support uppercasing. In this situation, we try again with synthesis. In this case, synthesis means artificially uppercasing letters and rendering them with a smaller font. We require system support to know which glyphs a particular font feature supports. Therefore, on operating systems which do not include this support, we will simply say that the font feature does not support any glyphs. Test: css3/font-variant-small-caps-synthesis.html css3/font-variant-petite-caps-synthesis.html * platform/graphics/Font.cpp: (WebCore::Font::noSmallCapsFont): Return the same font, but without smcp or c2sc. This function utilizes a cache. * platform/graphics/Font.h: (WebCore::Font::variantFont): Small caps should never go through this function anymore. * platform/graphics/FontCascade.h: Because we're moving variant selection into a higher level, we remove the FontVariant argument from the lower-level call. * platform/graphics/FontCascadeFonts.cpp: (WebCore::FontCascadeFonts::glyphDataForVariant): Use early-return style. (WebCore::FontCascadeFonts::glyphDataForNormalVariant): Ditto. * platform/graphics/cocoa/FontCascadeCocoa.mm: (WebCore::FontCascade::fontForCombiningCharacterSequence): Because we're moving variant selection into a higher level, we remove the FontVariant argument from the lower-level call. * platform/graphics/cocoa/FontCocoa.mm: (WebCore::Font::smallCapsSupportsCharacter): (WebCore::Font::allSmallCapsSupportsCharacter): (WebCore::smallCapsOpenTypeDictionary): Helper function for smallCapsSupportsCharacter(). (WebCore::smallCapsTrueTypeDictionary): Ditto. (WebCore::unionBitVectors): (WebCore::Font::glyphsSupportedBySmallCaps): Compute a bit vector of supported glyphs. (WebCore::Font::glyphsSupportedByAllSmallCaps): Ditto. (WebCore::createDerivativeFont): Moving common code into its own helper function. (WebCore::Font::createFontWithoutSmallCaps): (WebCore::Font::platformCreateScaledFont): Use the common code. * platform/graphics/mac/ComplexTextController.cpp: (WebCore::capitalized): What is the capitalized form of a character? (WebCore::ComplexTextController::collectComplexTextRuns): Implement the core logic of this patch. This includes the retry when we encounter a character which is not supported by the font feature. * platform/spi/cocoa/CoreTextSPI.h: LayoutTests: Adding two new font which include lowercase characters which respond to 'smcp' and 'c2sc'. The character mappings are: OpenType: 'smcp': f 'c2sc': g TrueType: kLowerCaseType / kLowerCaseSmallCapsSelector: r kUpperCaseType / kUpperCaseSmallCapsSelector: u * css3/font-variant-all-expected.html: * css3/font-variant-all.html: * css3/font-variant-small-caps-synthesis-expected.html: Added. * css3/font-variant-small-caps-synthesis.html: Added. * css3/font-variant-petite-caps-synthesis-expected.html: Added. * css3/font-variant-petite-caps-synthesis.html: Added. * css3/resources/FontWithFeaturesLowercaseSmallCaps.otf: Added. * css3/resources/FontWithFeaturesLowercaseSmallCaps.ttf: Added. * platform/mac/TestExpectations: * platform/mac/fast/writing-mode/broken-ideograph-small-caps-expected.txt: Canonical link: https://commits.webkit.org/170248@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193894 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-10 08:37:03 +00:00
<div id="insertionpoint3" style="font-size: 20px;"><span style="font-family: FontWithFeaturesOTF;">A</span>
Test font-variant-* and font-feature-settings with mocked preinstalled fonts https://bugs.webkit.org/show_bug.cgi?id=149777 Reviewed by Simon Fraser. Tools: Include FontWithFeatures in DumpRenderTree and WebKitTestRunner. Add it to the list of tests to preinstall at startup time. Also, update the generation of the 'name' table in the FontWithFeatures font. * DumpRenderTree/mac/DumpRenderTree.mm: (allowedFontFamilySet): (activateTestingFonts): (activateFontsIOS): * FontWithFeatures/FontWithFeatures/FontCreator.cpp: (Generator::generate): (Generator::appendCFFTable): (Generator::appendNameSubtable): (Generator::appendNAMETable): * FontWithFeatures/FontWithFeatures/main.cpp: (main): * WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm: (WTR::allowedFontFamilySet): (WTR::activateFonts): * WebKitTestRunner/mac/TestControllerMac.mm: (WTR::allowedFontFamilySet): LayoutTests: See per-file comments. * css3/font-feature-settings-preinstalled-fonts.html: Removed. Superseded by css3/font-feature-settings-rendering.html. * css3/font-feature-settings-rendering-2-expected.html: Removed. * css3/font-feature-settings-rendering-2.html: Removed. Renamed to css3/font-feature-settings-rendering.html * css3/font-feature-settings-rendering-expected.html: Added. * css3/font-feature-settings-rendering.html: * css3/font-variant-all-expected.html: * css3/font-variant-all.html: * css3/resources/FontWithFeatures.otf: Update for new 'name' table. * css3/resources/FontWithFeatures.ttf: Ditto. Canonical link: https://commits.webkit.org/168142@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190848 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-11 20:23:26 +00:00
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">B</span>
<span style="font-family: FontWithFeaturesOTF;">B</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">B</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">B</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">B</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
<span style="font-family: FontWithFeaturesOTF;">A</span>
</div>
font-variant-caps does not work if the font does not support font features https://bugs.webkit.org/show_bug.cgi?id=149774 Reviewed by Antti Koivisto. Source/WebCore: This test implements synthesis for small-caps and all-small-caps. It does so by moving font variant selection into a higher level (ComplexTextController). In general, the approach is to use the pure font feature until we encounter a character which needs to be uppercased, and which the font feature does not support uppercasing. In this situation, we try again with synthesis. In this case, synthesis means artificially uppercasing letters and rendering them with a smaller font. We require system support to know which glyphs a particular font feature supports. Therefore, on operating systems which do not include this support, we will simply say that the font feature does not support any glyphs. Test: css3/font-variant-small-caps-synthesis.html css3/font-variant-petite-caps-synthesis.html * platform/graphics/Font.cpp: (WebCore::Font::noSmallCapsFont): Return the same font, but without smcp or c2sc. This function utilizes a cache. * platform/graphics/Font.h: (WebCore::Font::variantFont): Small caps should never go through this function anymore. * platform/graphics/FontCascade.h: Because we're moving variant selection into a higher level, we remove the FontVariant argument from the lower-level call. * platform/graphics/FontCascadeFonts.cpp: (WebCore::FontCascadeFonts::glyphDataForVariant): Use early-return style. (WebCore::FontCascadeFonts::glyphDataForNormalVariant): Ditto. * platform/graphics/cocoa/FontCascadeCocoa.mm: (WebCore::FontCascade::fontForCombiningCharacterSequence): Because we're moving variant selection into a higher level, we remove the FontVariant argument from the lower-level call. * platform/graphics/cocoa/FontCocoa.mm: (WebCore::Font::smallCapsSupportsCharacter): (WebCore::Font::allSmallCapsSupportsCharacter): (WebCore::smallCapsOpenTypeDictionary): Helper function for smallCapsSupportsCharacter(). (WebCore::smallCapsTrueTypeDictionary): Ditto. (WebCore::unionBitVectors): (WebCore::Font::glyphsSupportedBySmallCaps): Compute a bit vector of supported glyphs. (WebCore::Font::glyphsSupportedByAllSmallCaps): Ditto. (WebCore::createDerivativeFont): Moving common code into its own helper function. (WebCore::Font::createFontWithoutSmallCaps): (WebCore::Font::platformCreateScaledFont): Use the common code. * platform/graphics/mac/ComplexTextController.cpp: (WebCore::capitalized): What is the capitalized form of a character? (WebCore::ComplexTextController::collectComplexTextRuns): Implement the core logic of this patch. This includes the retry when we encounter a character which is not supported by the font feature. * platform/spi/cocoa/CoreTextSPI.h: LayoutTests: Adding two new font which include lowercase characters which respond to 'smcp' and 'c2sc'. The character mappings are: OpenType: 'smcp': f 'c2sc': g TrueType: kLowerCaseType / kLowerCaseSmallCapsSelector: r kUpperCaseType / kUpperCaseSmallCapsSelector: u * css3/font-variant-all-expected.html: * css3/font-variant-all.html: * css3/font-variant-small-caps-synthesis-expected.html: Added. * css3/font-variant-small-caps-synthesis.html: Added. * css3/font-variant-petite-caps-synthesis-expected.html: Added. * css3/font-variant-petite-caps-synthesis.html: Added. * css3/resources/FontWithFeaturesLowercaseSmallCaps.otf: Added. * css3/resources/FontWithFeaturesLowercaseSmallCaps.ttf: Added. * platform/mac/TestExpectations: * platform/mac/fast/writing-mode/broken-ideograph-small-caps-expected.txt: Canonical link: https://commits.webkit.org/170248@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193894 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-10 08:37:03 +00:00
<div id="insertionPoint4" style="font-size: 20px;"><span style="font-family: FontWithFeaturesTTF;">A</span>
Test font-variant-* and font-feature-settings with mocked preinstalled fonts https://bugs.webkit.org/show_bug.cgi?id=149777 Reviewed by Simon Fraser. Tools: Include FontWithFeatures in DumpRenderTree and WebKitTestRunner. Add it to the list of tests to preinstall at startup time. Also, update the generation of the 'name' table in the FontWithFeatures font. * DumpRenderTree/mac/DumpRenderTree.mm: (allowedFontFamilySet): (activateTestingFonts): (activateFontsIOS): * FontWithFeatures/FontWithFeatures/FontCreator.cpp: (Generator::generate): (Generator::appendCFFTable): (Generator::appendNameSubtable): (Generator::appendNAMETable): * FontWithFeatures/FontWithFeatures/main.cpp: (main): * WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm: (WTR::allowedFontFamilySet): (WTR::activateFonts): * WebKitTestRunner/mac/TestControllerMac.mm: (WTR::allowedFontFamilySet): LayoutTests: See per-file comments. * css3/font-feature-settings-preinstalled-fonts.html: Removed. Superseded by css3/font-feature-settings-rendering.html. * css3/font-feature-settings-rendering-2-expected.html: Removed. * css3/font-feature-settings-rendering-2.html: Removed. Renamed to css3/font-feature-settings-rendering.html * css3/font-feature-settings-rendering-expected.html: Added. * css3/font-feature-settings-rendering.html: * css3/font-variant-all-expected.html: * css3/font-variant-all.html: * css3/resources/FontWithFeatures.otf: Update for new 'name' table. * css3/resources/FontWithFeatures.ttf: Ditto. Canonical link: https://commits.webkit.org/168142@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190848 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-11 20:23:26 +00:00
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">B</span>
<span style="font-family: FontWithFeaturesTTF;">B</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">B</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">B</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">B</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
<span style="font-family: FontWithFeaturesTTF;">A</span>
</div>
</body>
</html>