textrat

package
v0.0.0-...-7707c45 Latest Latest
Warning

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

Go to latest
Published: May 4, 2018 License: BSD-3-Clause Imports: 9 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fint32ToFloat32

func Fint32ToFloat32(i fixed.Int26_6) float32

Types

type Font

type Font interface {
	Name() FontName
	Size() int
	SetSize(size int)
	Hint() font.Hinting
	SetHint(hint font.Hinting)
	//
	Text(ctx gorat.VectorDrawer, text string, point mgl32.Vec2, align gcore.Align)
	TextInRect(ctx gorat.VectorDrawer, text string, rect image.Rectangle, align gcore.Align)
	PathText(ctx gorat.VectorDrawer, text string, point mgl32.Vec2, align gcore.Align)
	PathTextInRect(ctx gorat.VectorDrawer, text string, rect image.Rectangle, align gcore.Align)
	MeasureText(text string) mgl32.Vec2
}

type FontName

type FontName struct {
	Family, Name string
	FullName     string
}

func (FontName) String

func (s FontName) String() string

type VectorFont

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

func NewVectorFont

func NewVectorFont(f *truetype.Font, size int, hint font.Hinting) *VectorFont

func (*VectorFont) Hint

func (s *VectorFont) Hint() font.Hinting

func (*VectorFont) MeasureHeight

func (s *VectorFont) MeasureHeight() float32

func (*VectorFont) MeasureText

func (s *VectorFont) MeasureText(text string) (res mgl32.Vec2)

func (*VectorFont) Name

func (s *VectorFont) Name() FontName

func (*VectorFont) PathText

func (s *VectorFont) PathText(ctx gorat.VectorDrawer, text string, point mgl32.Vec2, align gcore.Align)

func (*VectorFont) PathTextInRect

func (s *VectorFont) PathTextInRect(ctx gorat.VectorDrawer, text string, rect image.Rectangle, align gcore.Align)

func (*VectorFont) SetHint

func (s *VectorFont) SetHint(hint font.Hinting)

func (*VectorFont) SetSize

func (s *VectorFont) SetSize(size int)

func (*VectorFont) Size

func (s *VectorFont) Size() int

func (*VectorFont) Text

func (s *VectorFont) Text(ctx gorat.VectorDrawer, text string, point mgl32.Vec2, align gcore.Align)

func (*VectorFont) TextInRect

func (s *VectorFont) TextInRect(ctx gorat.VectorDrawer, text string, rect image.Rectangle, align gcore.Align)

Jump to

Keyboard shortcuts

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