diff --git a/text/v2/gotext.go b/text/v2/gotext.go index 9cdb7361b..e10add466 100644 --- a/text/v2/gotext.go +++ b/text/v2/gotext.go @@ -36,6 +36,10 @@ var _ Face = (*GoTextFace)(nil) // GoTextFace is a Face implementation for go-text's font.Face (github.com/go-text/typesetting). // With a GoTextFace, shaping.HarfBuzzShaper is always used as a shaper internally. // GoTextFace includes the source and various options. +// +// Unlike GoXFace, one GoTextFace instance doesn't have its own glyph image cache. +// Instead, a GoTextFaceSource has a glyph image cache. +// You can casually create multiple GoTextFace instances from the same GoTextFaceSource. type GoTextFace struct { // Source is the font face source. Source *GoTextFaceSource diff --git a/text/v2/gox.go b/text/v2/gox.go index 98cec7d9d..625215d82 100644 --- a/text/v2/gox.go +++ b/text/v2/gox.go @@ -37,6 +37,9 @@ type goXFaceGlyphImageCacheKey struct { // GoXFace is a Face implementation for a semi-standard font.Face (golang.org/x/image/font). // GoXFace is useful to transit from existing codebase with text v1, or to use some bitmap fonts defined as font.Face. // GoXFace must not be copied by value. +// +// Unlike GoFontFace, one GoXFace instance has its own glyph image cache. +// You should reuse the same GoXFace instance as much as possible. type GoXFace struct { f *faceWithCache