FIGlet ASCII Text Generator PET Package

Moderator: Forum moderators

Post Reply
User avatar
rockedge
Site Admin
Posts: 7021
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 3147 times
Been thanked: 2933 times
Contact:

FIGlet ASCII Text Generator PET Package

Post by rockedge »

Here is a PET package of FIGlet, a utility that generates large ASCII text

FIGlet prints its input using large characters (called ``FIGcharac-
ters'')made up of ordinary screen characters (called ``sub-charac-
ters''). FIGlet output is generally reminiscent of the sort of ``sig-
natures'' many people like to put at the end of e-mail and UseNet mes-
sages. It is also reminiscent of the output of some banner programs,
although it is oriented normally, not sideways.

FIGlet can print in a variety of fonts, both left-to-right and right-
to-left, with adjacent FIGcharacters kerned and ``smushed'' together in
various ways. FIGlet fonts are stored in separate files, which can be
identified by the suffix ``.flf''. Most FIGlet font files will be
stored in FIGlet's default font directory.

FIGlet can also use ``control files'', which tell it to map certain
input characters to certain other characters, similar to the Unix tr
command. Control files can be identified by the suffix ``.flc''. Most
FIGlet control files will be stored in FIGlet's default font directory.

You can store FIGlet fonts and control files in compressed form. See
COMPRESSED FONTS.

The figlet-2.2.5_1.pet package download -> https://mega.nz/file/Popw3DIA#ugk-N1QHz ... ihNxXq1dUY

Screenshot_2024-09-25_10-37-45.jpg
Screenshot_2024-09-25_10-37-45.jpg (20.64 KiB) Viewed 1003 times

[/b]

User avatar
greengeek
Posts: 1549
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 651 times
Been thanked: 228 times

Re: FIGlet ASCII Text Generator PET Package

Post by greengeek »

Thanks! Nice bit of fun.

fun.jpg
fun.jpg (10.32 KiB) Viewed 759 times

Any idea what [ -cklnoprstvxDELNRSWX ] and [ -m smushmode ] do??

help.jpg
help.jpg (16.91 KiB) Viewed 759 times

