Skip to content

Commit dbef80d

Browse files
benoitkuglerwhereswaldon
authored andcommitted
apply changes
1 parent ab27ea1 commit dbef80d

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

render.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package render
22

33
import (
4-
"fmt"
54
"image/color"
65
"image/draw"
76
"math"
7+
"sort"
88

99
"github.com/go-text/typesetting/font"
1010
"github.com/go-text/typesetting/font/opentype"
@@ -54,16 +54,14 @@ func (r *Renderer) shape(str string, face *font.Face) (_ shaping.Line, ascent in
5454
}
5555
}
5656

57-
// // overall direction of the text, deduced from the first runes
58-
// direction := line[0].Direction
59-
// r.wrapper.Prepare(shaping.WrapConfig{Direction: direction}, text, shaping.NewSliceIterator(line))
60-
// wrapped, _ := r.wrapper.WrapNextLine(math.MaxInt)
61-
// line = wrapped.Line
57+
// overall direction of the text, deduced from the first runes
58+
direction := line[0].Direction
59+
r.wrapper.Prepare(shaping.WrapConfig{Direction: direction}, text, shaping.NewSliceIterator(line))
60+
wrapped, _ := r.wrapper.WrapNextLine(math.MaxInt)
61+
line = wrapped.Line
6262

63-
// // sort the line by visual order
64-
// sort.Slice(line, func(i, j int) bool { return line[i].VisualIndex < line[j].VisualIndex })
65-
66-
fmt.Println(line, ascent)
63+
// sort the line by visual order
64+
sort.Slice(line, func(i, j int) bool { return line[i].VisualIndex < line[j].VisualIndex })
6765

6866
return line, ascent
6967
}

0 commit comments

Comments
 (0)