aboutsummaryrefslogtreecommitdiff
path: root/dw/textblock_linebreaking.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2012-11-12 22:04:59 +0100
committerSebastian Geerken <devnull@localhost>2012-11-12 22:04:59 +0100
commit665373f3b7ecf5c31157707d65406174b1a76fe4 (patch)
treea8057f6602958c596338e6d37772e2e86d689b20 /dw/textblock_linebreaking.cc
parent9abf65855047e774daa0d4c5dd6d86343eb1b355 (diff)
Text is now correctly drawn as a whole.
Diffstat (limited to 'dw/textblock_linebreaking.cc')
-rw-r--r--dw/textblock_linebreaking.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/dw/textblock_linebreaking.cc b/dw/textblock_linebreaking.cc
index d111a5b5..0467c3ea 100644
--- a/dw/textblock_linebreaking.cc
+++ b/dw/textblock_linebreaking.cc
@@ -570,7 +570,7 @@ void Textblock::wordWrap (int wordIndex, bool wrapAll)
PRINTF ("\n");
if (word1->badnessAndPenalty.lineTight () &&
- word1->canBeHyphenated &&
+ word1->flags && Word::CAN_BE_HYPHENATED &&
word1->style->x_lang[0] &&
word1->content.type == core::Content::TEXT &&
Hyphenator::isHyphenationCandidate (word1->content.text))
@@ -579,7 +579,7 @@ void Textblock::wordWrap (int wordIndex, bool wrapAll)
if (word1->badnessAndPenalty.lineLoose () &&
breakPos + 1 < words->size ()) {
Word *word2 = words->getRef(breakPos + 1);
- if (word2->canBeHyphenated &&
+ if (word2->flags && Word::CAN_BE_HYPHENATED &&
word2->style->x_lang[0] &&
word2->content.type == core::Content::TEXT &&
Hyphenator::isHyphenationCandidate (word2->content.text))
@@ -702,6 +702,7 @@ int Textblock::hyphenateWord (int wordIndex)
w->badnessAndPenalty.setPenalty (penalties[PENALTY_HYPHEN]);
w->hyphenWidth =
layout->textWidth (origWord.style->font, "\xc2\xad", 2);
+ w->flags |= Word::DRAW_AS_ONE_TEXT;
PRINTF (" [%d] + hyphen\n", wordIndex + i);
} else {
if (origWord.content.space) {
@@ -722,9 +723,8 @@ int Textblock::hyphenateWord (int wordIndex)
origWord.spaceStyle->unref ();
free (breakPos);
- } else {
- words->getRef(wordIndex)->canBeHyphenated = false;
- }
+ } else
+ words->getRef(wordIndex)->flags &= ~Word::CAN_BE_HYPHENATED;
return numBreaks;
}