go-text / typesetting

High quality text shaping in pure Go.
Other
88 stars 11 forks source link

Reduce allocations in metadata #81

Closed benoitkugler closed 1 year ago

benoitkugler commented 1 year ago

Providing a buffer for metadata extractions reduces allocation during system fonts scan.

The API change is required to make sure we don't keep a reference on the shared buffer (whose content may have been overwritten before resolving the family and aspect).

whereswaldon commented 1 year ago

@andydotxyz If you're happy with this, go ahead and merge it into font-scan.