text/v2: update comments

This commit is contained in:
Hajime Hoshi 2023-11-26 15:52:40 +09:00
parent b0c5a49f96
commit 8291a98756
2 changed files with 4 additions and 3 deletions

View File

@ -128,7 +128,8 @@ func AppendGlyphs(glyphs []Glyph, text string, face Face, options *LayoutOptions
// AppndVectorPath appends a vector path for glyphs to the given path. // AppndVectorPath appends a vector path for glyphs to the given path.
// //
// AppendVectorPath works only when face is *GoTextFace so far. For other types, AppendVectorPath does nothing. // AppendVectorPath works only when the face is *GoTextFace or a composite face using *GoTextFace so far.
// For other types, AppendVectorPath does nothing.
func AppendVectorPath(path *vector.Path, text string, face Face, options *LayoutOptions) { func AppendVectorPath(path *vector.Path, text string, face Face, options *LayoutOptions) {
forEachLine(text, face, options, func(line string, indexOffset int, originX, originY float64) { forEachLine(text, face, options, func(line string, indexOffset int, originX, originY float64) {
face.appendVectorPathForLine(path, line, originX, originY) face.appendVectorPathForLine(path, line, originX, originY)

View File

@ -27,7 +27,7 @@ import (
"github.com/hajimehoshi/ebiten/v2/vector" "github.com/hajimehoshi/ebiten/v2/vector"
) )
// Face is an interface representing a font face. The implementations are only GoTextFace and StdFace. // Face is an interface representing a font face. The implementations are only faces in this package, like GoTextFace and StdFace.
type Face interface { type Face interface {
// Metrics returns the metrics for this Face. // Metrics returns the metrics for this Face.
Metrics() Metrics Metrics() Metrics
@ -125,7 +125,7 @@ type Glyph struct {
// EndIndexInBytes is the end index in bytes for the given string at AppendGlyphs. // EndIndexInBytes is the end index in bytes for the given string at AppendGlyphs.
EndIndexInBytes int EndIndexInBytes int
// GID is an ID for a glyph of TrueType or OpenType font. GID is valid when the font is GoTextFont. // GID is an ID for a glyph of TrueType or OpenType font. GID is valid when the face is GoTextFace.
GID uint32 GID uint32
// Image is a rasterized glyph image. // Image is a rasterized glyph image.