text/v2: update comments

This commit is contained in:
Hajime Hoshi 2024-04-07 19:22:37 +09:00
parent 9c070eb2f3
commit 85c0f4444b
2 changed files with 7 additions and 0 deletions

View File

@ -36,6 +36,10 @@ var _ Face = (*GoTextFace)(nil)
// GoTextFace is a Face implementation for go-text's font.Face (github.com/go-text/typesetting). // 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. // With a GoTextFace, shaping.HarfBuzzShaper is always used as a shaper internally.
// GoTextFace includes the source and various options. // 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 { type GoTextFace struct {
// Source is the font face source. // Source is the font face source.
Source *GoTextFaceSource Source *GoTextFaceSource

View File

@ -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 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 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. // 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 { type GoXFace struct {
f *faceWithCache f *faceWithCache