diff options
author | Ravi Shankar <wafflespeanut@gmail.com> | 2016-08-09 11:16:53 +0530 |
---|---|---|
committer | Ravi Shankar <wafflespeanut@gmail.com> | 2016-08-09 17:53:40 +0530 |
commit | a04028eede04654ac020119043b853e77cae5307 (patch) | |
tree | 8a1455326bf32bceb9aedbeaad45257c735f8990 /components/gfx/text | |
parent | 7ed9134e5a8401380253f75d4a7ce43ab5027241 (diff) | |
download | servo-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.rs | 4 |
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 |