Friday, December 27, 2024
Google search engine
HomeLanguagesPython | ASCII art using pyfiglet module

Python | ASCII art using pyfiglet module

pyfiglet takes ASCII text and renders it in ASCII art fonts. figlet_format method convert ASCII text into ASCII art fonts.

It takes following arguments :

text
font ( DEFAULT_FONT = 'standard' )

Command to install pyfiglet module :

pip install pyfiglet

 
Code #1: Text in default font




# import pyfiglet module
import pyfiglet
  
result = pyfiglet.figlet_format("Geeks For Geeks")
print(result)


Output:

  ____           _          _____             ____           _        
 / ___| ___  ___| | _____  |  ___|__  _ __   / ___| ___  ___| | _____ 
| |  _ / _ \/ _ \ |/ / __| | |_ / _ \| '__| | |  _ / _ \/ _ \ |/ / __|
| |_| |  __/  __/      \__ \ |  _| (_) | |    | |_| |  __/  __/      \__ \
 \____|\___|\___|_|\_\___/ |_|  \___/|_|     \____|\___|\___|_|\_\___/
                                                                      

 
Code #2: Text in slant font




# import pyfiglet module
import pyfiglet
  
result = pyfiglet.figlet_format("Geeks For Geeks", font = "slant"  )
print(result)


Output:

   ______          __           ______              ______          __       
  / ____/__  ___  / /_______   / ____/___  _____   / ____/__  ___  / /_______
 / / __/ _ \/ _ \/ //_/ ___/  / /_  / __ \/ ___/  / / __/ _ \/ _ \/ //_/ ___/
/ /_/ /  __/  __/      (__  )  / __/ / /_/ / /     / /_/ /  __/  __/    (__  ) 
\____/\___/\___/_/|_/____/  /_/    \____/_/      \____/\___/\___/_/|_/____/  
                                                                             

 
Code #3: Text in 3-d font




# import pyfiglet module
import pyfiglet
  
result = pyfiglet.figlet_format("G e e k", font = "3-d" )
print(result)


Output:

   ********                        **    
  **//////**                      /**    
 **      //     *****     *****   /**  **
/**            **///**   **///**  /** ** 
/**    *****  /*******  /*******  /****  
//**  ////**  /**////   /**////   /**/** 
 //********   //******  //******  /**//**
  ////////     //////    //////   //  //    

 
Code #4: Text in 3×5 font




# importing pyfiglet module
import pyfiglet
  
result = pyfiglet.figlet_format("G e e k", font = "3x5" )
print(result)


Output:

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

 
Code #5: Text in 5lineoblique font




# import pyfiglet module
import pyfiglet
  
result = pyfiglet.figlet_format("G e e k", font = "5lineoblique" )
print(result)


Output:

                                                
    //   ) )                                       
   //              ___          ___         / ___  
  //  ____       //___) )     //___) )     //\ \   
 //    / /      //           //           //  \ \  
