aboutsummaryrefslogtreecommitdiff
path: root/dw
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2010-04-20 16:04:24 +0000
committercorvid <corvid@lavabit.com>2010-04-20 16:04:24 +0000
commitbda22922f7ed5934a2c1cd9740836df1a22cbc30 (patch)
tree7e7713dcbca5bfa1bead72abe9bd0388bcadbc4e /dw
parent7a6266b40e3b340883d1f7fb22c0099a8253cc88 (diff)
css word-spacing property
Diffstat (limited to 'dw')
-rw-r--r--dw/style.cc4
-rw-r--r--dw/style.hh2
-rw-r--r--dw/textblock.cc3
-rw-r--r--dw/textblock.hh6
4 files changed, 10 insertions, 5 deletions
diff --git a/dw/style.cc b/dw/style.cc
index 65c51f89..cc58ce28 100644
--- a/dw/style.cc
+++ b/dw/style.cc
@@ -53,6 +53,7 @@ void StyleAttrs::initValues ()
setBorderStyle (BORDER_NONE);
hBorderSpacing = 0;
vBorderSpacing = 0;
+ wordSpacing = 0;
display = DISPLAY_INLINE;
whiteSpace = WHITE_SPACE_NORMAL;
@@ -115,6 +116,7 @@ bool StyleAttrs::equals (object::Object *other) {
textAlignChar == otherAttrs->textAlignChar &&
hBorderSpacing == otherAttrs->hBorderSpacing &&
vBorderSpacing == otherAttrs->vBorderSpacing &&
+ wordSpacing == otherAttrs->wordSpacing &&
width == otherAttrs->width &&
height == otherAttrs->height &&
lineHeight == otherAttrs->lineHeight &&
@@ -149,6 +151,7 @@ int StyleAttrs::hashValue () {
textAlignChar +
hBorderSpacing +
vBorderSpacing +
+ wordSpacing +
width +
height +
lineHeight +
@@ -236,6 +239,7 @@ void Style::copyAttrs (StyleAttrs *attrs)
textAlignChar = attrs->textAlignChar;
hBorderSpacing = attrs->hBorderSpacing;
vBorderSpacing = attrs->vBorderSpacing;
+ wordSpacing = attrs->wordSpacing;
width = attrs->width;
height = attrs->height;
lineHeight = attrs->lineHeight;
diff --git a/dw/style.hh b/dw/style.hh
index af55bb87..04a5e22e 100644
--- a/dw/style.hh
+++ b/dw/style.hh
@@ -426,7 +426,7 @@ public:
VAlignType valign;
char textAlignChar; /* In future, strings will be supported. */
- int hBorderSpacing, vBorderSpacing;
+ int hBorderSpacing, vBorderSpacing, wordSpacing;
Length width, height, lineHeight;
Box margin, borderWidth, padding;
diff --git a/dw/textblock.cc b/dw/textblock.cc
index b2772084..cc743252 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -1722,7 +1722,8 @@ void Textblock::addSpace (core::style::Style *style)
if (!word->content.space) {
word->content.space = true;
- word->effSpace = word->origSpace = style->font->spaceWidth;
+ word->effSpace = word->origSpace = style->font->spaceWidth +
+ style->wordSpacing;
//DBG_OBJ_ARRSET_NUM (page, "words.%d.orig_space", nw,
// page->words[nw].orig_space);
diff --git a/dw/textblock.hh b/dw/textblock.hh
index 88351dbb..d05c87e2 100644
--- a/dw/textblock.hh
+++ b/dw/textblock.hh
@@ -163,9 +163,9 @@ protected:
/* TODO: perhaps add a xLeft? */
core::Requisition size;
/* Space after the word, only if it's not a break: */
- unsigned short origSpace; /* from font, set by addSpace */
- unsigned short effSpace; /* effective space, set by wordWrap,
- * used for drawing etc. */
+ short origSpace; /* from font, set by addSpace */
+ short effSpace; /* effective space, set by wordWrap,
+ * used for drawing etc. */
core::Content content;
core::style::Style *style;