font/opentype: fix font.Face creation

typesetting introduced a cache field that needs to be
properly initialized. Use constructor to avoid the issue.

Signed-off-by: Egon Elbre <egonelbre@gmail.com>
This commit is contained in:
Egon Elbre
2026-05-08 18:20:49 +03:00
committed by Chris Waldon
parent b1cadbdd76
commit e8c1e1ba11
+1 -1
View File
@@ -106,7 +106,7 @@ func parseLoader(ld *opentype.Loader) (*fontapi.Font, giofont.Font, error) {
// Face many be invoked any number of times and is safe so long as each return value is
// only used by one goroutine.
func (f Face) Face() *fontapi.Face {
return &fontapi.Face{Font: f.face}
return fontapi.NewFace(f.face)
}
// FontFace returns a text.Font with populated font metadata for the