7

If I execute

banner ABC

I get:

   #    ######   #####
  # #   #     # #     #
 #   #  #     # #
#     # ######  #
####### #     # #
#     # #     # #     #
#     # ######   #####

and another program, figlet, has more elaborate fonts and mechanisms for joining adjacent characters, e.g.:

    _    ____   ____ 
   / \  | __ ) / ___|
  / _ \ |  _ \| |    
 / ___ \| |_) | |___ 
/_/   \_\____/ \____|

but what if I want to have each letter printed using just that letter, i.e.:

   A    BBBBBB   CCCCC
  A A   B     B C     C
 A   A  B     B C
A     A BBBBBB  C
AAAAAAA B     B C
A     A B     B C     C
A     A BBBBBB   CCCCC

or better yet, something more compact, like:

  A    BBBB   CCCC 
 A A   B   B C     
A   A  BBBB  C     
AAAAA  B   B C     
A   A  BBBB   CCCC 

? What's the simplest way to make that happen?

4 Answers 4

9

There are four optional fonts for figlet which use the single-ASCII-character letters themselves to draw larger versions of these letter: Either here (alphabet, letters and tanja) here (same) or here (letter):

alphabet

    b          AA  BBBB   CCC 
    b         A  A B   B C    
 aa bbb   ccc AAAA BBBB  C    
a a b  b c    A  A B   B C    
aaa bbb   ccc A  A BBBB   CCC 

letter

  A   BBBB   CCC    A   BBBB   CCC  
 A A  B   B C   C  A A  B   B C   C 
AAAAA BBBB  C     AAAAA BBBB  C     
A   A B   B C   C A   A B   B C   C 
A   A BBBB   CCC  A   A BBBB   CCC  

letters

        bb               AAA   BBBBB    CCCCC  
  aa aa bb        cccc  AAAAA  BB   B  CC    C 
 aa aaa bbbbbb  cc     AA   AA BBBBBB  CC      
aa  aaa bb   bb cc     AAAAAAA BB   BB CC    C 
 aaa aa bbbbbb   ccccc AA   AA BBBBBB   CCCCC

tanja

        b)                A)aa   B)bbbb     C)ccc  
        b)               A)  aa  B)   bb   C)   cc 
a)AAAA  b)BBBB   c)CCCC A)    aa B)bbbb   C)       
 a)AAA  b)   BB c)      A)aaaaaa B)   bb  C)       
a)   A  b)   BB c)      A)    aa B)    bb  C)   cc 
 a)AAAA b)BBBB   c)CCCC A)    aa B)bbbbb    C)ccc

And maybe doh

$ figlet -f doh abcABC
                 bbbbbbbb                                
                 b::::::b                                
                 b::::::b                                
                 b::::::b                                
                  b:::::b                                
  aaaaaaaaaaaaa   b:::::bbbbbbbbb        cccccccccccccccc
  a::::::::::::a  b::::::::::::::bb    cc:::::::::::::::c
  aaaaaaaaa:::::a b::::::::::::::::b  c:::::::::::::::::c
           a::::a b:::::bbbbb:::::::bc:::::::cccccc:::::c
    aaaaaaa:::::a b:::::b    b::::::bc::::::c     ccccccc
  aa::::::::::::a b:::::b     b:::::bc:::::c             
 a::::aaaa::::::a b:::::b     b:::::bc:::::c             
a::::a    a:::::a b:::::b     b:::::bc::::::c     ccccccc
a::::a    a:::::a b:::::bbbbbb::::::bc:::::::cccccc:::::c
a:::::aaaa::::::a b::::::::::::::::b  c:::::::::::::::::c
 a::::::::::aa:::ab:::::::::::::::b    cc:::::::::::::::c
  aaaaaaaaaa  aaaabbbbbbbbbbbbbbbb       cccccccccccccccc

               AAA               BBBBBBBBBBBBBBBBB           CCCCCCCCCCCCC
              A:::A              B::::::::::::::::B       CCC::::::::::::C
             A:::::A             B::::::BBBBBB:::::B    CC:::::::::::::::C
            A:::::::A            BB:::::B     B:::::B  C:::::CCCCCCCC::::C
           A:::::::::A             B::::B     B:::::B C:::::C       CCCCCC
          A:::::A:::::A            B::::B     B:::::BC:::::C              
         A:::::A A:::::A           B::::BBBBBB:::::B C:::::C              
        A:::::A   A:::::A          B:::::::::::::BB  C:::::C              
       A:::::A     A:::::A         B::::BBBBBB:::::B C:::::C              
      A:::::AAAAAAAAA:::::A        B::::B     B:::::BC:::::C              
     A:::::::::::::::::::::A       B::::B     B:::::BC:::::C              
    A:::::AAAAAAAAAAAAA:::::A      B::::B     B:::::B C:::::C       CCCCCC
   A:::::A             A:::::A   BB:::::BBBBBB::::::B  C:::::CCCCCCCC::::C
  A:::::A               A:::::A  B:::::::::::::::::B    CC:::::::::::::::C
 A:::::A                 A:::::A B::::::::::::::::B       CCC::::::::::::C
AAAAAAA                   AAAAAAABBBBBBBBBBBBBBBBB           CCCCCCCCCCCCC
9

Another option is to use the alphabet font with FIGlet:

$ wget http://www.figlet.org/fonts/alphabet.flf
$ figlet -f alphabet.flf ABC
 AA  BBBB   CCC 
A  A B   B C    
AAAA BBBB  C    
A  A B   B C    
A  A BBBB   CCC 
5

With toilet:

$ toilet -f letter ABC
  A   BBBB   CCC  
 A A  B   B C   C 
AAAAA BBBB  C     
A   A B   B C   C 
A   A BBBB   CCC  

That letter font is a figlet font that comes with the toilet-fonts package on Debian at least. After that package is installed, you can also use that font with figlet (figlet -f letter).

3
  • 2
    Nice, I didn’t know about TOIlet (written by Sam Hocevar, there’s a surprise). That works with FIGlet too! Commented Apr 4, 2017 at 21:03
  • @StephenKitt, see edit. toilet uses the same fonts as figlet Commented Apr 4, 2017 at 21:15
  • Yes, TOIlet and FIGlet are now compatible with each other — TOIlet was always able to use FIGlet fonts, and FIGlet 2.2.4 added support for TOIlet fonts. (Strictly speaking “letter” is a TOIlet font.) Commented Apr 5, 2017 at 4:36
3

(This was the initial answer to the question.)

One option would be to modify the source of sysvbanner. Apparently that's not too difficult, here it is. Essentially just replacing #'s with the appropriate characters, once.

I would like other answers that doesn't involve compiling a binary, though.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .