-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The size-adjust descriptor should not scale system fallback fonts.
When creating a system fallback font for a character on Mac, Blink refers to the font platform data of the primary font. However, the created system fallback font could be unintentionally scaled where the size-adjust descriptor scales the primary font. To fix it, we use the effective size of the font description instead. Test: external/wpt/css/css-fonts/size-adjust-unicode-range-system-fallback.html Bug: 1441723 Change-Id: I35c744f0ddcc0af82645bb4ff87dcdfa1b44860a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4861389 Reviewed-by: Dominik Röttsches <drott@chromium.org> Commit-Queue: ChangSeok Oh <changseok.oh@bytedance.com> Cr-Commit-Position: refs/heads/main@{#1198009}
- Loading branch information
1 parent
ac2aa5a
commit 305d25f
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
css/css-fonts/size-adjust-unicode-range-system-fallback-ref.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,21 @@ | ||
<!DOCTYPE HTML> | ||
<meta charset="utf-8"> | ||
<link rel="author" href="mailto:changseok@webkit.org"> | ||
<title>Tests that the size-adjust descriptor does not affect system fallback font size.</title> | ||
<style> | ||
@font-face { | ||
font-family: large-font; | ||
src: local(Ahem), url(/fonts/ahem.ttf); | ||
size-adjust: 1000%; | ||
unicode-range: U+0020; | ||
} | ||
|
||
.space { | ||
font-family: large-font; | ||
} | ||
|
||
.ref { | ||
font-family: sans-serif; | ||
} | ||
</style> | ||
<span class="space"> </span><span class="ref">あ</span> |
20 changes: 20 additions & 0 deletions
20
css/css-fonts/size-adjust-unicode-range-system-fallback.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,20 @@ | ||
<!DOCTYPE HTML> | ||
<meta charset="utf-8"> | ||
<link rel="author" title="ChangSeok Oh" href="mailto:changseok@webkit.org"> | ||
<link rel="help" href="https://crbug.com/1441723"> | ||
<link rel="match" href="size-adjust-unicode-range-system-fallback-ref.html"> | ||
<link rel="assert" title="Tests that the size-adjust descriptor does not affect system fallback font size."> | ||
<title>Tests that the size-adjust descriptor does not affect system fallback font size.</title> | ||
<style> | ||
@font-face { | ||
font-family: large-font; | ||
src: local(Ahem), url(/fonts/ahem.ttf); | ||
size-adjust: 1000%; | ||
unicode-range: U+0020; | ||
} | ||
|
||
.test { | ||
font-family: large-font; | ||
} | ||
</style> | ||
<span class="test"> あ</span> |
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