From bda22922f7ed5934a2c1cd9740836df1a22cbc30 Mon Sep 17 00:00:00 2001 From: corvid Date: Tue, 20 Apr 2010 16:04:24 +0000 Subject: css word-spacing property --- src/styleengine.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/styleengine.cc') diff --git a/src/styleengine.cc b/src/styleengine.cc index 6691ba41..906f47ee 100644 --- a/src/styleengine.cc +++ b/src/styleengine.cc @@ -469,6 +469,21 @@ void StyleEngine::apply (StyleAttrs *attrs, CssPropertyList *props) { case CSS_PROPERTY_HEIGHT: computeLength (&attrs->height, p->value.intVal, attrs->font); break; + case CSS_PROPERTY_WORD_SPACING: + if (p->type == CSS_TYPE_ENUM) { + if (p->value.intVal == CSS_WORD_SPACING_NORMAL) { + attrs->wordSpacing = 0; + } + } else { + computeValue(&attrs->wordSpacing, p->value.intVal, attrs->font); + } + + /* Limit to reasonable values to avoid overflows */ + if (attrs->wordSpacing > 1000) + attrs->wordSpacing = 1000; + else if (attrs->wordSpacing < -1000) + attrs->wordSpacing = -1000; + break; case PROPERTY_X_LINK: attrs->x_link = p->value.intVal; break; -- cgit v1.2.3