Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
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
830
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
alecthomas/kong はいいぞ / kamakura.go#7
fujiwara3
1
300
祝!Iceberg祭開幕!re:Invent 2024データレイク関連アップデート10分総ざらい
kniino
2
250
AWS re:Invent 2024で発表された コードを書く開発者向け機能について
maruto
0
190
UI State設計とテスト方針
rmakiyama
2
440
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
430
Oracle Cloudの生成AIサービスって実際どこまで使えるの? エンジニア目線で試してみた
minorun365
PRO
4
280
podman_update_2024-12
orimanabu
1
260
宇宙ベンチャーにおける最近の情シス取り組みについて
axelmizu
0
110
20241220_S3 tablesの使い方を検証してみた
handy
3
360
サーバレスアプリ開発者向けアップデートをキャッチアップしてきた #AWSreInvent #regrowth_fuk
drumnistnakano
0
190
多領域インシデントマネジメントへの挑戦:ハードウェアとソフトウェアの融合が生む課題/Challenge to multidisciplinary incident management: Issues created by the fusion of hardware and software
bitkey
PRO
2
100
Qiita埋め込み用スライド
naoki_0531
0
860
Featured
See All Featured
Unsuck your backbone
ammeep
669
57k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Making the Leap to Tech Lead
cromwellryan
133
9k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.3k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.3k
Scaling GitHub
holman
458
140k
Designing Experiences People Love
moore
138
23k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
What's in a price? How to price your products and services
michaelherold
243
12k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
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Ͱੜ ➤ ࣗಈੜ͞ΕͨϑΥϯτϑΝΠϧαΠζ͕େ͖͗ͯ͢ද͕͍ࣔ