diff options
Diffstat (limited to 'src/ui/text.c')
-rw-r--r-- | src/ui/text.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/ui/text.c b/src/ui/text.c index 2ceadb75..f998688a 100644 --- a/src/ui/text.c +++ b/src/ui/text.c | |||
@@ -586,11 +586,22 @@ static enum iFontId fontId_Text_(const iFont *font) { | |||
586 | return font - text_.fonts; | 586 | return font - text_.fonts; |
587 | } | 587 | } |
588 | 588 | ||
589 | iLocalDef iBool isWrapBoundary_(iChar a, iChar b) { | 589 | /* Line wrapping boundaries are determined by looking at a character and the |
590 | if (b == '/' || b == '-' || b == ',' || b == ';' || b == ':' || b == '.') { | 590 | * last character processed. We want to wrap at natural word boundaries where |
591 | * possible, so normally we wrap at a space followed a non-space character. As | ||
592 | * an exception, we also wrap after punctuation used to break up words, so we | ||
593 | * can wrap text like foo/bar/baz-abc-def.xyz at any puncation boundaries, | ||
594 | * without wrapping on other punctuation used for expressive purposes like | ||
595 | * emoticons :-) */ | ||
596 | |||
597 | iLocalDef iBool isWrapBoundary_(iChar prevC, iChar c) { | ||
598 | if (isSpace_Char(prevC)) | ||
599 | return iFalse; | ||
600 | |||
601 | if (c == '/' || c == '-' || c == ',' || c == ';' || c == ':' || c == '.') | ||
591 | return iTrue; | 602 | return iTrue; |
592 | } | 603 | |
593 | return !isSpace_Char(a) && isSpace_Char(b); | 604 | return isSpace_Char(c); |
594 | } | 605 | } |
595 | 606 | ||
596 | iLocalDef iBool isMeasuring_(enum iRunMode mode) { | 607 | iLocalDef iBool isMeasuring_(enum iRunMode mode) { |