From 5cb8bab84fe08b93191ed0385c016592d2ac7cc4 Mon Sep 17 00:00:00 2001 From: hyzgh <31174102+hyzgh@users.noreply.github.com> Date: Tue, 20 Aug 2019 19:50:37 +0800 Subject: fix split line bug Change-Id: I224a7ec1af8386dcbef757c76389fb88316401bc --- splittext.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'splittext.go') diff --git a/splittext.go b/splittext.go index 3902199..525f93b 100644 --- a/splittext.go +++ b/splittext.go @@ -26,8 +26,7 @@ func (f *Fpdf) SplitText(txt string, w float64) (lines []string) { for i < nb { c := s[i] l += cw[c] - if unicode.IsSpace(c) { - // if c == ' ' || c == '\t' || c == '\n' { + if unicode.IsSpace(c) || isChinese(c) { sep = i } if c == '\n' || l > wmax { -- cgit v1.2.1-24-ge1ad