psf

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2017 License: Apache-2.0 Imports: 10 Imported by: 1

README

PSF consolefont loader

This library is incomplete and needs to be refactored. It needs to be modified to conform to the interface font.Face in golang.org/x/image/font.

Please refer to GoDoc.

Documentation

Overview

Package psf loads PSF bitmap fonts as installed via consolefonts on Debian derived linux distributions.

They can be used to draw on a image.Image.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enumerate

func Enumerate() ([]string, error)

Enumerate returns the font families accessible.

Types

type Font

type Font struct {
	Version int
	H       int
	W       int
	Letters map[rune][]byte
}

Font is a rasterized font to be used on low resolution display.

func Load

func Load(name string) (*Font, error)

Load loads a font from Debian provided consolefonts.

Call Enumerate to enumerate the font families available.

func (*Font) Draw

func (f *Font) Draw(dst draw.Image, x, y int, fore, back color.Color, text string) (int, int)

Draw draws text on an image.

Use nil as the color to use a transparent foreground or background.

Returns the end point.

Directories

Path Synopsis
cmd
psf
psf prints out available font family and runs supported.
psf prints out available font family and runs supported.

Jump to

Keyboard shortcuts

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