Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[Cocoa] Stop treating the system font as a non-variable font
https://bugs.webkit.org/show_bug.cgi?id=228176 Reviewed by Sam Weinig. Source/WebCore: Modern versions of macOS and iOS can treat the system font as a variable font, and be able to apply weights like "342" instead of just "300" or "400". Tests: fast/text/variable-system-font-2.html fast/text/variable-system-font.html * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::preparePlatformFont): Source/WTF: * wtf/PlatformUse.h: LayoutTests: Update tests. * fast/text/resources/Ahem-trak.ttf: Added. This is a font which has a trak table. * fast/text/trak-optimizeLegibility-expected-mismatch.html: Added. * fast/text/trak-optimizeLegibility-expected.txt: Removed. * fast/text/trak-optimizeLegibility.html: * fast/text/variable-system-font-2-expected-mismatch.html: Added. * fast/text/variable-system-font-2.html: Added. * fast/text/variable-system-font-expected-mismatch.html: Added. * fast/text/variable-system-font.html: Added. * svg/dom/altGlyph-dom-expected.txt: * svg/dom/resources/altGlyph-dom.js: Canonical link: https://commits.webkit.org/240715@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
18 changed files
with
151 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BIN
+23.4 KB
LayoutTests/fast/text/resources/Ahem-trak.ttf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<style> | ||
@font-face { | ||
font-family: "WebFont"; | ||
src: url("resources/Ahem-trak.ttf") format("truetype"); | ||
} | ||
div { | ||
font: 64px "WebFont"; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div>abc</div> | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src="../../resources/js-test-pre.js"></script> | ||
<meta charset="utf-8"> | ||
<style> | ||
@font-face { | ||
font-family: "WebFont"; | ||
src: url("resources/Ahem-trak.ttf") format("truetype"); | ||
} | ||
div { | ||
font: 64px "WebFont"; | ||
text-rendering: optimizeLegibility; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
This test makes sure that you can opt-in to honoring the 'trak' table by specifying text-rendering: optimizeLegibility. | ||
The first and third lines below should have the same width. The middle one can (but doesn't have to) have a different width. | ||
<p><span id="first" style="font: 100px 'system-ui'; font-weight: 300;">hamburgefonstiv</span></p> | ||
<p><span id="second" style="font: 100px '.AppleSystemUIFontLight', '.SFNSDisplay-Light', '.SFUIDisplay-Light';">hamburgefonstiv</span></p> | ||
<p><span id="third" style="font: 100px '.AppleSystemUIFontLight', '.SFNSDisplay-Light', '.SFUIDisplay-Light'; text-rendering: optimizeLegibility;">hamburgefonstiv</span></p> | ||
<script> | ||
var first = document.getElementById("first"); | ||
var third = document.getElementById("third"); | ||
shouldBe("first.getClientRects().length", "1"); | ||
shouldBe("third.getClientRects().length", "1"); | ||
shouldBe("first.getClientRects()[0].right", "third.getClientRects()[0].right"); | ||
</script> | ||
<script src="../../resources/js-test-post.js"></script> | ||
<div>abc</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
div { | ||
font: 300 48px system-ui; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div>Hello test</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
div { | ||
font: 351 48px system-ui; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div>Hello test</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
div { | ||
font: 400 48px system-ui; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div>Hello test</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
div { | ||
font: 351 48px system-ui; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div>Hello test</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters