aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/flow
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2024-06-05 17:00:57 +0200
committerGitHub <noreply@github.com>2024-06-05 15:00:57 +0000
commit6eaccbc297dee9c1189a008ad846efa6b5a245f2 (patch)
tree75bb7c5866fe20da9463ebcf2ce82652c2398318 /components/layout_2020/flow
parent49e15269c906fbb708bd0018a55757d5e8d22d9c (diff)
downloadservo-6eaccbc297dee9c1189a008ad846efa6b5a245f2.tar.gz
servo-6eaccbc297dee9c1189a008ad846efa6b5a245f2.zip
layout: Don't default to fallback fonts for spaces (#32442)
Previously, when deciding the font for a space, preference was given to the previous used font. This could means that the font chosen was a fallback font instead of the first font that supporting the space character in the font preference list. This caused an issue rendering emojis surrounded by spaces with "Noto Color Emoji" which has a space character the same size as the emoji, leading to too much spacing between them. Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
Diffstat (limited to 'components/layout_2020/flow')
-rw-r--r--components/layout_2020/flow/inline/text_run.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/layout_2020/flow/inline/text_run.rs b/components/layout_2020/flow/inline/text_run.rs
index e916be287c5..5ac92e91f16 100644
--- a/components/layout_2020/flow/inline/text_run.rs
+++ b/components/layout_2020/flow/inline/text_run.rs
@@ -386,7 +386,7 @@ fn char_prevents_soft_wrap_opportunity_when_before_or_after_atomic(character: ch
/// character are not rendered at all, so it doesn't matter what font we use to render them. They
/// should just be added to the current segment.
fn char_does_not_change_font(character: char) -> bool {
- if character.is_whitespace() || character.is_control() {
+ if character.is_control() {
return true;
}
if character == '\u{00A0}' {