透過Figlet在Terminal上產生BBS文字圖


看到上面的文字圖,號稱30cm的鄉民們一定不陌生吧,這種文字圖常被用來做Terminal歡迎畫面,雖然不是很常使用到它,但是有天突發奇想要做張像這樣的文字圖,還是要花一些功夫拼拼湊湊才能弄出來,如果這時候你已經認識了Figlet,可能可以幫上你不少忙,所以廢話不多說,趕緊來介紹一下:

1) 透過YUM來安裝Figlet套件(前提已經裝過EPEL)

#yum list | grep 'figlet'
figlet.x86_64                         2.2.5-1.el5             epel
#yum -y install figlet

2) 直接輸入Figlet來查詢可以支援的字型

Default font: standard
Font directory: /usr//share/figlet
Figlet fonts in this directory:
banner
big
block
bubble
digital
ivrit
lean
mini
mnemonic
script
shadow
slant
small
smscript
smshadow
smslant
standard
term
Figlet control files in this directory:
646-ca2
646-ca
646-cn
646-cu
646-de
646-dk
646-es2
646-es
646-fr
646-gb
646-hu
646-irv
646-it
646-jp
646-kr
646-no2
646-no
646-pt2
646-pt
646-se2
646-se
646-yu
8859-2
8859-3
8859-4
8859-5
8859-7
8859-8
8859-9
frango
hz
ilhebrew
jis0201
koi8r
moscow
upper
ushebrew
uskata
utf8

3) 透過Figlet產生基本款的文字圖(不帶任何Option)

 _     _   _             _____            _  _
| |__ | |_| |_ _ __ _   / / (_) ___  _ __(_)| |___      __
| '_ \| __| __| '_ (_) / / /| |/ _ \| '__| || __\ \ /\ / /
| | | | |_| |_| |_) | / / / | | (_) | |  | || |_ \ V  V /
|_| |_|\__|\__| .__(_)_/_/  |_|\___/|_|  |_(_)__| \_/\_/
              |_|

4) 指定使用Digital的字型(選項f為指定哪種字型)

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|h|t|t|p|:|/|/|i|o|r|i|.|t|w|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

5) 指定均使用大寫作顯示(選項C為Control)

 _   _ _____ _____ ____       _______ ___  ____  ___ _______        __
| | | |_   _|_   _|  _ \ _   / / /_ _/ _ \|  _ \|_ _|_   _\ \      / /
| |_| | | |   | | | |_) (_) / / / | | | | | |_) || |  | |  \ \ /\ / /
|  _  | | |   | | |  __/ _ / / /  | | |_| |  _ < | | _| |   \ V  V /
|_| |_| |_|   |_| |_|   (_)_/_/  |___\___/|_| \_\___(_)_|    \_/\_/

6) 指定使用Lean的字型且寬度為120(選項w為指定寬度數字)

    _/    _/  _/_/_/_/_/  _/_/_/_/_/  _/_/_/                _/    _/  _/_/_/    _/_/    _/_/_/    _/_/_/  _/_/_/_/_/
   _/    _/      _/          _/      _/    _/  _/        _/    _/      _/    _/    _/  _/    _/    _/        _/
  _/_/_/_/      _/          _/      _/_/_/            _/    _/        _/    _/    _/  _/_/_/      _/        _/
 _/    _/      _/          _/      _/              _/    _/          _/    _/    _/  _/    _/    _/        _/
_/    _/      _/          _/      _/        _/  _/    _/          _/_/_/    _/_/    _/    _/  _/_/_/  _/  _/
  _/          _/
 _/          _/
_/    _/    _/
 _/  _/  _/
  _/  _/

7) 將上述產生的文字圖做置中(選項c為Center,選項l為Left與選項r為Right)

    _/    _/  _/_/_/_/_/  _/_/_/_/_/  _/_/_/                _/    _/  _/_/_/    _/_/    _/_/_/    _/_/_/  _/_/_/_/_/
   _/    _/      _/          _/      _/    _/  _/        _/    _/      _/    _/    _/  _/    _/    _/        _/
  _/_/_/_/      _/          _/      _/_/_/            _/    _/        _/    _/    _/  _/_/_/      _/        _/
 _/    _/      _/          _/      _/              _/    _/          _/    _/    _/  _/    _/    _/        _/
_/    _/      _/          _/      _/        _/  _/    _/          _/_/_/    _/_/    _/    _/  _/_/_/  _/  _/
                                                    _/          _/
                                                   _/          _/
                                                  _/    _/    _/
                                                   _/  _/  _/
                                                    _/  _/

◎以上就是關於使用Figlet產生BBS文字圖的簡介,上述的範例均參考這裡,若想要Web上面直接產生且不安裝Figlet的話可透過這裡拿到,至於詳細的使用可能要#man figlet檢視用法後可能會比較了解,累了,收工!

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>