Skip to content

Commit

Permalink
text/v2: always use Segmenter
Browse files Browse the repository at this point in the history
  • Loading branch information
hajimehoshi committed Dec 23, 2023
1 parent 2e363cc commit f0396ba
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions text/v2/gotextfacesource.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,8 @@ func (g *GoTextFaceSource) shape(text string, face *GoTextFace) ([]shaping.Outpu
Language: language.Language(face.Language.String()),
}

var inputs []shaping.Input
if face.Direction.isHorizontal() {
// shaping.Segmenter is not used for horizontal texts so far due to a bug (go-text/typesetting#127).
inputs = []shaping.Input{input}
} else {
var seg shaping.Segmenter
inputs = seg.Split(input, &singleFontmap{face: face.Source.f})
}
var seg shaping.Segmenter
inputs := seg.Split(input, &singleFontmap{face: face.Source.f})

if face.Direction == DirectionRightToLeft {
// Reverse the input for RTL texts.
Expand Down

0 comments on commit f0396ba

Please sign in to comment.