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.2k
fujiaire by shell
msr_i386
0
850
colaboratory
msr_i386
0
140
yes command faster
msr_i386
0
340
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
AWS Community Builderのススメ - みんなもCommunity Builderに応募しよう! -
smt7174
0
170
デジタルアイデンティティ技術 認可・ID連携・認証 応用 / 20250114-OIDF-J-EduWG-TechSWG
oidfj
2
670
AWSサービスアップデート 2024/12 Part3
nrinetcom
PRO
0
140
実践! ソフトウェアエンジニアリングの価値の計測 ── Effort、Output、Outcome、Impact
nomuson
0
2k
Oracle Exadata Database Service(Dedicated Infrastructure):サービス概要のご紹介
oracle4engineer
PRO
0
12k
I could be Wrong!! - Learning from Agile Experts
kawaguti
PRO
8
3.4k
エンジニアリングマネージャー視点での、自律的なスケーリングを実現するFASTという選択肢 / RSGT2025
yoshikiiida
4
3.7k
Amazon Route 53, 待ちに待った TLSAレコードのサポート開始
kenichinakamura
0
160
「隙間家具OSS」に至る道/Fujiwara Tech Conference 2025
fujiwara3
7
6.4k
Oracle Base Database Service:サービス概要のご紹介
oracle4engineer
PRO
1
16k
embedパッケージを深掘りする / Deep Dive into embed Package in Go
task4233
1
210
あなたの知らないクラフトビールの世界
miura55
0
120
Featured
See All Featured
Unsuck your backbone
ammeep
669
57k
Fireside Chat
paigeccino
34
3.1k
Scaling GitHub
holman
459
140k
Practical Orchestrator
shlominoach
186
10k
Become a Pro
speakerdeck
PRO
26
5.1k
For a Future-Friendly Web
brad_frost
176
9.5k
It's Worth the Effort
3n
183
28k
The Cult of Friendly URLs
andyhume
78
6.1k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
Side Projects
sachag
452
42k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
Music & Morning Musume
bryan
46
6.3k
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Ͱੜ ➤ ࣗಈੜ͞ΕͨϑΥϯτϑΝΠϧαΠζ͕େ͖͗ͯ͢ද͕͍ࣔ