Thought I might be able to transfer the text to a post - but probably depends on font selection.
(Works fine transferring to Leafpad - but not totally successful to a browser):
_____ _____ _ _ _
| ___| _ _ __ |_ _| |__ __ _ _ __ | | _____| |
| |_ | | | | '_ \ | | | '_ \ / _` | '_ \| |/ / __| |
| _|| |_| | | | | | | | | | | (_| | | | | <\__ \_|
|_| \__,_|_| |_| |_| |_| |_|\__,_|_| |_|_|\_\___(_)

User avatar
rockedge
Site Admin
Posts: 7021
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 3147 times
Been thanked: 2933 times
Contact:

Re: FIGlet ASCII Text Generator PET Package

Post by rockedge »

greengeek wrote:

Any idea what [ -cklnoprstvxDELNRSWX ] and [ -m smushmode ] do??

the first one is just all the available options on one line. The smush mode is explained better below!

Linux manual page -> https://linux.die.net/man/6/figlet

Smush modes are integer bitfields that define how characters are handled in FIGlet font files:

Character for non-smushable blanks
The next character in the file indicates which character will be used to replace non-smushable blanks. For example, the character $ is often used for this purpose, but it won't work if the letters include $s.
Default smushmode
This is the default smushmode for the font, similar to the -m flag in figlet.
Display direction
A value of 0 indicates left-to-right display, while 1 indicates right-to-left display.

Other information in a FIGlet font file includes:

The height of a letter, not including descenders
The width of the widest letter in the font
The total number of comment lines
Comments, which appear after the header and before the first letter definition
The letters

FIGlet fonts are stored in separate files with the suffix .flf. The default font directory for FIGlet is /usr/games/lib/figlet.

Code: Select all

Commonly-used options are -f, -c, -k, -t, -p and -v.

-f fontfile
    Select the font. The .flf suffix may be left off of fontfile, in which case FIGlet automatically appends it. FIGlet looks for the file first in the default font directory and then in the current directory, or, if fontfile was given as a full pathname, in the given directory. If the -f option is not specified, FIGlet uses the font that was specified when it was compiled. To find out which font this is, use the -I3 option. 
-d fontdirectory
    Change the default font directory. FIGlet looks for fonts first in the default directory and then in the current directory. If the -d option is not specified, FIGlet uses the directory that was specified when it was compiled. To find out which directory this is, use the -I2 option. 
-c

-l

-r

-x

These options handle the justification of FIGlet output. -c centers the output horizontally. -l makes the output flush-left. -r makes it flush-right. -x (default) sets the justification according to whether left-to-right or right-to-left text is selected. Left-to-right text will be flush-left, while right-to-left text will be flush-right. (Left-to-right versus right-to-left text is controlled by -L, -R and -X.)

-t
-w outputwidth
    These options control the outputwidth, or the screen width FIGlet assumes when formatting its output. FIGlet uses the outputwidth to determine when to break lines and how to center the output. Normally, FIGlet assumes 80 columns so that people with wide terminals won't annoy the people they e-mail FIGlet output to. -t sets the outputwidth to the terminal width. If the terminal width cannot be determined, the previous outputwidth is retained. -w sets the outputwidth to the given integer. An outputwidth of 1 is a special value that tells FIGlet to print each non-space FIGcharacter, in its entirety, on a separate line, no matter how wide it is. 
-p

-n

These options control how FIGlet handles newlines. -p puts FIGlet into ''paragraph mode'', which eliminates some unnecessary line breaks when piping a multi-line file through FIGlet. In paragraph mode, FIGlet treats line breaks within a paragraph as if they were merely blanks between words. (Specifically, -p causes FIGlet to convert any newline which is not preceded by a newline and not followed by a space character into a blank.) -n (default) puts FIGlet back to normal, in which every newline FIGlet reads causes it to produce a line break.

-D

-E

-D switches to the German (ISO 646-DE) character set. Turns '[', '\' and ']' into umlauted A, O and U, respectively. '{', '|' and '}' turn into the respective lower case versions of these. '~' turns into s-z. -E turns off -D processing. These options are deprecated, which means they probably will not appear in the next version of FIGlet.
-C controlfile
-N

These options deal with FIGlet controlfiles. A controlfile is a file containing a list of commands that FIGlet executes each time it reads a character. These commands can map certain input characters to other characters, similar to the Unix tr command or the FIGlet -D option. FIGlet maintains a list of controlfiles, which is empty when FIGlet starts up. -C adds the given controlfile to the list. -N clears the controlfile list, cancelling the effect of any previous -C. FIGlet executes the commands in all controlfiles in the list. See the file figfont.txt, provided with FIGlet, for details on how to write a controlfile.

-s

-S

-k

-W

-o

These options control how FIGlet spaces the FIGcharacters that it outputs. -s (default) and -S cause ''smushing''. The FIGcharacters are displayed as close together as possible, and overlapping sub-characters are removed. Exactly which sub-characters count as ''overlapping'' depends on the font's layoutmode, which is defined by the font's author. -k causes ''kerning''. As many blanks as possible are removed between FIGcharacters, so that they touch, but the FIGcharacters are not smushed. -W makes FIGlet display all FIGcharacters at their full width, which may be fixed or variable, depending on the font.
The difference between -s and -S is that -s will not smush a font whose author specified kerning or full width as the default layoutmode, whereas -S will attempt to do so.

If there is no information in the font about how to smush, or if the -o option is specified, then the FIGcharacters are ''overlapped''. This means that after kerning, the first subcharacter of each FIGcharacter is removed. (This is not done if a FIGcharacter contains only one subcharacter.)
-m layoutmode
    Specifies an explicit layoutmode between 1 and 63. Smushmodes are explained in figfont.txt, which also provides complete information on the format of a FIGlet font. For the sake of backward compatibility with versions of FIGlet before 2.2, -m0 is equivalent to -k, -m-1 is equivalent to -W, and -m-2 is equivalent to -s. The -m switch is normally used only by font designers testing the various layoutmodes with a new font. 
-v
-I infocode
    These options print various information about FIGlet, then exit. If several of these options are given on the command line, only the last is executed, and only after all other command-line options have been dealt with.

    -v prints version and copyright information, as well as a ''Usage: ...'' line. -I prints the information corresponding to the given infocode in a consistent, reliable (i.e., guaranteed to be the same in future releases) format. -I is primarily intended to be used by programs that use FIGlet. infocode can be any of the following. 
    -1 Normal operation (default). 

This infocode indicates that FIGlet should operate normally, not giving any informational printout, printing its input in the selected font.

    0 Version and copyright. 

This is identical to -v.

    1 Version (integer). 

This will print the version of your copy of FIGlet as a decimal integer. The main version number is multiplied by 10000, the sub-version number is multiplied by 100, and the sub-sub-version number is multiplied by 1. These are added together, and the result is printed out. For example, FIGlet 2.2 will print ''20200'' , version 2.2.1 will print ''20201''. Similarly, version 3.7.2 would print ''30702''. These numbers are guaranteed to be ascending, with later versions having higher numbers. Note that the first major release of FIGlet, version 2.0, did not have the -I option.

    2 Default font directory. 

This will print the default font directory. It is affected by the -d option.

    3 Font. 

This will print the name of the font FIGlet would use. It is affected by the -f option. This is not a filename; the ''.flf'' suffix is not printed.

    4 Output width. 

This will print the value FIGlet would use for outputwidth, the number of columns wide FIGlet assumes the screen is. It is affected by the -w and -t options.

    5 Supported font formats. 

This will list font formats supported by FIGlet . Possible formats are ''flf2'' for FIGfont Version 2 .flf files and ''tlf2'' for TOIlet .tlf files.

    If infocode is any other positive value, FIGlet will simply exit without printing anything. 
-L

-R

-X

These options control whether FIGlet prints left-to-right or right-to-left. -L selects left-to-right printing. -R selects right-to-left printing. -X (default) makes FIGlet use whichever is specified in the font file.
Once the options are read, if there are any remaining words on the command line, they are used instead of standard input as the source of text. This feature allows shell scripts to generate large letters without having to dummy up standard input files.

An empty argument, obtained by two sequential quotes, results in a line break.
User avatar
Sofiya
Posts: 2470
Joined: Tue Dec 07, 2021 9:49 pm
Has thanked: 1531 times
Been thanked: 1687 times

Re: FIGlet ASCII Text Generator PET Package

Post by Sofiya »

Code: Select all

                    __            __         
   _________  _____/ /_____  ____/ /___ ____ 
  / ___/ __ \/ ___/ //_/ _ \/ __  / __ `/ _ \
 / /  / /_/ / /__/ ,< /  __/ /_/ / /_/ /  __/
