Skip to content

fonts: Don't apply letter-spacing to formatting characters#42961

Merged
simonwuelker merged 3 commits into
servo:mainfrom
simonwuelker:font-spacing-formatting-characters
Mar 2, 2026
Merged

fonts: Don't apply letter-spacing to formatting characters#42961
simonwuelker merged 3 commits into
servo:mainfrom
simonwuelker:font-spacing-formatting-characters

Conversation

@simonwuelker
Copy link
Copy Markdown
Member

This change checks whether a character belongs to the Cf category of unicode characters before applying letter-spacing. The fonts crate now depends on icu_properties, but that crate is already in our dependency tree (with the same features enabled).

Testing: New tests start to pass
Fixes #38781

@simonwuelker simonwuelker requested a review from nicoburns as a code owner March 2, 2026 18:01
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 2, 2026
@simonwuelker simonwuelker changed the title Don't apply letter-spacing to formatting characters fonts: Don't apply letter-spacing to formatting characters Mar 2, 2026
Comment thread Cargo.toml Outdated
Comment on lines +110 to +111
icu_segmenter = "1.5.0"
icu_properties = "1.5.0"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetical ordering nit:

Suggested change
icu_segmenter = "1.5.0"
icu_properties = "1.5.0"
icu_properties = "1.5.0"
icu_segmenter = "1.5.0"

Comment thread components/fonts/Cargo.toml Outdated
Comment on lines +29 to +30
itertools = { workspace = true }
icu_properties = { workspace = true, features = ["compiled_data"] }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetical ordering nit:

Suggested change
itertools = { workspace = true }
icu_properties = { workspace = true, features = ["compiled_data"] }
icu_properties = { workspace = true, features = ["compiled_data"] }
itertools = { workspace = true }

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Mar 2, 2026
Signed-off-by: Simon Wülker <[email protected]>
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 2, 2026
@simonwuelker simonwuelker enabled auto-merge March 2, 2026 18:34
@simonwuelker simonwuelker added this pull request to the merge queue Mar 2, 2026
@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 Mar 2, 2026
Merged via the queue into servo:main with commit 640fe63 Mar 2, 2026
33 checks passed
@simonwuelker simonwuelker deleted the font-spacing-formatting-characters branch March 2, 2026 20:40
@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 Mar 2, 2026
simonwuelker added a commit to simonwuelker/servo that referenced this pull request Mar 3, 2026
…2961)

This change checks whether a character belongs to the `Cf` category of
unicode characters before applying `letter-spacing`. The `fonts` crate
now depends on `icu_properties`, but that crate is already in our
dependency tree (with the same features enabled).

Testing: New tests start to pass
Fixes servo#38781

---------

Signed-off-by: Simon Wülker <[email protected]>
offline-ant pushed a commit to offline-ant/havi that referenced this pull request Jun 4, 2026
…2961)

This change checks whether a character belongs to the `Cf` category of
unicode characters before applying `letter-spacing`. The `fonts` crate
now depends on `icu_properties`, but that crate is already in our
dependency tree (with the same features enabled).

Testing: New tests start to pass
Fixes servo#38781

---------

Signed-off-by: Simon Wülker <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-platform/fonts 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.

letter-spacing should not add spacing for zero-width formatting characters

3 participants