forked from joejulian/gio
go.*,text: update go-text to pick up font transformation caching
This commit picks up improvements in upstream go-text that (among other things) allow the shaper to reuse a lot of information when shaping the same font face multiple times (using an LRU cache to keep that information available). I've tried to pick a reasonable default LRU size of 32 faces. My simple benchmarks indicate a definitive performance gain and reduction in memory use across the board, which is especially noticable for complex fonts like arabic and emoji. Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
This commit is contained in:
@@ -200,6 +200,7 @@ func NewShaper(collection []FontFace) *Shaper {
|
||||
for _, f := range collection {
|
||||
l.shaper.Load(f)
|
||||
}
|
||||
l.shaper.shaper.SetFontCacheSize(32)
|
||||
return l
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user