View Source Figlet.Linebreaker (figlet v0.3.2)
This module contains the logic that determines where to put linebreaks when converting a charlist to a specific FIGlet font representation.
It relies on lists of integer codepoints (a.k.a. charlists) instead of utf8 encoded string binaries (a.k.a. strings) to bypass any encoding related confusion.
Summary
Functions
'this is a test' -> ['this', 'is', 'a', 'test'] String.split("this is a big-old test", ~r/ |-/) ["this", "is", "a", "big", "old", "test"] ["this", "is", "a", "big-", "old", "test"]
Any newlines included in the input charlist
will cause a hard break.
Functions
'this is a test' -> ['this', 'is', 'a', 'test'] String.split("this is a big-old test", ~r/ |-/) ["this", "is", "a", "big", "old", "test"] ["this", "is", "a", "big-", "old", "test"]
@spec split( charlist(), font :: Figlet.Font.t(), width :: integer(), opts :: keyword() ) :: {:ok, list()} | {:error, any()}
Any newlines included in the input charlist
will cause a hard break.
charlist
is a character list containing integer codepointsfont
a%Figlet.Font{}
structwidth
an integer representing the character width of the terminalopts
is a keyword list of options.
Options
:overflow
- :trim
, :break
Examples
iex> Figlet.Linebreaker.split('this is a test', font, 4)
['this', 'is a', 'test']