diff options
author | Kurt <kurt.w.jung@gmail.com> | 2019-05-06 08:49:56 -0400 |
---|---|---|
committer | Kurt <kurt.w.jung@gmail.com> | 2019-05-06 08:49:56 -0400 |
commit | bd6c576bfedb4b1a02d8232f9332244a4497df55 (patch) | |
tree | 0102e96d09ae7d86a259407837d65fe1cb33f754 /fpdf.go | |
parent | 19544237e961fe8e9ee7ca55fdafe724de35f889 (diff) |
Correct some misspellings
Diffstat (limited to 'fpdf.go')
-rw-r--r-- | fpdf.go | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -2107,7 +2107,7 @@ func (f *Fpdf) Text(x, y float64, txtStr string) { var txt2 string if f.isCurrentUTF8 { if f.isRTL { - txtStr = revertText(txtStr) + txtStr = reverseText(txtStr) x -= f.GetStringWidth(txtStr) } txt2 = f.escape(utf8toutf16(txtStr, false)) @@ -2299,7 +2299,7 @@ func (f *Fpdf) CellFormat(w, h float64, txtStr, borderStr string, ln int, //If multibyte, Tw has no effect - do word spacing using an adjustment before each space if (f.ws != 0 || alignStr == "J") && f.isCurrentUTF8 { // && f.ws != 0 if f.isRTL { - txtStr = revertText(txtStr) + txtStr = reverseText(txtStr) } wmax := int(math.Ceil((w - 2*f.cMargin) * 1000 / f.fontSize)) for _, uni := range []rune(txtStr) { @@ -2324,7 +2324,7 @@ func (f *Fpdf) CellFormat(w, h float64, txtStr, borderStr string, ln int, var txt2 string if f.isCurrentUTF8 { if f.isRTL { - txtStr = revertText(txtStr) + txtStr = reverseText(txtStr) } txt2 = f.escape(utf8toutf16(txtStr, false)) for _, uni := range []rune(txtStr) { @@ -2370,12 +2370,12 @@ func (f *Fpdf) CellFormat(w, h float64, txtStr, borderStr string, ln int, } // Revert string to use in RTL languages -func revertText(text string) string { +func reverseText(text string) string { oldText := []rune(text) newText := make([]rune, len(oldText)) - lenght := len(oldText) - 1 + length := len(oldText) - 1 for i, r := range oldText { - newText[lenght-i] = r + newText[length-i] = r } return string(newText) } |