/_/   \____/\___/_/|_|\___/\__,_/\__, /\___/ 
                                /____/       
  ________                __        __
 /_  __/ /_  ____ _____  / /_______/ /
  / / / __ \/ __ `/ __ \/ //_/ ___/ / 
 / / / / / / /_/ / / / / ,< (__  )_/  
/_/ /_/ /_/\__,_/_/ /_/_/|_/____(_)   
                                      

Code: Select all

                _            _              _____ _                 _        _ 
 _ __ ___   ___| | _____  __| | __ _  ___  |_   _| |__   __ _ _ __ | | _____| |
| '__/ _ \ / __| |/ / _ \/ _` |/ _` |/ _ \   | | | '_ \ / _` | '_ \| |/ / __| |
| | | (_) | (__|   <  __/ (_| | (_| |  __/   | | | | | | (_| | | | |   <\__ \_|
|_|  \___/ \___|_|\_\___|\__,_|\__, |\___|   |_| |_| |_|\__,_|_| |_|_|\_\___(_)
                               |___/                                           
Attachments
2024-12-17_16-49.png
2024-12-17_16-49.png (56.78 KiB) Viewed 734 times
2024-12-17_16-41.png
2024-12-17_16-41.png (184.61 KiB) Viewed 738 times
Last edited by Sofiya on Tue Dec 17, 2024 1:52 pm, edited 2 times in total.

KL-Linux https://sofijacom.github.io
KL LINUX Simple fast free

User avatar
rockedge
Site Admin
Posts: 7021
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 3147 times
Been thanked: 2933 times
Contact:

Re: FIGlet ASCII Text Generator PET Package

Post by rockedge »

@Sofiya Thank you ! Now I know how to display the ASCII text correctly on the forum!

Code: Select all

 ___                               _        _     _            _    _ 
|_ _|_ __     __ _    ___ ___   __| | ___  | |__ | | ___   ___| | _| |
 | || '_ \   / _` |  / __/ _ \ / _` |/ _ \ | '_ \| |/ _ \ / __| |/ / |
 | || | | | | (_| | | (_| (_) | (_| |  __/ | |_) | | (_) | (__|   <|_|
|___|_| |_|  \__,_|  \___\___/ \__,_|\___| |_.__/|_|\___/ \___|_|\_(_)

                                                                                                                                 
User avatar
bigpup
Moderator
Posts: 7512
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 1021 times
Been thanked: 1682 times

Re: FIGlet ASCII Text Generator PET Package

Post by bigpup »

Why not attach the pet to the first post, so it can be a direct download from the forum.

Thanks for this!

The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
greengeek
Posts: 1549
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 651 times
Been thanked: 228 times

Re: FIGlet ASCII Text Generator PET Package

Post by greengeek »

greengeek wrote: Tue Dec 17, 2024 7:42 am

Thought I might be able to transfer the text to a post - but probably depends on font selection.
(Works fine transferring to Leafpad - but not totally successful to a browser):
_____ _____ _ _ _
| ___| _ _ __ |_ _| |__ __ _ _ __ | | _____| |
| |_ | | | | '_ \ | | | '_ \ / _` | '_ \| |/ / __| |
| _|| |_| | | | | | | | | | | (_| | | | | <\__ \_|
|_| \__,_|_| |_| |_| |_| |_|\__,_|_| |_|_|\_\___(_)

Let me try the code block as rockedge suggested:

Code: Select all

 _____              _____ _                 _        _ 
|  ___|   _ _ __   |_   _| |__   __ _ _ __ | | _____| |
| |_ | | | | '_ \    | | | '_ \ / _` | '_ \| |/ / __| |
|  _|| |_| | | | |   | | | | | | (_| | | | |   <\__ \_|
|_|   \__,_|_| |_|   |_| |_| |_|\__,_|_| |_|_|\_\___(_)

Ahhh yes.That does work.

vektor_alian
Posts: 77
Joined: Thu Apr 01, 2021 12:36 am
Been thanked: 24 times

Re: FIGlet ASCII Text Generator PET Package

Post by vektor_alian »

Figlet is also used in AsciiFlow

https://asciiflow.com/#/

which also runs from a local folder when saved as a complete web page.

Easy and fun.

Vektor

Post Reply

Return to “Graphics”