Skip to content

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

Merged
jdm merged 24 commits intoservo:mainfrom
minghuaw:feat/synth-bold-ft
Oct 1, 2025
Merged

fonts: Initial draft of synthetic bold face for FreeType#39519
jdm merged 24 commits intoservo:mainfrom
minghuaw:feat/synth-bold-ft

Conversation

@minghuaw
Copy link
Copy Markdown
Contributor

@minghuaw minghuaw commented Sep 26, 2025

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 servo/stylo#244 lands

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

Depends on: servo/stylo#244

@minghuaw minghuaw requested a review from nicoburns as a code owner September 26, 2025 16:58
@servo-highfive servo-highfive added S-awaiting-review There is new code that needs to be reviewed. S-needs-rebase There are merge conflict errors. labels Sep 26, 2025
@minghuaw minghuaw marked this pull request as draft September 26, 2025 16:58
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync.

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync.

@minghuaw minghuaw changed the title fonts: Initial draft of synthetic bold face fonts: Initial draft of synthetic bold face for linux/freetype Sep 26, 2025
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync.

@minghuaw minghuaw marked this pull request as ready for review September 29, 2025 08:26
@servo-highfive servo-highfive removed the S-needs-rebase There are merge conflict errors. label Sep 29, 2025
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync.

Signed-off-by: Minghua Wu <[email protected]>
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync.

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync.

Signed-off-by: Minghua Wu <[email protected]>
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync.

@jdm jdm added this pull request to the merge queue Oct 1, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 1, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 1, 2025
@servo-highfive servo-highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Oct 1, 2025
@minghuaw
Copy link
Copy Markdown
Contributor Author

minghuaw commented Oct 1, 2025

Signed-off-by: Minghua Wu <[email protected]>
@servo-highfive servo-highfive removed the S-tests-failed The changes caused existing tests to fail. label Oct 1, 2025
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync.

Signed-off-by: Minghua Wu <[email protected]>
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync.

@jdm jdm added this pull request to the merge queue Oct 1, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 1, 2025
Merged via the queue into servo:main with commit bcd8bbb Oct 1, 2025
25 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 1, 2025
@minghuaw minghuaw deleted the feat/synth-bold-ft branch October 2, 2025 01:14
github-merge-queue bot pushed a commit that referenced this pull request Oct 7, 2025
…synthesizing bold face for FreeType platform (#39681)

The previous implementation in #39519 mistakenly used the
`FontTemplateDescriptor` to determine whether the font face itself is
already bold. This PR fixes that by using the `usWeightClass` in the
`OS/2` table of the font face to determine if the font face is bold
already.

Testing: A new testcase
`/tests/wpt/mozilla/tests/css/font_synthesis_weight_static_bold.html` is
getting added in #39633. This test checks whether a bold font face gets
"double emboldened"
Depends on: #39633

---------

Signed-off-by: Minghua Wu <[email protected]>
Signed-off-by: minghuaw <[email protected]>
Co-authored-by: Martin Robinson <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Oct 9, 2025
This PR follows #39519 and adds
synthetic bold face support for MacOs platform.

Testing: There are existing WPT testcases for font synthesis
(wpt/css/css-fonts/font-synthesis-*). A new test checking that a bold
face font does not get "double emboldened" is getting added in #39713
Part of #39637

---------

Signed-off-by: minghuaw <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Oct 10, 2025
This PR follows #39519 and adds synthetic bold face support for Windows
platform.

Testing: There are existing WPT testcases for font synthesis
(wpt/css/css-fonts/font-synthesis-*). A new test that checks for "double
emboldening" (a bold font gets emboldened again) is getting added to the
upstream WPT repo (web-platform-tests/wpt#55313)
Depends on: servo/dwrote-rs#70,
servo/dwrote-rs#71
Part of #39637

---------

Signed-off-by: Minghua Wu <[email protected]>
Signed-off-by: minghuaw <[email protected]>
Co-authored-by: minghuaw <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants