Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  TEXT::FIGLET::FONT (3)

.ds Aq ’


Text::FIGlet::Font - font engine for Text::FIGlet



  use Text::FIGlet;

  my $font = Text::FIGlet->new(-f=>"doh");

  print ~~$font->figify(-A=>"Hello World");


<B>Text::FIGlet::FontB> reproduces its input as large glyphs made up of other characters; usually ASCII, but not necessarily. The output is similar to that of many banner programs—although it is not oriented sideways—and reminiscent of the sort of signatures many people like to put at the end of e-mail and UseNet messages.

<B>Text::FIGlet::FontB> can print in a variety of fonts, both left-to-right and right-to-left, with adjacent glyphs 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 /usr/local/share/figlet. Support for TOIlet fonts .tlf, which are typically in the same location, has also been added.

This implementation is known to work with perl 5.005, 5.6 and 5.8, including support for Unicode (UTF-8) in all three. See CAVEATS for details.



<B>-d=>B>fontdir Whence to load files.

Defaults to /usr/local/share/figlet

<B>-D=>B>boolean <B>-DB> 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.

This option is deprecated, which means it may soon be removed from <B>Text::FIGlet::FontB>. The modern way to achieve this effect is with Text::FIGlet::Control.

<B>-U=>B>boolean A true value, the default, is necessary to load Unicode font data; regardless of your version of perl

<B>Note that you must explicitly specify B>1<B> if you are mapping in negative characters with a control fileB>. See CAVEATS for more details.

<B>-f=>B>fontfile The font to load; defaults to standard.

The fontfile may be zipped if IO::Uncompress::Unzip is available. A compressed font should contain only the font itself, and the archive should be renamed with the <B>flfB> extension.

<B>-m=>B>layoutmode Specifies how <B>Text::FIGlet::FontB> should smush and kern consecutive glyphs together. This parameter is optional, and if not specified the layoutmode defined by the font author is used. Acceptable values are -3 through 63, where positive values are created by adding together the corresponding numbers for each desired smush type.

  Value  Width  Old CLI  Description
   -3     +++            monospace
   -1      ++   -W       full width
    0       +   -k       kern
  undef     -   -o       overlap/universal smush

    1       -   -S -m1   smush equal characters
    2       -   -S -m2   smush underscores
    4       -   -S -m4   smush hierarchy
    8       -   -S -m8   smush opposite pairs
   16       -   -S -m16  smush big X
   32       -   -S -m32  smush hardblanks

   Old CLI is the figlet(6) equivalent option.
   Monospace is also available via the previous value of -0.

-3, Monospace This will pad each glyph in the font such that they are all the same width. The padding is done such that the glyph is centered in it’s box, and any odd padding is on the trailing edge.
/ ___| ___ __ __
| | / _ \ \ \ /\ / /
| |___ | (_) | \ V V /
\____| \___/ \_/\_/

  |-----------+-----------+-----------| -- equal-sized boxes

-1, Full width No smushing or kerning, glyphs are simply concatenated together.
/ ___| ___ __ __
| | / _ \ \ \ /\ / /
| |___ | (_) | \ V V /
\____| \___/ \_/\_/
0, Kern Kern only i.e; glyphs are pushed together until they touch.
/ ___| ___ __ __
| | / _ \\ \ /\ / /
| |___| (_) |\ V V /
\____|\___/ \_/\_/
undef, Universal smush Glyphs are kerned, then shifted so that they overlap by column of characters:
/ ___|_____ __
| | / _ \ \ /\ / /
| |__| (_) \ V V /
\____\___/ \_/\_/

Other smush modes are not yet implemented, and therefore fall back to universal.


Returns a a string or list of lines, depending on context.
<B>-A=>B>text The text to transmogrify.
<B>-U=>B>boolean Process input as Unicode (UTF-8).

<B>Note that this applies regardless of your version of perlB>, and is necessary if you are mapping in negative characters with a control file.

<B>-X=>B>[LR] 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. The default is to use whatever is specified in the font file.
<B>-x=>B>[lrc] These options handle the justification of <B>Text::FIGlet::FontB> output. c centers the output horizontally. l makes the output flush-left. r makes it flush-right. The 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-rigt versus right-to-left text is controlled by <B>-XB>.)
<B>-m=>B>layoutmode Although -<B>-mB> is best thought of as a font instantiation option, it is possible to switch between layout modes greater than zero at figification time. Your mileage may vary.
<B>-w=>B>outputwidth The output width, output text is wrapped to this value by breaking the input on whitspace where possible. There are two special width values

 -1 the text is not wrapped.
  1 the text is wrapped after every character; most useful with -m=>-3

Defaults to 80


<B>Text::FIGlet::FontB> will make use of these environment variables if present
FIGFONT The default font to load. If undefined the default is standard.flf. It should reside in the directory specified by FIGLIB.
FIGLIB The default location of fonts. If undefined the default is /usr/local/share/figlet


FIGlet font files are available at


Text::FIGlet, figlet(6)


$/ is used to create the output string in scalar context Consequently, make sure it is set appropriately i.e.; Don’t mess with it, <B>perlB> sets it correctly for you.
<B>-m=B>>’-0’ This mode is peculiar to <B>Text::FIGletB>, and as such, results will vary amongst fonts.
Support for pre-5.6 perl This codebase was originally developed to be compatible with 5.005.03, and has recently been manually checked against 5.005.05. Unfortunately, the default test suite makes use of code that is not compatable with versions of perl prior to 5.6. t/ attempts to work around this to provide some basic testing of functionality.
Support for TOIlet fonts Although the FIGlet font specification is not clear on the matter, convention dictates that there be no trailing whitespace after the end of line marker. Unfortunately some auto-generated TOIlet fonts break with this convention, while also lacking critical hardspaces. To fix these fonts, unzip then run perl -pi~ -e s/@ $/$\@/ on them.


Pre-5.8 Perl 5.6 Unicode support was notoriously sketchy. Best efforts have been made to work around this, and things should work fine. If you have problems, favor "\x{...}" over chr. See also NOTES in Text::FIGlet
Pre-5.6 Text::FIGlet <B>doesB> provide limited support for Unicode in perl 5.005. It understands literal Unicode characters (UTF-8 sequences), and will emit the correct output if the loaded font supports it. It does not support negative character mapping at this time. See also NOTES in Text::FIGlet
Negative character codes There is limited support for negative character codes, at this time only characters -2 through -65_535 are supported.


The standard font is 4Mb with no optimizations.

Listed below are increasingly severe means of reducing memory use when creating an object.
<B>-U=>-1B> This loads Unicode fonts, but skips negative characters. It’s the default.

The standard font is 68kb with this optimization.

<B>-U=>0B> This only loads ASCII characters; plus the Deutsch characters if -D is true.

The standard font is 14kb with this optimization.


Jerrad Pierce

                **                                    />>
     _         //                         _  _  _    / >>>
    (_)         **  ,adPPYba,  >< ><<<  _(_)(_)(_)  /   >>>
    | |        /** a8P_____88   ><<    (_)         >>    >>>
    | |  |~~\  /** 8PP"""""""   ><<    (_)         >>>>>>>>
   _/ |  |__/  /** "8b,   ,aa   ><<    (_)_  _  _  >>>>>>>
  |__/   |     /**  `"Ybbd8"  ><<<      (_)(_)(_) >> 
               //                                  >>>>    /

Search for    or go to Top of page |  Section 3 |  Main Index

perl v5.20.3 TEXT::FIGLET::FONT (3) 2016-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.