txt2psf(1)

πŸ“¦
version 1.1.3 Β· 2 versions
, in nixpkgs unstable, ubuntu stonking

✨ txt2psf(1) ✨

okay so bestie, welcome to txt2psf, a lil tool from PSF Tools that's about to turn your cute lil text file into an actual font. no cap πŸ’–


🌸 NAME 🌸

txt2psf β€” compile a PC Screen Font file from a textual description

like, you write the font as text, and it compiles it into a real, actual .PSF font file. iconic behavior honestly πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

txt2psf [--psf1] [--psf2] [INPUTFILE [OUTPUTFILE]]

so you can pass an input file, an output file, both, or neither, and you can force a format if you're feeling opinionated πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

txt2psf converts an ASCII source file to a font in the .PSF format. that's the whole vibe. text goes in, font comes out, slay ✨


🌈 INPUT FILE FORMAT 🌈

okay so the source file is composed of a header, followed by a series of character definitions. the first line of the header must be "%PSF2" β€” like, mandatory, non-negotiable, periodt. then it's followed by these fields, each on a separate line, in any order you want, no rules bestie:

  • Version: nnn β€” file format version. currently this must be 0. no exceptions, she's strict 😀
  • Flags: nnn β€” this is 1 if the font should include a Unicode table, else 0. so basically yes/no but make it a number πŸ™ˆ
  • Length: nnn β€” the number of characters in this font. if it's too low, the extra characters will be ignored πŸ‘€ too high, and the extras will be left blank. so, get it right pls 😭
  • Width: nnn β€” the width of a character cell πŸ“
  • Height: nnn β€” the height of a character cell πŸ“

after the header, the character definitions follow. each character definition starts as a "%" on a line by itself. it is then followed by two fields, in any order:

  • Bitmap: bitmapdata β€” the bitmap is composed of width*height cells, each of which is either a '-' (zero) or a '#' (black). whitespace is ignored, so go ahead and format it pretty 🎨 the bitmap can be spread over several lines β€” the bitmaps created by psf2txt(1) are, for example. so there's precedent, bestie, you're valid 🫢
  • Unicode: unicodestring β€” this describes the Unicode characters this bitmap represents. it's formed "[single];[sing]e];...[sequence];[sequence];..." where single is a single hexadecimal number, and sequence is two or more hexadecimal numbers separated by + signs. so "[41];" is an example of a single character, and "[00B4+0065];" is an example of a sequence πŸ’« if the bitmap doesn't represent any Unicode characters this field may be blank or simply missing β€” she's chill like that πŸ’œ
ngl this format is a little picky, so double-check your "%" lines and your hex, bestie

πŸ’… OPTIONS πŸ’…

  • --psf1 β€” force the resulting file to be in PSF1 format. old school, retro, lowkey nostalgic 🌸
  • --psf2 β€” force the resulting file to be in PSF2 format. the modern girlie ✨

πŸ’€ BUGS πŸ’€

  • the file format is too rigid, and the parser (such as it is) is a quick hack. like, she admits it. not me being honest about my own crimes πŸ™ˆ
  • the "Length:" header should not be necessary; txt2psf should be able to calculate the file size itself. so yeah, that field is basically doing unpaid labor 😭

πŸ‘‘ SEE ALSO πŸ‘‘

psf2txt(1)

(the reverse queen. she goes the other way πŸ’–)


🧚 AUTHOR 🧚

John Elliott <seasip.webmaster@gmail.com>.


and that's the whole page bestie!! this one's from PSF Tools, Version 1.1.3, dated 28 April, 2026. go forth and make fonts, you absolute main character πŸŒŸπŸ’–πŸ¦‹

πŸ“¦ where this page comes from