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.9k
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.3k
fujiaire by shell
msr_i386
0
1k
colaboratory
msr_i386
0
160
yes command faster
msr_i386
0
390
Amazon Dash Hack
msr_i386
0
1.4k
cgroup
msr_i386
0
1.4k
discover fork-bomb
msr_i386
0
1.9k
ASCII art oneliner
msr_i386
0
2k
QR Code Shell
msr_i386
0
2.3k
Other Decks in Technology
See All in Technology
退屈なことはDevinにやらせよう〜〜Devin APIを使ったVisual Regression Testの自動追加〜
kawamataryo
2
520
実践アプリケーション設計 ②トランザクションスクリプトへの対応
recruitengineers
PRO
2
170
Devinを使ったモバイルアプリ開発 / Mobile app development with Devin
yanzm
0
190
RAID6 を楔形文字で組んで現代人を怖がらせましょう(実装編)
mimifuwa
0
300
AIドリブンのソフトウェア開発 - うまいやり方とまずいやり方
okdt
PRO
9
610
ドキュメントはAIの味方!スタートアップのアジャイルを加速するADR
kawauso
3
360
どこで動かすか、誰が動かすか 〜 kintoneのインフラ基盤刷新と運用体制のシフト 〜
ueokande
0
180
KiroでGameDay開催してみよう(準備編)
yuuuuuuu168
1
130
キャリアを支え組織力を高める「多層型ふりかえり」 / 20250821 Kazuki Mori
shift_evolve
PRO
2
300
見てわかるテスト駆動開発
recruitengineers
PRO
4
340
知られざるprops命名の慣習 アクション編
uhyo
10
2.5k
自社製CMSからmicroCMSへのリプレースがプロダクトグロースを加速させた話
nextbeatdev
0
130
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.6k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
RailsConf 2023
tenderlove
30
1.2k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.8k
The Cost Of JavaScript in 2023
addyosmani
53
8.8k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.4k
How STYLIGHT went responsive
nonsquared
100
5.7k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.6k
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Ͱੜ ➤ ࣗಈੜ͞ΕͨϑΥϯτϑΝΠϧαΠζ͕େ͖͗ͯ͢ද͕͍ࣔ