Documentation
¶
Index ¶
- Variables
- func Fixed266ToFloat64(v fixed.Int26_6) float64
- func Float32ToFixed266(v float32) fixed.Int26_6
- func Float64ToFixed266(v float64) fixed.Int26_6
- func NewFallbackFaces(fallbackFont *Font, fopts FaceOptions) []font.Face
- func NewKernCache(face font.Face, r0, r1 rune) fixed.Int26_6
- func Rect266MinFloorMaxCeil(r fixed.Rectangle26_6) image.Rectangle
- type FaceCache
- func (fc *FaceCache) Glyph(dot fixed.Point26_6, ru rune) (dr image.Rectangle, mask image.Image, maskp image.Point, advance fixed.Int26_6, ...)
- func (fc *FaceCache) GlyphAdvance(ru rune) (advance fixed.Int26_6, ok bool)
- func (fc *FaceCache) GlyphBounds(ru rune) (bounds fixed.Rectangle26_6, advance fixed.Int26_6, ok bool)
- func (fc *FaceCache) Kern(r0, r1 rune) fixed.Int26_6
- type FaceCacheL
- func (fc *FaceCacheL) Glyph(dot fixed.Point26_6, ru rune) (dr image.Rectangle, mask image.Image, maskp image.Point, advance fixed.Int26_6, ...)
- func (fc *FaceCacheL) GlyphAdvance(ru rune) (advance fixed.Int26_6, ok bool)
- func (fc *FaceCacheL) GlyphBounds(ru rune) (bounds fixed.Rectangle26_6, advance fixed.Int26_6, ok bool)
- func (fc *FaceCacheL) Kern(r0, r1 rune) fixed.Int26_6
- type FaceCacheL2
- func (fc *FaceCacheL2) Glyph(dot fixed.Point26_6, ru rune) (dr image.Rectangle, mask image.Image, maskp image.Point, advance fixed.Int26_6, ...)
- func (fc *FaceCacheL2) GlyphAdvance(ru rune) (advance fixed.Int26_6, ok bool)
- func (fc *FaceCacheL2) GlyphBounds(ru rune) (bounds fixed.Rectangle26_6, advance fixed.Int26_6, ok bool)
- func (fc *FaceCacheL2) Kern(r0, r1 rune) fixed.Int26_6
- type FaceFallback
- func (ff *FaceFallback) Glyph(dot fixed.Point26_6, ru rune) (dr image.Rectangle, mask image.Image, maskp image.Point, advance fixed.Int26_6, ...)
- func (ff *FaceFallback) GlyphAdvance(ru rune) (advance fixed.Int26_6, ok bool)
- func (ff *FaceFallback) GlyphBounds(ru rune) (bounds fixed.Rectangle26_6, advance fixed.Int26_6, ok bool)
- func (ff *FaceFallback) Kern(r0, r1 rune) fixed.Int26_6
- type FaceOptions
- type FaceRunes
- func (fr *FaceRunes) Glyph(dot fixed.Point26_6, ru rune) (dr image.Rectangle, mask image.Image, maskp image.Point, advance fixed.Int26_6, ...)
- func (fr *FaceRunes) GlyphAdvance(ru rune) (advance fixed.Int26_6, ok bool)
- func (fr *FaceRunes) GlyphBounds(ru rune) (bounds fixed.Rectangle26_6, advance fixed.Int26_6, ok bool)
- type Font
- type FontFace
- type FontsManager
- func (fm *FontsManager) AddFallbackFont(f *Font)
- func (fm *FontsManager) Aliases(targetName string) []string
- func (fm *FontsManager) ClearFontsCache()
- func (fm *FontsManager) DefaultFont() *Font
- func (fm *FontsManager) DefaultFontFace() *FontFace
- func (fm *FontsManager) DefaultMonoFont() *Font
- func (fm *FontsManager) DefaultMonoFontFace() *FontFace
- func (fm *FontsManager) FallbackFonts() []*Font
- func (fm *FontsManager) Font(ttf []byte, srcName string) (*Font, error)
- func (fm *FontsManager) FontByName(name string) *Font
- func (fm *FontsManager) LoadedFonts() []*Font
- func (fm *FontsManager) RegisterAlias(alias, targetName string)
- type GlyphAdvanceCache
- type GlyphBoundsCache
- type GlyphCache
Constants ¶
This section is empty.
Variables ¶
View Source
var CarriageReturnRune = '␍' // C/R symbol: '␍'; old: '♪'
View Source
var DefaultFaceOptions = NewFaceOptions(12, 72)
View Source
var FontsMan = NewFontsManager()
View Source
var TabWidth = 8 // n times the space glyph
Functions ¶
func Fixed266ToFloat64 ¶
func Float32ToFixed266 ¶
func Float64ToFixed266 ¶
func NewFallbackFaces ¶ added in v1.3.13
func NewFallbackFaces(fallbackFont *Font, fopts FaceOptions) []font.Face
func Rect266MinFloorMaxCeil ¶
func Rect266MinFloorMaxCeil(r fixed.Rectangle26_6) image.Rectangle
Types ¶
type FaceCache ¶
func NewFaceCache ¶
func (*FaceCache) GlyphAdvance ¶
func (*FaceCache) GlyphBounds ¶
type FaceCacheL ¶
Same as FaceCache but with locks.
func NewFaceCacheL ¶
func NewFaceCacheL(face font.Face) *FaceCacheL
func (*FaceCacheL) GlyphAdvance ¶
func (fc *FaceCacheL) GlyphAdvance(ru rune) (advance fixed.Int26_6, ok bool)
func (*FaceCacheL) GlyphBounds ¶
func (fc *FaceCacheL) GlyphBounds(ru rune) (bounds fixed.Rectangle26_6, advance fixed.Int26_6, ok bool)
type FaceCacheL2 ¶
Same as FaceCacheL but with sync.map.
func NewFaceCacheL2 ¶
func NewFaceCacheL2(face font.Face) *FaceCacheL2
func (*FaceCacheL2) GlyphAdvance ¶
func (fc *FaceCacheL2) GlyphAdvance(ru rune) (advance fixed.Int26_6, ok bool)
func (*FaceCacheL2) GlyphBounds ¶
func (fc *FaceCacheL2) GlyphBounds(ru rune) (bounds fixed.Rectangle26_6, advance fixed.Int26_6, ok bool)
type FaceFallback ¶ added in v1.3.13
type FaceFallback struct {
font.Face
IsMono bool
MonoAdv fixed.Int26_6
// contains filtered or unexported fields
}
func NewFaceFallback ¶ added in v1.3.13
func (*FaceFallback) GlyphAdvance ¶ added in v1.3.13
func (ff *FaceFallback) GlyphAdvance(ru rune) (advance fixed.Int26_6, ok bool)
func (*FaceFallback) GlyphBounds ¶ added in v1.3.13
func (ff *FaceFallback) GlyphBounds(ru rune) (bounds fixed.Rectangle26_6, advance fixed.Int26_6, ok bool)
type FaceOptions ¶ added in v1.3.13
type FaceOptions struct {
// contains filtered or unexported fields
}
avoid zero value in size/dpi by forcing set funcs; use existing copies
func NewFaceOptions ¶ added in v1.3.13
func NewFaceOptions(size, dpi float64) FaceOptions
func (*FaceOptions) DPI ¶ added in v1.3.13
func (o *FaceOptions) DPI() float64
func (*FaceOptions) SetDPI ¶ added in v1.3.13
func (o *FaceOptions) SetDPI(v float64)
func (*FaceOptions) SetHinting ¶ added in v1.3.13
func (o *FaceOptions) SetHinting(h font.Hinting)
func (*FaceOptions) SetSize ¶ added in v1.3.13
func (o *FaceOptions) SetSize(v float64)
func (*FaceOptions) Size ¶ added in v1.3.13
func (o *FaceOptions) Size() float64
type FaceRunes ¶
Special runes face
func NewFaceRunes ¶
func (*FaceRunes) GlyphAdvance ¶
func (*FaceRunes) GlyphBounds ¶
type Font ¶
func (*Font) ClearFacesCache ¶
func (f *Font) ClearFacesCache()
func (*Font) FontFace ¶
func (f *Font) FontFace(fopts FaceOptions) *FontFace
type FontFace ¶
type FontFace struct {
Font *Font
Face font.Face
Opts FaceOptions // readonly, make copy and change
Metrics *font.Metrics
// contains filtered or unexported fields
}
func NewFontFace ¶
func NewFontFace(font *Font, fopts FaceOptions) *FontFace
func (*FontFace) AvgGlyphAdvance ¶ added in v1.3.13
func (*FontFace) LineHeight ¶
func (*FontFace) LineHeightFloat ¶
func (*FontFace) LineHeightInt ¶
func (*FontFace) TestIsMono ¶ added in v1.3.13
type FontsManager ¶
type FontsManager struct {
// contains filtered or unexported fields
}
func NewFontsManager ¶
func NewFontsManager() *FontsManager
func (*FontsManager) AddFallbackFont ¶ added in v1.3.13
func (fm *FontsManager) AddFallbackFont(f *Font)
func (*FontsManager) Aliases ¶ added in v1.3.13
func (fm *FontsManager) Aliases(targetName string) []string
func (*FontsManager) ClearFontsCache ¶
func (fm *FontsManager) ClearFontsCache()
func (*FontsManager) DefaultFont ¶ added in v1.3.13
func (fm *FontsManager) DefaultFont() *Font
func (*FontsManager) DefaultFontFace ¶ added in v1.3.13
func (fm *FontsManager) DefaultFontFace() *FontFace
func (*FontsManager) DefaultMonoFont ¶ added in v1.3.13
func (fm *FontsManager) DefaultMonoFont() *Font
func (*FontsManager) DefaultMonoFontFace ¶ added in v1.3.13
func (fm *FontsManager) DefaultMonoFontFace() *FontFace
func (*FontsManager) FallbackFonts ¶ added in v1.3.13
func (fm *FontsManager) FallbackFonts() []*Font
func (*FontsManager) FontByName ¶ added in v1.3.13
func (fm *FontsManager) FontByName(name string) *Font
func (*FontsManager) LoadedFonts ¶ added in v1.3.13
func (fm *FontsManager) LoadedFonts() []*Font
func (*FontsManager) RegisterAlias ¶ added in v1.3.13
func (fm *FontsManager) RegisterAlias(alias, targetName string)
type GlyphAdvanceCache ¶
type GlyphAdvanceCache struct {
// contains filtered or unexported fields
}
func NewGlyphAdvanceCache ¶
func NewGlyphAdvanceCache(face font.Face, ru rune) *GlyphAdvanceCache
type GlyphBoundsCache ¶
type GlyphBoundsCache struct {
// contains filtered or unexported fields
}
func NewGlyphBoundsCache ¶
func NewGlyphBoundsCache(face font.Face, ru rune) *GlyphBoundsCache
type GlyphCache ¶
type GlyphCache struct {
// contains filtered or unexported fields
}
func NewGlyphCache ¶
func NewGlyphCache(face font.Face, ru rune) *GlyphCache
Click to show internal directories.
Click to hide internal directories.