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 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 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
- type GlyphAdvanceCache
- type GlyphBoundsCache
- type GlyphCache
Constants ¶
This section is empty.
Variables ¶
View Source
var CarriageReturnRune = '♪'
View Source
var DPI float64 // default: github.com/golang/freetype/truetype/face.go:31:3
View Source
var FontsMan = NewFontsManager()
View Source
var NullRune = '◦'
View Source
var TabWidth = 8 // n times the space glyph
Functions ¶
func Fixed266ToFloat64 ¶
func Float32ToFixed266 ¶
func Float64ToFixed266 ¶
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 FaceRunes ¶
Special runes face
func NewFaceRunes ¶
func (*FaceRunes) GlyphAdvance ¶
func (*FaceRunes) GlyphBounds ¶
type Font ¶
func DefaultFont ¶
func DefaultFont() *Font
func (*Font) ClearFacesCache ¶
func (f *Font) ClearFacesCache()
type FontFace ¶
type FontFace struct { Font *Font Face font.Face Size float64 // in points, readonly Metrics *font.Metrics // contains filtered or unexported fields }
func DefaultFontFace ¶
func DefaultFontFace() *FontFace
func (*FontFace) LineHeight ¶
func (*FontFace) LineHeightFloat ¶
func (*FontFace) LineHeightInt ¶
type FontsManager ¶
type FontsManager struct {
// contains filtered or unexported fields
}
func NewFontsManager ¶
func NewFontsManager() *FontsManager
func (*FontsManager) ClearFontsCache ¶
func (fm *FontsManager) ClearFontsCache()
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.