diff options
author | Kurt <kurt.w.jung@gmail.com> | 2019-06-18 14:28:08 -0400 |
---|---|---|
committer | Kurt <kurt.w.jung@gmail.com> | 2019-06-18 14:28:08 -0400 |
commit | 3170e6eba2a3a48e2b1b9c621fdf57f250d24c61 (patch) | |
tree | f535adc7f182bcad853c4251050ae10a779669b9 | |
parent | 9d03221773acee72ec2753772dc81d9df81ab63a (diff) | |
parent | 5050243a8fdfd7329d6413b856d7e557e9ffbf3d (diff) |
Merge branch 'master' of https://github.com/seletskiy/gofpdf into seletskiy-master
-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) |