diff options
author | Stanislav Seletskiy <s.seletskiy@gmail.com> | 2019-06-18 15:46:40 +0300 |
---|---|---|
committer | Stanislav Seletskiy <s.seletskiy@gmail.com> | 2019-06-18 15:46:40 +0300 |
commit | 5050243a8fdfd7329d6413b856d7e557e9ffbf3d (patch) | |
tree | 8a71b94fa96002576e5f3beb0e57a105cd419557 | |
parent | 8060f8371088d63b5935a6eeb617328705387ace (diff) |
WriteAligned: use SplitText for UTF-8
-rw-r--r-- | fpdf.go | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -2802,7 +2802,15 @@ func (f *Fpdf) WriteAligned(width, lineHeight float64, textStr, alignStr string) width = pageWidth - (lMargin + rMargin) } - lines := f.SplitLines([]byte(textStr), width) + var lines []string + + if f.isCurrentUTF8 { + lines = f.SplitText(textStr, width) + } else { + for _, line := range f.SplitLines([]byte(textStr), width) { + lines = append(lines, string(line)) + } + } for _, lineBt := range lines { lineStr := string(lineBt) |