fontutil

package
v2.0.5-alpha.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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 Fixed266ToFloat64(v fixed.Int26_6) float64

func Float32ToFixed266

func Float32ToFixed266(v float32) fixed.Int26_6

func Float64ToFixed266

func Float64ToFixed266(v float64) fixed.Int26_6

func NewKernCache

func NewKernCache(face font.Face, r0, r1 rune) fixed.Int26_6

func Rect266MinFloorMaxCeil

func Rect266MinFloorMaxCeil(r fixed.Rectangle26_6) image.Rectangle

Types

type FaceCache

type FaceCache struct {
	font.Face
	// contains filtered or unexported fields
}

func NewFaceCache

func NewFaceCache(face font.Face) *FaceCache

func (*FaceCache) Glyph

func (fc *FaceCache) Glyph(dot fixed.Point26_6, ru rune) (
	dr image.Rectangle,
	mask image.Image,
	maskp image.Point,
	advance fixed.Int26_6,
	ok bool,
)

func (*FaceCache) GlyphAdvance

func (fc *FaceCache) GlyphAdvance(ru rune) (advance fixed.Int26_6, ok bool)

func (*FaceCache) GlyphBounds

func (fc *FaceCache) GlyphBounds(ru rune) (bounds fixed.Rectangle26_6, advance fixed.Int26_6, ok bool)

func (*FaceCache) Kern

func (fc *FaceCache) Kern(r0, r1 rune) fixed.Int26_6

type FaceCacheL

type FaceCacheL struct {
	font.Face
	// contains filtered or unexported fields
}

Same as FaceCache but with locks.

func NewFaceCacheL

func NewFaceCacheL(face font.Face) *FaceCacheL

func (*FaceCacheL) Glyph

func (fc *FaceCacheL) Glyph(dot fixed.Point26_6, ru rune) (
	dr image.Rectangle,
	mask image.Image,
	maskp image.Point,
	advance fixed.Int26_6,
	ok bool,
)

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)

func (*FaceCacheL) Kern

func (fc *FaceCacheL) Kern(r0, r1 rune) fixed.Int26_6

type FaceCacheL2

type FaceCacheL2 struct {
	font.Face
	// contains filtered or unexported fields
}

Same as FaceCacheL but with sync.map.

func NewFaceCacheL2

func NewFaceCacheL2(face font.Face) *FaceCacheL2

func (*FaceCacheL2) Glyph

func (fc *FaceCacheL2) Glyph(dot fixed.Point26_6, ru rune) (
	dr image.Rectangle,
	mask image.Image,
	maskp image.Point,
	advance fixed.Int26_6,
	ok bool,
)

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)

func (*FaceCacheL2) Kern

func (fc *FaceCacheL2) Kern(r0, r1 rune) fixed.Int26_6

type FaceRunes

type FaceRunes struct {
	font.Face
}

Special runes face

func NewFaceRunes

func NewFaceRunes(face font.Face) *FaceRunes

func (*FaceRunes) Glyph

func (fr *FaceRunes) Glyph(dot fixed.Point26_6, ru rune) (
	dr image.Rectangle,
	mask image.Image,
	maskp image.Point,
	advance fixed.Int26_6,
	ok bool,
)

func (*FaceRunes) GlyphAdvance

func (fr *FaceRunes) GlyphAdvance(ru rune) (advance fixed.Int26_6, ok bool)

func (*FaceRunes) GlyphBounds

func (fr *FaceRunes) GlyphBounds(ru rune) (bounds fixed.Rectangle26_6, advance fixed.Int26_6, ok bool)

type Font

type Font struct {
	Font *truetype.Font
	// contains filtered or unexported fields
}

func DefaultFont

func DefaultFont() *Font

func NewFont

func NewFont(ttf []byte) (*Font, error)

func (*Font) ClearFacesCache

func (f *Font) ClearFacesCache()

func (*Font) FontFace

func (f *Font) FontFace(opt truetype.Options) *FontFace

func (*Font) FontFace2

func (f *Font) FontFace2(size float64) *FontFace

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 NewFontFace

func NewFontFace(font *Font, opt truetype.Options) *FontFace

func (*FontFace) BaseLine

func (ff *FontFace) BaseLine() fixed.Point26_6

func (*FontFace) LineHeight

func (ff *FontFace) LineHeight() fixed.Int26_6

func (*FontFace) LineHeightFloat

func (ff *FontFace) LineHeightFloat() float64

func (*FontFace) LineHeightInt

func (ff *FontFace) LineHeightInt() int

type FontsManager

type FontsManager struct {
	// contains filtered or unexported fields
}

func NewFontsManager

func NewFontsManager() *FontsManager

func (*FontsManager) ClearFontsCache

func (fm *FontsManager) ClearFontsCache()

func (*FontsManager) Font

func (fm *FontsManager) Font(ttf []byte) (*Font, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL