layout: Implement word-spacing per CSS 2.1 § 16.4.

This assumes that there are no ligatures that span across multiple
words. Since we have a per-word shape cache, this is a safe assumption
as of now. I have left comments to ensure that, if and when this is
revisted, we make sure to handle it properly.
This commit is contained in:
Patrick Walton 2014-12-12 17:49:37 -08:00
parent ea39b878ac
commit 106fdb1d32
7 changed files with 94 additions and 7 deletions

View file

@ -115,6 +115,8 @@ pub struct ShapingOptions {
/// Spacing to add between each letter. Corresponds to the CSS 2.1 `letter-spacing` property.
/// NB: You will probably want to set the `IGNORE_LIGATURES_SHAPING_FLAG` if this is non-null.
pub letter_spacing: Option<Au>,
/// Spacing to add between each word. Corresponds to the CSS 2.1 `word-spacing` property.
pub word_spacing: Au,
/// Various flags.
pub flags: ShapingFlags,
}