使用 figlet 和 toilet 创建字符图案

figlet

figlet 是一款在 geek 程序员中很流行的文字转字符图案的自由软件,在很多知名开源项目代码中都能见到它的杰作:

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

安装:apt-get install figlet

可以通过 -f 参数指定字体文件:

$ figlet -f banner windrunner

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

-c/l/r/x 参数指定居中/左/右/自动,-L/R/X 指定文字排序方向,-t 指定输出宽度为终端宽度。

figlet 预置了众多字体,可以输入 showfigfonts 列出并预览所有字体效果:

banner :

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



big :
 _     _
| |   (_)
| |__  _  __ _
| '_ \| |/ _` |
| |_) | | (_| |
|_.__/|_|\__, |
          __/ |
         |___/


block :

_|        _|                      _|
_|_|_|    _|    _|_|      _|_|_|  _|  _|
_|    _|  _|  _|    _|  _|        _|_|
_|    _|  _|  _|    _|  _|        _|  _|
_|_|_|    _|    _|_|      _|_|_|  _|    _|




bubble :
  _   _   _   _   _   _
 / \ / \ / \ / \ / \ / \
( b | u | b | b | l | e )
 \_/ \_/ \_/ \_/ \_/ \_/


digital :
+-+-+-+-+-+-+-+
|d|i|g|i|t|a|l|
+-+-+-+-+-+-+-+


ivrit :(根据屏幕宽度居中)
                                                            _   _            _
                                                           | |_(_)_ ____   _(_)
                                                           | __| | '__\ \ / / |
                                                           | |_| | |   \ V /| |
                                                            \__|_|_|    \_/ |_|



lean :

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




mini :

._ _ o._ o
| | ||| ||



mnemonic :
mnemonic


script :

               o
 ,   __   ,_        _ _|_
/ \_/    /  |  |  |/ \_|
 \/ \___/   |_/|_/|__/ |_/
                 /|
                 \|


shadow :
      |               |
  __| __ \   _` |  _` |  _ \\ \  \   /
\__ \ | | | (   | (   | (   |\ \  \ /
____/_| |_|\__,_|\__,_|\___/  \_/\_/



slant :
         __            __
   _____/ /___ _____  / /_
  / ___/ / __ `/ __ \/ __/
 (__  ) / /_/ / / / / /_
/____/_/\__,_/_/ /_/\__/



small :
               _ _
 ____ __  __ _| | |
(_-< '  \/ _` | | |
/__/_|_|_\__,_|_|_|



smscript :

 ,           ,   _   ,_  o    _|_
/ \_/|/|/|  / \_/   /  | | |/\_|
 \/  | | |_/ \/ \__/   |/|/|_/ |_/
                          (|


smshadow :
               |              |
(_-<  ` \ (_-<   \   _` |  _` |  _ \\ \  \ /
___/_|_|_|___/_| _|\__,_|\__,_|\___/ \_/\_/



smslant :
                 __          __
  ___ __ _  ___ / /__ ____  / /_
 (_-</  ' \(_-</ / _ `/ _ \/ __/
/___/_/_/_/___/_/\_,_/_//_/\__/



standard :
     _                  _               _
 ___| |_ __ _ _ __   __| | __ _ _ __ __| |
/ __| __/ _` | '_ \ / _` |/ _` | '__/ _` |
\__ \ || (_| | | | | (_| | (_| | | | (_| |
|___/\__\__,_|_| |_|\__,_|\__,_|_|  \__,_|



term :(普通文字效果)
term

toilet

安装:apt-get install toilet

toilet 和 figlet 相似,但是支持彩色输出,需要终端支持。

toilet 支持两种彩色格式:--gay--metal

$ toilet --gay windrunner

          "               #
m     m mmm    m mm    mmm#   m mm  m   m  m mm   m mm    mmm    m mm
"m m m"   #    #"  #  #" "#   #"  " #   #  #"  #  #"  #  #"  #   #"  "
 #m#m#    #    #   #  #   #   #     #   #  #   #  #   #  #""""   #
  # #   mm#mm  #   #  "#m##   #     "mm"#  #   #  #   #  "#mm"   #

$ toilet --metal windrunner

          "               #
m     m mmm    m mm    mmm#   m mm  m   m  m mm   m mm    mmm    m mm
"m m m"   #    #"  #  #" "#   #"  " #   #  #"  #  #"  #  #"  #   #"  "
 #m#m#    #    #   #  #   #   #     #   #  #   #  #   #  #""""   #
  # #   mm#mm  #   #  "#m##   #     "mm"#  #   #  #   #  "#mm"   #

可以在官网观看其效果。

Kane Blueriver all right reserved,powered by Gitbook最近修改时间: 2018-05-21 17:28:09

results matching ""

    No results matching ""