textfonts

package
v0.0.0-...-0c3cbb8 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package textfonts maps ASCII characters to stylized Unicode variants (cursive, bubble, leet, flipped, cursed). Call Load once at startup with the embed.FS from the parent package, then call Convert from anywhere to transform a string under a named group.

Some characters in the source dataset map to multiple stylized variants; Convert picks one uniformly at random per character, so repeated calls with the same input may differ. Characters with no mapping are passed through unchanged.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(text, group string) string

Convert returns text with each character substituted according to the group's mapping. Characters with no mapping in the group, and all characters when the group is unknown, are passed through unchanged. Characters that map to multiple variants get a uniformly-random pick per call.

func Groups

func Groups() []string

Groups returns the loaded font group names sorted alphabetically. Returns nil if Load has not been called.

func Load

func Load(fsys fs.FS) error

Load reads datasets/text_fonts.json from fsys into memory. Call once at startup. After Load returns nil, Convert and Groups are safe for concurrent use.

Types

This section is empty.

Jump to

Keyboard shortcuts

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