程序猿编码装X工具推荐figlet
losetowin 发布于:2019-4-24 9:47 分类:技术 有 4689 人浏览,获得评论 0 条
除非注明,文章均为 www.dutycode.com 原创,欢迎转载!转载请注明本文地址,谢谢。
发现了一个有趣的小工具。
figlet
可以将字符转化成字符画。比如下面这种
_ _ _
__| |_ _| |_ _ _ ___ ___ __| | ___ ___ ___ _ __ ___
/ _` | | | | __| | | |/ __/ _ \ / _` |/ _ \ / __/ _ \| '_ ` _ \
| (_| | |_| | |_| |_| | (_| (_) | (_| | __/| (_| (_) | | | | | |
\__,_|\__,_|\__|\__, |\___\___/ \__,_|\___(_)___\___/|_| |_| |_|
|___/
如何安装
mac下安装方式:
使用brew安装即可。
命令如下:
brew install figlet
这个命令同时会安装主程序和字体文件
BTW:没有brew的可以自行百度安装brew,之后再安装figlet
如何使用
最简单的
figlet dutycode.com
这个命令,会将dutycode.com这个字符串转成字符画,如下样式:
_ _ _
__| |_ _| |_ _ _ ___ ___ __| | ___ ___ ___ _ __ ___
/ _` | | | | __| | | |/ __/ _ \ / _` |/ _ \ / __/ _ \| '_ ` _ \
| (_| | |_| | |_| |_| | (_| (_) | (_| | __/| (_| (_) | | | | | |
\__,_|\__,_|\__|\__, |\___\___/ \__,_|\___(_)___\___/|_| |_| |_|
|___/
如果想换种样式呢?
换个字体就可以了
figlet -f 字体 字符串
比如:
figlet -f starwars dutycode.com
得到的字符画如下:
_______ __ __ .___________.____ ____ ______ ______ _______
| \ | | | | | |\ \ / / / | / __ \ | \
| .--. || | | | `---| |----` \ \/ / | ,----'| | | | | .--. |
| | | || | | | | | \_ _/ | | | | | | | | | |
| '--' || `--' | | | | | | `----.| `--' | | '--' |
|_______/ \______/ |__| |__| \______| \______/ |_______/
_______ ______ ______ .___ ___.
| ____| / | / __ \ | \/ |
| |__ | ,----'| | | | | \ / |
| __| | | | | | | | |\/| |
| |____ __| `----.| `--' | | | | |
|_______(__)\______| \______/ |__| |__|
怎么看哪些字体可用?
使用figlist即可查看到所有支持的字体
执行之后可得到如下的结果:
Default font: standard
Font directory: /usr/local/Cellar/figlet/2.2.5/share/figlet/fonts
Figlet fonts in this directory:
3-d
3x5
5lineoblique
acrobatic
alligator
alligator2
alphabet
avatar
banner
banner3-D
banner3
banner4
barbwire
basic
bell
...
有啥用
还真的没啥卵用,但是看着很爽,心情舒适,码代码自然舒适,这就够了~
当然也有点点小用。
比如,在代码里面加个酷炫的签名注释,绝对秒杀普通注释,千古留名
再比如,像SpringBoot支持banner,可以在自定义banner里面加上有特征的字符画信息,启动站点的时候,不再无聊。
比如:
补充
互联网时代,没个网站都不好意思说自己搞互联网,所以现在有很多在线的工具可以生成字符画。
不方便安装工具的可以直接在线上使用。推荐几个在线使用的工具站。可以直接生成字符画。
http://patorjk.com/software/taag/#p=display&f=Graffiti&t=dutycode.com
如果觉着把字符生成字符画不够酷炫,还有可以把图片生成字符画的工具
http://picascii.com/
http://glassgiant.com/ascii/
https://www.ascii-art-generator.org/ (即可以图片到字符画,也可以文字到字符画)
http://ascii.mastervb.net/
https://www.degraeve.com/img2txt.php
记着用完,在代码上加个酷炫的字符画~~
版权所有:《攀爬蜗牛》 => 《程序猿编码装X工具推荐figlet》
本文地址:https://www.dutycode.com/figlet_shiyong.html
除非注明,文章均为 《攀爬蜗牛》 原创,欢迎转载!转载请注明本文地址,谢谢。