$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
kanji banner
Search
MSR
December 25, 2016
Technology
0
1.8k
kanji banner
漢字バナー芸 - 仮名だけじゃなく漢字もください
※bannerコマンドにおける「GNU系」という表記は誤りで、正しくは「System V由来」です。
MSR
December 25, 2016
Tweet
Share
More Decks by MSR
See All by MSR
horizon
msr_i386
0
1.1k
fujiaire by shell
msr_i386
0
820
colaboratory
msr_i386
0
140
yes command faster
msr_i386
0
330
Amazon Dash Hack
msr_i386
0
1.4k
cgroup
msr_i386
0
1.3k
discover fork-bomb
msr_i386
0
1.8k
ASCII art oneliner
msr_i386
0
1.9k
QR Code Shell
msr_i386
0
2.2k
Other Decks in Technology
See All in Technology
クラウドネイティブなNewSQLで実現するミッションクリティカルなアプリケーションの運用
yuyu_hf
PRO
1
140
大規模トラフィックを支える ゲームバックエンドの課題と構成の変遷 ~安定したゲーム体験を実現するために~
colopl
0
450
50以上のマイクロサービスを支えるアプリケーションプラットフォームの設計・構築の後悔と進化 #CNDW2024 / regrets and evolution of application platform
toshi0607
5
580
AWS re:Invent 2024 予選落ちのBedrockアプデをまとめて解説!
minorun365
PRO
2
210
Yahoo! JAPANトップページにおけるマイクロフロントエンド - 大規模組織におけるFE開発を加速させるには
lycorptech_jp
PRO
0
1.6k
CDCL による厳密解法を採用した MILP ソルバー
imai448
5
430
LLMOps: Eval-Centric を前提としたMLOps
asei
5
290
asumikamというカンファレンスオーガナイザの凄さを語る / The Brilliance of Asumikam
tomzoh
0
130
総会員数1,500万人のレストランWeb予約サービスにおけるRustの活用
kymmt90
2
2.6k
次のコンテナセキュリティの時代 - User Namespace With a Pod / CloudNative Days Winter 2024
pfn
PRO
4
380
もう一度、 事業を支えるシステムに。
leveragestech
5
2.9k
JAWS UG 青森(弘前)クラウド・AWS入門
hiragahh
0
170
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Agile that works and the tools we love
rasmusluckow
327
21k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
1
200
How STYLIGHT went responsive
nonsquared
95
5.2k
It's Worth the Effort
3n
183
27k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.3k
Ruby is Unlike a Banana
tanoku
97
11k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Typedesign – Prime Four
hannesfritz
40
2.4k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
400
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Transcript
ࣈόφʔܳ @ୈ26ճγΣϧܳษڧձ େࡕαςϥΠτ (2016.12.25) MSR (@msr386)
࣍ ➤ ࣗݾհ ➤ όφʔܳͱ ➤ banner, figlet, toilet ➤
toiletίϚϯυͷ֦ு (ࣈΛ͍ͩ͘͞) ➤ ·ͱΊ
ࣗݾհ ➤ ϋϯυϧωʔϜ: MSR (@msr386) ➤ C++ϓϩάϥϛϯάɺαʔόʔӡ༻͕ಘҙ ➤ Chromium Contributor
➤ Webϒϥβ࡞͍ͬͯ·͢ http://app.tungsten-start.net/
όφʔܳͱ ➤ ఆ͕ٛ͋Δͷ͔ఆ͔Ͱͳ͍͕… ➤ ҰݴͰݴ͑ʮจࣈΛཱͨͤΔγΣϧܳʯ ➤ ར༻͞ΕΔදతͳίϚϯυʹbanner, figlet, toilet͕͋Δ ➤
όφʔܳͷྫ ➤ ಥવͷࢮΛϫϯϥΠφʔͰදࣔ ➤ ཱͨͤͨͷΛwallίϚϯυͰʹҰ੪ૹ৴
όφʔܳͷදతͳίϚϯυ (1) - BANNER ➤ ੲ͔Β͋Δ౷తɺ͔ͭݪ࢝తͳίϚϯυ ➤ GNUܥͱBSDܥͰରԠҾද͕ࣔશ͘ҟͳΔ ➤ GNUܥͨͩ#Ͱେ͖͚ͨͩ͘͠ͰɺҾҰରԠ͠ͳ͍
➤ BSDܥ͔ͬ͜Α͘දࣔ͞ΕΔ͕ͳ͔ͥॎʹදࣔͯ͘͠Δ ˠԣʹදࣔ͢ΔγΣϧ͕ܳొ (※͜Ε͕όφʔܳͷ͡·Γ)
➤ https://twitter.com/grethlen/status/778952287339163649 BANNERίϚϯυ࣮ߦྫ
BANNERίϚϯυ࣮ߦྫ $ banner -w 50 a ### ######## ##########
##### #### #### ###### ## ## ## ## ## # ## ## ## ################## ################### ################## ## # $
όφʔܳͷදతͳίϚϯυ (2) - FIGLET ➤ bannerίϚϯυ͔Βදݱྗ͕ਐԽ ➤ ༷ʑͳදࣔํࣜ ➤ ඪ४ࡌͷϑΥϯτ͕๛(ΧλΧφͷΈRTLͳͷ)
showfigfonts ͰҰཡදࣔՄೳ ➤ ϑΥϯτࣗ࡞Մೳ ➤ ݱࡏɺ։ൃఀࢭத? (࠷৽൛2.2.5ɺ20125݄Ҏ߱ߋ৽͞Ε͍ͯͳ͍)
FIGLETίϚϯυ࣮ߦྫ $ figlet FIGlet _____ ___ ____ _ _
| ___|_ _/ ___| | ___| |_ | |_ | | | _| |/ _ \ __| | _| | | |_| | | __/ |_ |_| |___\____|_|\___|\__| $ figlet -f roman FIGlet oooooooooooo ooooo .oooooo. oooo . `888' `8 `888' d8P' `Y8b `888 .o8 888 888 888 888 .ooooo. .o888oo 888oooo8 888 888 888 d88' `88b 888 888 " 888 888 ooooo 888 888ooo888 888 888 888 `88. .88' 888 888 .o 888 . o888o o888o `Y8bood8P' o888o `Y8bod8P' "888" $
όφʔܳͷදతͳίϚϯυ (3) - TOILET ➤ figletͷஔ͖͑Λతͨ͠ίϚϯυ ➤ Ծ໊ϑΥϯτඪ४ࡌ ➤ ΧϥʔදࣔɺHTMLग़ྗରԠ
➤ figletͱಉ༷ɺϑΥϯτࣗ࡞Մೳ(figletͱܗ͕ࣜҟͳΔ) ➤ ϥΠηϯε͍͠WTFPL (ύϒϦοΫϥΠηϯε͔ͩΒ͖ʹ͕͠Ε) ➤ ϗʔϜϖʔδ( http://caca.zoy.org/wiki/toilet )Ͳ͏ݟͯ͏˓͜
TOILETίϚϯυ࣮ߦྫ $ toilet ͻΒ͕ͳΧλΧφOKࣈ× m m m m m
m # m "" "m m" " mmm#m"mm # ""#" # # "mm#""m "m # m"" "mmm#"""# m" #"m #m""""m # # m# # # m" # # # " # # # " m"""#m m" # "mmm" mmm"" # "m" "mmm" " m" "m" m m m #mmmm # # mmmm m m # m" "mmm#"""# "mmmm#"""" m" "m # m" m m m" "mm" m" # # # # #m# "m" m" m" # # # # # #m m" "m mm"" m" "m" m" #mm# # "m $
ͬͺΓࣈ͕΄͍͠
TOILETͷϑΥϯτσʔλ ➤ ॴ: /usr/local/share/figlet ͳͲ ➤ ֦ுࢠ: .tlf (※figletܗࣜ(.flf)༻Մೳ) ➤
ϑΥϯτσʔλzipѹॖͯ͠Α͍ ➤ จࣈίʔυUnicode →ࣈֆจࣈ(͠Α͏ͱࢥ͑)දࣔͰ͖Δ!
ϑΥϯτσʔλͷܗࣜʢ֓ཁʣ ➤ 1ߦtlf2a$ͱ͍͏ϔομ ɺ1จࣈ͋ͨΓͷߦͳͲΛఆٛ ➤ จࣈUnicodeॱͰ֨ೲ͞Ε͍ͯΔ ➤ จࣈఆٛ ➤ 1ߦUnicodeͱจࣈΛهड़
➤ 2ߦҎ߱ʹରԠ͢ΔจࣈΛඳ͘ ➤ ֤ߦͷऴ@ͰऴΘΔ ➤ จࣈ1ݸͷ࠷ऴߦ@@ͰऴΘΔ 0x3042 ͋ m @ mmm#m"" @ #mm#m @ m# m" "m @ # "m" # @ "m" mm" @ @ @@
ϑΥϯτσʔλฤूྫ ➤ ascii9.tlfΛల։ͯ͠add.tlfʹมߋͯ͠ɺ࣍ͷจࣈΛՃ 0x4ECA ࠓ # @ m” “m @
mm" --- "mm @ mmmmm @ m @ m" @ @ @@ 0x65E5 mmmmmmmmmm @ # # @ #mmmmmmmm# @ # # @ # # @ mmmmmmmmmm @ @ @@ 0x1F359 m @ # # @ # # @ # mmm # @ # #m# # @ mmmmmmmmm @ @ @@
࣮ߦྫ $ toilet -f add ࠓ # mmmmmmmmmm m m
m" "m # # "m m #mm # # mm" --- "mm #mmmmmmmm# m" """# # # mmmmm # # # # # mmm # m # # # mm"""#m # #m# # m" mmmmmmmmmm "# "mmm" " mmmmmmmmm $
Ͱ…
͏จࣈΛ͍͍ͪͪ Ճ͢ΔͷΊΜͲ͍
ࣗಈੜ͍ͨ͠ ➤ toiletͷιʔείʔυʹ caca2tlf ͱ͍͏πʔϧ͕ଘࡏ ➤ caca2tlf libcaca෦Ͱ༻͢ΔϑΥϯτΛtlfʹม͢Δπʔϧ (※libcacaΞεΩʔΞʔτΛੜ͢ΔάϥϑΟοΫϥΠϒϥϦɺtoiletͰ༻)
➤ libcaca෦Ͱ༻͢ΔϑΥϯτlibcacaͷmakefontπʔϧͰੜ͢Δ ͔͠͠ɾɾɾ ➤ libcaca෦Ͱ༻͢ΔϑΥϯτࣈ͕ੜର֎ ͦͷ··ͩͱcaca2tlfͰࣈ͕ग़ͯ͜ͳ͍ ➤ makefontͱlibcacaͷιʔείʔυΛมߋ͠ɺίϯύΠϧ͢Δඞཁ͕͋Δ
ࣈΛࣗಈੜ͢Δʹ 1. toilet, libcacaͷιʔείʔυΛೖख 2. toiletΛίϯύΠϧ 3.
libcacaΛbootstrapͱconfigure·Ͱ࣮ߦ $ git clone https://github.com/cacalabs/toilet.git $ git clone https://github.com/cacalabs/libcaca.git $ cd toilet $ ./bootstrap $ ./configure $ make $ cd libcaca $ ./bootstrap $ ./configure
ࣈΛࣗಈੜ͢Δʹ 4. libcaca/tools/makefont.cͷάϩʔόϧఆྻ blocklist ʹCJK౷߹ࣈΤϦΞ (0x3d00ʙ0x9fd5)ΛՃ 5. makefontΛίϯύΠϧ diff --git
a/tools/makefont.c b/tools/makefont.c index 226c883..7c58c79 100644 --- a/tools/makefont.c +++ b/tools/makefont.c @@ -61,6 +61,7 @@ static unsigned int const blocklist[] = 0x3000, 0x3040, /* CJK Symbols and Punctuation: 。「」 */ 0x3040, 0x30a0, /* Hiragana: で す */ 0x30a0, 0x3100, /* Katakana: ロ ル */ + 0x3d00, 0x9fd5, /* CJK unified Ideographs */ 0xff00, 0xfff0, /* Halfwidth and Fullwidth Forms: A, B, C, a, b, c */ 0x10400, 0x10450, /* Deseret: */ 0, 0
ࣈΛࣗಈੜ͢Δʹ 6. ଂϑΥϯτΛੜ͠ɺcaca/mono*.dataΛ্ॻ͖ ˞ͦΕͧΕ9ϙΠϯτ༻ͱ12ϙΠϯτ༻Λੜɻmono9ͱmonobold12ݻఆ ˞ୈ2ҾʹϑΥϯτ໊ͱϙΠϯτΛهड़ɻ͜ΕͰਖ਼͍͔͠ະ֬ೝ ˞ୈ3ҾDPI(௨ৗ96)ɺୈ4Ҿbpp(1ϐΫηϧ͋ͨΓͷϏοτ) 7. libcacaΛίϯύΠϧɺΠϯετʔϧ
8. toiletͷtools/caca2tlfΛ࣮ߦ [libcaca/tools] $ ./makefont mono9 "IPA Gothic 9" 96 1 > ../caca/mono9.data [libcaca/tools] $./makefont monobold12 "IPA Gothic 12" 96 1 > ../caca/monobold12.data [libcaca] $ make [libcaca] $ sudo make install [toilet/tools] $ ./caca2tlf "Monospace 9" > /usr/local/share/figlet/ipa9 [toilet/tools] $ ./caca2tlf "Monospace Bold 12" > /usr/local/share/figlet/ipa12
࣮ߦྫ $ toilet -f ipa12 ࣈOK ##
# ## # ########## ############ ## # # # ## # ## ## # # ## ## ######### ## ## # # ## ## # ## ## ## ## ######## ## # # ## # # ## ## ## ## # # #### # ######## ## # # ### ## # # # ### ########## ############## # # #### # ## ############## # # ## # # ########## # # # ## ## # #### # ## ## ## ## # ## ## # #### ## # # ## ## #####
ࣈੜՄೳ͕ͩɾɾɾ ➤ CJK౷߹ࣈ(28,000ࣈ)ͷ͓͔͛Ͱ࣮ߦʹ͕͔͔࣌ؒΔ ϑΝΠϧαΠζ : 5MBʙ10MB ascii9.tlf(ඇѹॖ) : 290KB ➤
͋·Γ៉ྷ͡Όͳ͍ ϏοτϚοϓϑΥϯτͳΒ៉ྷʹͳΔ? ➤ αΠζ͕9ϙΠϯτͩͱࣈ͕ͭͿΕΔ
·ͱΊ ➤ όφʔܳͰ༻͢ΔදίϚϯυ: banner, figlet, toilet ➤ toiletͷϑΥϯτ֦ுՄೳ ➤ ͦͷؾʹͳΕࣈදࣔֆจࣈදࣔͰ͖Δ
➤ ࣈͷࣗಈੜ͕͚ͨ͠Ε 1. libcacaͷπʔϧmakefontΛվͯ͠libcacaΛίϯύΠϧɺΠϯετʔϧ 2. caca2tlfͰੜ ➤ ࣗಈੜ͞ΕͨϑΥϯτϑΝΠϧαΠζ͕େ͖͗ͯ͢ද͕͍ࣔ