pifont

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package pifont provides functionality for rendering text using bitmap fonts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sheet

type Sheet struct {
	Chars   map[rune]pi.Sprite
	Height  int
	FgColor pi.Color // font color on sprites
	BgColor pi.Color // background color on sprites
}

Sheet is a character sheet used for rendering text.

func (Sheet) Print

func (s Sheet) Print(str string, x, y int) (currentX, currentY int)

Print draws text using the current draw color.

Returns the x, y position where you can continue writing text.

func (Sheet) PrintOriginal

func (s Sheet) PrintOriginal(str string, x, y int) (maxX, currentY int)

PrintOriginal prints the text using its original colors.

func (Sheet) PrintStroked

func (s Sheet) PrintStroked(text string, x, y int, fgColor, strokeColor pi.Color) (currentX, currentY int)

PrintStroked prints the text with a stroke effect.

The text is drawn using the specified foreground and stroke colors.

func (Sheet) Size

func (s Sheet) Size(text string) (width, height int)

Size returns the dimensions of the text without rendering it to the draw target.

Jump to

Keyboard shortcuts

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