はじめに

文字列をいい感じにAA(アスキーアート)文字列にしてくれるfigletコマンドを使う。

環境

1
2
MacOS Sonoma 14.4.1
Homebrew 4.2.15

figletのインストール

1
brew install figlet
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
brew install figlet

==> Downloading https://ghcr.io/v2/homebrew/core/figlet/manifests/2.2.5
################################################################################################################################################# 100.0%
==> Fetching figlet
==> Downloading https://ghcr.io/v2/homebrew/core/figlet/blobs/sha256:4c1ce798c88dab71094733aed8969c787842894037637009dd4a7c06a00446da
################################################################################################################################################# 100.0%
==> Pouring figlet--2.2.5.sonoma.bottle.tar.gz
🍺  /usr/local/Cellar/figlet/2.2.5: 677 files, 9.5MB
==> Running `brew cleanup figlet`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

使ってみる

1
2
3
4
5
6
7
figlet Hello World

 _   _      _ _        __        __         _     _ 
| | | | ___| | | ___   \ \      / /__  _ __| | __| |
| |_| |/ _ \ | |/ _ \   \ \ /\ / / _ \| '__| |/ _` |
|  _  |  __/ | | (_) |   \ V  V / (_) | |  | | (_| |
|_| |_|\___|_|_|\___/     \_/\_/ \___/|_|  |_|\__,_|

-cオプションで、CLI上の中央部分に表示させる。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
figlet -c
h
                                     _     
                                    | |__  
                                    | '_ \ 
                                    | | | |
                                    |_| |_|
                                           
e
                                           
                                       ___ 
                                      / _ \
                                     |  __/
                                      \___|
                                           
l
                                       _ 
                                      | |
                                      | |
                                      | |
                                      |_|
                                         
l
                                       _ 
                                      | |
                                      | |
                                      | |
                                      |_|
                                         
o
                                           
                                      ___  
                                     / _ \ 
                                    | (_) |
                                     \___/ 

おわりに

figletコマンドで文字列をAAとして表示するをやってみた。   AA文字列をCLI上で作成できるのは面白いので、使う機会があれば使いたい。