((____/ /      ((____       ((____       //    \ \   

 
Code #6: Text in alphabet font




# import pyfiglet module
import pyfiglet
  
result = pyfiglet.figlet_format("G e e k", font = "alphabet" )
print(result)


Output:

 GGG             k    
G                k k  
G  GG  eee  eee  kk   
G   G  e e  e e  k k  
 GGG   ee   ee   k  k 

 
Code #7: Text in banner3-D font




# import pyfiglet module
import pyfiglet
  
result = pyfiglet.figlet_format("Geeks", font = "banner3-D" )
print(result)


Output:

:'######:::'########:'########:'##:::'##::'######::
'##... ##:: ##.....:: ##.....:: ##::'##::'##... ##:
 ##:::..::: ##::::::: ##::::::: ##:'##::: ##:::..::
 ##::'####: ######::: ######::: #####::::. ######::
 ##::: ##:: ##...:::: ##...:::: ##. ##::::..... ##:
 ##::: ##:: ##::::::: ##::::::: ##:. ##::'##::: ##:
. ######::: ########: ########: ##::. ##:. ######::
:......::::........::........::..::::..:::......::: 

 
Code #8: Text in doh font




# import pyfiglet module
import pyfiglet
  
result = pyfiglet.figlet_format("Geeks", font = "doh" )
print(result)


Output:

                                                                               
        GGGGGGGGGGGGG                                       kkkkkkkk           
     GGG::::::::::::G                                       k::::::k           
   GG:::::::::::::::G                                       k::::::k           
  G:::::GGGGGGGG::::G                                       k::::::k           
 G:::::G       GGGGGG    eeeeeeeeeeee        eeeeeeeeeeee    k:::::k    kkkkkkk
G:::::G                ee::::::::::::ee    ee::::::::::::ee  k:::::k   k:::::k 
G:::::G               e::::::eeeee:::::ee e::::::eeeee:::::eek:::::k  k:::::k  
G:::::G    GGGGGGGGGGe::::::e     e:::::ee::::::e     e:::::ek:::::k k:::::k   
G:::::G    G::::::::Ge:::::::eeeee::::::ee:::::::eeeee::::::ek::::::k:::::k    
G:::::G    GGGGG::::Ge:::::::::::::::::e e:::::::::::::::::e k:::::::::::k     
G:::::G        G::::Ge::::::eeeeeeeeeee  e::::::eeeeeeeeeee  k:::::::::::k     
 G:::::G       G::::Ge:::::::e           e:::::::e           k::::::k:::::k    
  G:::::GGGGGGGG::::Ge::::::::e          e::::::::e         k::::::k k:::::k   
   GG:::::::::::::::G e::::::::eeeeeeee   e::::::::eeeeeeee k::::::k  k:::::k  
     GGG::::::GGG:::G  ee:::::::::::::e    ee:::::::::::::e k::::::k   k:::::k 
        GGGGGG   GGGG    eeeeeeeeeeeeee      eeeeeeeeeeeeee kkkkkkkk    kkkkkkk           

 
Code #9: Text in isometric1 font




# import pyfiglet module
import pyfiglet
  
result = pyfiglet.figlet_format("Geeks", font = "isometric1" )
print(result)


Output:


      ___           ___           ___           ___           ___     
     /\  \         /\  \         /\  \         /\__\         /\  \    
    /::\  \       /::\  \       /::\  \       /:/  /        /::\  \   
   /:/\:\  \     /:/\:\  \     /:/\:\  \     /:/__/        /:/\ \  \  
  /:/  \:\  \   /::\~\:\  \   /::\~\:\  \   /::\__\____   _\:\~\ \  \ 
 /:/__/_\:\__\ /:/\:\ \:\__\ /:/\:\ \:\__\ /:/\:::::\__\ /\ \:\ \ \__\
 \:\  /\ \/__/ \:\~\:\ \/__/ \:\~\:\ \/__/ \/_|:|~~|~    \:\ \:\ \/__/
  \:\ \:\__\    \:\ \:\__\    \:\ \:\__\      |:|  |      \:\ \:\__\  
   \:\/:/  /     \:\ \/__/     \:\ \/__/      |:|  |       \:\/:/  /  
    \::/  /       \:\__\        \:\__\        |:|  |        \::/  /   
     \/__/         \/__/         \/__/         \|__|         \/__/    

 
Code #10: Text in letters font




# import pyfiglet module
import pyfiglet
  
result = pyfiglet.figlet_format("Geeks", font = "letters" )
print(result)


Output:

  GGGG                kk           
 GG  GG   eee    eee  kk  kk  sss  
GG      ee   e ee   e kkkkk  s     
GG   GG eeeee  eeeee  kk kk   sss  
 GGGGGG  eeeee  eeeee kk  kk     s 
                              sss  

 
Code #11: Text in alligator font




# import pyfiglet module
import pyfiglet
  
result = pyfiglet.figlet_format("G e e k", font = "alligator" )
print(result)


Output:

      ::::::::        ::::::::::        ::::::::::        :::    ::: 
    :+:    :+:       :+:               :+:               :+:   :+:   
   +:+              +:+               +:+               +:+  +:+     
  :#:              +#++:++#          +#++:++#          +#++:++       
 +#+   +#+#       +#+               +#+               +#+  +#+       
#+#    #+#       #+#               #+#               #+#   #+#       
########        ##########        ##########        ###    ###       

 
Code #12: Text in dot matrix font




# import pyfiglet module
import pyfiglet
  
result = pyfiglet.figlet_format("Geeks", font = "dotmatrix" )
print(result)


Output:

    _  _  _                                   _                         
 _ (_)(_)(_) _                               (_)                        
(_)         (_)  _  _  _  _     _  _  _  _   (_)     _   _  _  _  _     
(_)    _  _  _  (_)(_)(_)(_)_  (_)(_)(_)(_)_ (_)   _(_)_(_)(_)(_)(_)    
(_)   (_)(_)(_)(_) _  _  _ (_)(_) _  _  _ (_)(_) _(_) (_)_  _  _  _     
(_)         (_)(_)(_)(_)(_)(_)(_)(_)(_)(_)(_)(_)(_)_    (_)(_)(_)(_)_   
(_) _  _  _ (_)(_)_  _  _  _  (_)_  _  _  _  (_)  (_)_   _  _  _  _(_)  
   (_)(_)(_)(_)  (_)(_)(_)(_)   (_)(_)(_)(_) (_)    (_) (_)(_)(_)(_)    
                                                                        

 
Code #13: Text in bubble font




# import pyfiglet module
import pyfiglet
  
result = pyfiglet.figlet_format("Geeks For Geeks", font = "bubble" )
print(result)


Output:

  _   _   _   _   _     _   _   _     _   _   _   _   _  
 / \ / \ / \ / \ / \   / \ / \ / \   / \ / \ / \ / \ / \ 
( G | e | e | k | s ) ( F | o | r ) ( G | e | e | k | s )
 \_/ \_/ \_/ \_/ \_/   \_/ \_/ \_/   \_/ \_/ \_/ \_/ \_/ 

 
Code #14: Text in bubblehead font




# import pyfiglet module
import pyfiglet
  
result = pyfiglet.figlet_format("Geeks For Geeks", font = "bulbhead" )
print(result)


Output:

  ___  ____  ____  _  _  ___    ____  _____  ____ 
 / __)( ___)( ___)( )/ )/ __)  ( ___)(  _  )(  _ \
( (_-. )__)  )__)  )  ( \__ \   )__)  )(_)(  )   /
 \___/(____)(____)(_)\_)(___/  (__)  (_____)(_)\_)
  ___  ____  ____  _  _  ___ 
 / __)( ___)( ___)( )/ )/ __)
( (_-. )__)  )__)  )  ( \__ \
 \___/(____)(____)(_)\_)(___/

 
Code #15: Text in digital font




# import pyfiglet module
import pyfiglet
  
result = pyfiglet.figlet_format("Geeks For Geeks", font = "digital" )
print(result)


Output:

+-+-+-+-+-+ +-+-+-+ +-+-+-+-+-+
|G|e|e|k|s| |F|o|r| |G|e|e|k|s|
+-+-+-+-+-+ +-+-+-+ +-+-+-+-+-+

RELATED ARTICLES

Most Popular

Recent Comments