Figlet.Parser.FileParser (figlet v0.1.0) View Source

This module parses figlet files. How the files are read (e.g. in whole or streamed) is considered an implementation detail: the input to the function here is just the path to the file.

A FIGlet file has 3 main parts:

  • Headerline
  • Comments
  • Character Data

FIGcharacter Data

The FIGcharacter data begins on the next line after the comments and continues to the end of the file.

Basic Data Structure

The sub-characters in the file are given exactly as they should be output, with two exceptions:

  1. Hardblanks should be the hardblank character specified in the header line, not a blank (space).
  2. Every line has one or two endmark characters, whose column locations define the width of each FIGcharacter.

In most FIGfonts, the endmark character is either "@" or "#". The FIGdriver will eliminate the last block of consecutive equal characters from each line of sub-characters when the font is read in. By convention, the last line of a FIGcharacter has two endmarks, while all the rest have one. This makes it easy to see where FIGcharacters begin and end. No line should have more than two endmarks.

See Also

Building a parser for Figlet files would be practically impossible without a useful spec for reference. Relevant links for the Figlet font file spec:

Link to this section Summary

Functions

Parses the Figlet font file at the given filepath, returning a %Figlet.Font{} struct.

Link to this section Functions

Link to this function

parse(filepath, opts \\ [])

View Source

Parses the Figlet font file at the given filepath, returning a %Figlet.Font{} struct.

Given: flf2a 4 3 8 15 11 0 10127

The 6th character (after the a) is a unicode value for "hardBlank"

All FIGlet fonts must contain chars 32-126, 196, 214, 220, 228, 246, 252, 223