Prefer length and percentage for word spacing

This commit is contained in:
Ravi Shankar 2016-08-09 11:16:53 +05:30
parent 7ed9134e5a
commit a04028eede
15 changed files with 135 additions and 10 deletions

View file

@ -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