noxfont

package
v0.0.0-...-63dc931 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultName = "default"
	LargeName   = "large"
	SmallName   = "small"
	NumbersName = "numbers"
)
View Source
const (
	DefaultFile = "default"
	LargeFile   = "large"
	SmallFile   = "small"
	NumbersFile = "number"
)
View Source
const (
	Ext = ".fnt"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitmap

type Bitmap struct {
	Pix    []byte
	Stride int
	Rect   image.Rectangle
}

func (*Bitmap) At

func (p *Bitmap) At(x, y int) color.Color

func (*Bitmap) BitOffsets

func (p *Bitmap) BitOffsets(x, y int) (int, int)

func (*Bitmap) Bounds

func (p *Bitmap) Bounds() image.Rectangle

func (*Bitmap) ColorModel

func (*Bitmap) ColorModel() color.Model

func (*Bitmap) Set

func (p *Bitmap) Set(x, y int, c color.Color)

func (*Bitmap) SetAlpha

func (p *Bitmap) SetAlpha(x, y int, c color.Alpha)

func (*Bitmap) SetGray

func (p *Bitmap) SetGray(x, y int, c color.Gray)

type Font

type Font struct {
	Field0 uint32
	Field1 uint32
	Inline bool
	Ranges []Range
	CP1251 bool // this font is encoded for CP-1251 instead of UTF-16
}

func Decode

func Decode(r io.Reader) (*Font, error)

func (*Font) Char16

func (f *Font) Char16(c uint16) *Bitmap

func (*Font) Close

func (f *Font) Close() error

func (*Font) Encode

func (f *Font) Encode() ([]byte, error)

func (*Font) Glyph

func (f *Font) Glyph(dot fixed.Point26_6, r rune) (dr image.Rectangle, mask image.Image, maskp image.Point, advance fixed.Int26_6, ok bool)

func (*Font) GlyphAdvance

func (f *Font) GlyphAdvance(r rune) (fixed.Int26_6, bool)

func (*Font) GlyphBounds

func (f *Font) GlyphBounds(r rune) (fixed.Rectangle26_6, fixed.Int26_6, bool)

func (*Font) Kern

func (f *Font) Kern(r0, r1 rune) fixed.Int26_6

func (*Font) Metrics

func (f *Font) Metrics() font.Metrics

func (*Font) RangeFor

func (f *Font) RangeFor(c uint16) *Range

func (*Font) Rune

func (f *Font) Rune(rn rune) *Bitmap

type Range

type Range struct {
	StartChar uint16
	EndChar   uint16
	Glyphs    []*Bitmap
}

Jump to

Keyboard shortcuts

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