Skip to content

Commit

Permalink
text/v2: reuse HarfBuzzShaper
Browse files Browse the repository at this point in the history
Updates #2963
  • Loading branch information
hajimehoshi committed Apr 17, 2024
1 parent 9cd7b34 commit 11223d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion text/v2/gotextfacesource.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ type GoTextFaceSource struct {

addr *GoTextFaceSource

shaper shaping.HarfbuzzShaper

m sync.Mutex
}

Expand Down Expand Up @@ -203,7 +205,7 @@ func (g *GoTextFaceSource) shape(text string, face *GoTextFace) ([]shaping.Outpu
outputs := make([]shaping.Output, len(inputs))
var gs []glyph
for i, input := range inputs {
out := (&shaping.HarfbuzzShaper{}).Shape(input)
out := g.shaper.Shape(input)
outputs[i] = out

(shaping.Line{out}).AdjustBaselines()
Expand Down

0 comments on commit 11223d9

Please sign in to comment.