From a04028eede04654ac020119043b853e77cae5307 Mon Sep 17 00:00:00 2001 From: Ravi Shankar Date: Tue, 9 Aug 2016 11:16:53 +0530 Subject: Prefer length and percentage for word spacing --- components/gfx/text/shaping/harfbuzz.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'components/gfx/text') 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 -- cgit v1.2.3