aboutsummaryrefslogtreecommitdiffstats
path: root/components/gfx/text
diff options
context:
space:
mode:
authorRavi Shankar <wafflespeanut@gmail.com>2016-08-09 11:16:53 +0530
committerRavi Shankar <wafflespeanut@gmail.com>2016-08-09 17:53:40 +0530
commita04028eede04654ac020119043b853e77cae5307 (patch)
tree8a1455326bf32bceb9aedbeaad45257c735f8990 /components/gfx/text
parent7ed9134e5a8401380253f75d4a7ce43ab5027241 (diff)
downloadservo-a04028eede04654ac020119043b853e77cae5307.tar.gz
servo-a04028eede04654ac020119043b853e77cae5307.zip
Prefer length and percentage for word spacing
Diffstat (limited to 'components/gfx/text')
-rw-r--r--components/gfx/text/shaping/harfbuzz.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/components/gfx/text/shaping/harfbuzz.rs b/components/gfx/text/shaping/harfbuzz.rs
index 5106418be61..ba5f281c04d 100644
--- a/components/gfx/text/shaping/harfbuzz.rs
+++ b/components/gfx/text/shaping/harfbuzz.rs
@@ -403,7 +403,9 @@ impl Shaper {
// applied. The effect of the property on other word-separator characters is undefined."
// We elect to only space the two required code points.
if character == ' ' || character == '\u{a0}' {
- advance = advance + options.word_spacing
+ // https://drafts.csswg.org/css-text-3/#word-spacing-property
+ let (length, percent) = options.word_spacing;
+ advance = (advance + length) + Au((advance.0 as f32 * percent.into_inner()) as i32);
}
advance