fonts: Initial draft of synthetic bold face for FreeType (#39519)

This is an initial attempt at implementing synthetic bold face for font
families that lack actual bold faces. The overall approach borrowed
implementations from Chromium and FireFox. WPT expectations will be
updated after https://github.com/servo/stylo/pull/244 lands

Testing: There are existing WPT testcases for font synthesis
(`wpt/css/css-fonts/font-synthesis-*`)

Depends on: https://github.com/servo/stylo/pull/244

---------

Signed-off-by: Minghua Wu <michael.wu1107@gmail.com>
Signed-off-by: minghuaw <michael.wu1107@gmail.com>
This commit is contained in:
minghuaw 2025-10-02 05:54:12 +08:00 committed by GitHub
parent 4ea363277e
commit bcd8bbb142
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 141 additions and 151 deletions

View file

@ -542,60 +542,6 @@
[CSS Transitions: property <font-synthesis-weight> from [initial\] to [none\] at (0.3) should be [initial\]]
expected: FAIL
[CSS Transitions: property <font-synthesis-weight> from [initial\] to [none\] at (0.5) should be [none\]]
expected: FAIL
[CSS Transitions: property <font-synthesis-weight> from [initial\] to [none\] at (0.6) should be [none\]]
expected: FAIL
[CSS Transitions: property <font-synthesis-weight> from [initial\] to [none\] at (1) should be [none\]]
expected: FAIL
[CSS Transitions: property <font-synthesis-weight> from [initial\] to [none\] at (1.5) should be [none\]]
expected: FAIL
[CSS Transitions with transition: all: property <font-synthesis-weight> from [initial\] to [none\] at (-0.3) should be [none\]]
expected: FAIL
[CSS Transitions with transition: all: property <font-synthesis-weight> from [initial\] to [none\] at (0) should be [none\]]
expected: FAIL
[CSS Transitions with transition: all: property <font-synthesis-weight> from [initial\] to [none\] at (0.3) should be [none\]]
expected: FAIL
[CSS Transitions with transition: all: property <font-synthesis-weight> from [initial\] to [none\] at (0.5) should be [none\]]
expected: FAIL
[CSS Transitions with transition: all: property <font-synthesis-weight> from [initial\] to [none\] at (0.6) should be [none\]]
expected: FAIL
[CSS Transitions with transition: all: property <font-synthesis-weight> from [initial\] to [none\] at (1) should be [none\]]
expected: FAIL
[CSS Transitions with transition: all: property <font-synthesis-weight> from [initial\] to [none\] at (1.5) should be [none\]]
expected: FAIL
[CSS Animations: property <font-synthesis-weight> from [initial\] to [none\] at (-0.3) should be [initial\]]
expected: FAIL
[CSS Animations: property <font-synthesis-weight> from [initial\] to [none\] at (0) should be [initial\]]
expected: FAIL
[CSS Animations: property <font-synthesis-weight> from [initial\] to [none\] at (0.3) should be [initial\]]
expected: FAIL
[CSS Animations: property <font-synthesis-weight> from [initial\] to [none\] at (0.5) should be [none\]]
expected: FAIL
[CSS Animations: property <font-synthesis-weight> from [initial\] to [none\] at (0.6) should be [none\]]
expected: FAIL
[CSS Animations: property <font-synthesis-weight> from [initial\] to [none\] at (1) should be [none\]]
expected: FAIL
[CSS Animations: property <font-synthesis-weight> from [initial\] to [none\] at (1.5) should be [none\]]
expected: FAIL
[Web Animations: property <font-synthesis-weight> from [initial\] to [none\] at (-0.3) should be [initial\]]
expected: FAIL
@ -1133,15 +1079,6 @@
[CSS Transitions: property <font-synthesis-style> from [initial\] to [none\] at (0.3) should be [none\]]
expected: FAIL
[CSS Transitions: property <font-synthesis-weight> from [initial\] to [none\] at (-0.3) should be [none\]]
expected: FAIL
[CSS Transitions: property <font-synthesis-weight> from [initial\] to [none\] at (0) should be [none\]]
expected: FAIL
[CSS Transitions: property <font-synthesis-weight> from [initial\] to [none\] at (0.3) should be [none\]]
expected: FAIL
[CSS Transitions: property <font-variant-alternates> from [initial\] to [historical-forms\] at (-0.3) should be [historical-forms\]]
expected: FAIL
@ -1397,48 +1334,6 @@
[CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <font-synthesis-style> from [initial\] to [none\] at (1.5) should be [none\]]
expected: FAIL
[CSS Transitions with transition-behavior:allow-discrete: property <font-synthesis-weight> from [initial\] to [none\] at (-0.3) should be [initial\]]
expected: FAIL
[CSS Transitions with transition-behavior:allow-discrete: property <font-synthesis-weight> from [initial\] to [none\] at (0) should be [initial\]]
expected: FAIL
[CSS Transitions with transition-behavior:allow-discrete: property <font-synthesis-weight> from [initial\] to [none\] at (0.3) should be [initial\]]
expected: FAIL
[CSS Transitions with transition-behavior:allow-discrete: property <font-synthesis-weight> from [initial\] to [none\] at (0.5) should be [none\]]
expected: FAIL
[CSS Transitions with transition-behavior:allow-discrete: property <font-synthesis-weight> from [initial\] to [none\] at (0.6) should be [none\]]
expected: FAIL
[CSS Transitions with transition-behavior:allow-discrete: property <font-synthesis-weight> from [initial\] to [none\] at (1) should be [none\]]
expected: FAIL
[CSS Transitions with transition-behavior:allow-discrete: property <font-synthesis-weight> from [initial\] to [none\] at (1.5) should be [none\]]
expected: FAIL
[CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <font-synthesis-weight> from [initial\] to [none\] at (-0.3) should be [initial\]]
expected: FAIL
[CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <font-synthesis-weight> from [initial\] to [none\] at (0) should be [initial\]]
expected: FAIL
[CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <font-synthesis-weight> from [initial\] to [none\] at (0.3) should be [initial\]]
expected: FAIL
[CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <font-synthesis-weight> from [initial\] to [none\] at (0.5) should be [none\]]
expected: FAIL
[CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <font-synthesis-weight> from [initial\] to [none\] at (0.6) should be [none\]]
expected: FAIL
[CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <font-synthesis-weight> from [initial\] to [none\] at (1) should be [none\]]
expected: FAIL
[CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <font-synthesis-weight> from [initial\] to [none\] at (1.5) should be [none\]]
expected: FAIL
[CSS Transitions with transition-behavior:allow-discrete: property <font-variant-alternates> from [initial\] to [historical-forms\] at (-0.3) should be [initial\]]
expected: FAIL

View file

@ -0,0 +1,3 @@
[font-face-local-not-family.html]
expected:
if os == "linux": FAIL

View file

@ -0,0 +1,3 @@
[font-synthesis-08.html]
expected:
if os == "linux": FAIL

View file

@ -1,2 +0,0 @@
[font-synthesis-weight-binary.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[font-synthesis-weight-first-letter.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[font-synthesis-weight-first-line.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[font-synthesis-weight.html]
expected: FAIL

View file

@ -1,6 +0,0 @@
[font-synthesis-weight-valid.html]
[e.style['font-synthesis-weight'\] = "auto" should set the property value]
expected: FAIL
[e.style['font-synthesis-weight'\] = "none" should set the property value]
expected: FAIL

View file

@ -146,9 +146,6 @@
[Transition of font-synthesis-style in ::marker]
expected: FAIL
[Transition of font-synthesis-weight in ::marker]
expected: FAIL
[Transition of font-variant in ::marker]
expected: FAIL

View file

@ -17,9 +17,6 @@
[Property font-synthesis-style value 'none' in ::marker]
expected: FAIL
[Property font-synthesis-weight value 'none' in ::marker]
expected: FAIL
[Property font-variant-east-asian value 'full-width' in ::marker]
expected: FAIL

View file

@ -0,0 +1,3 @@
[table_padding_a.html]
expected:
if os == "linux": FAIL