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
810
colaboratory
msr_i386
0
140
yes command faster
msr_i386
0
320
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
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
5
470
TypeScript、上達の瞬間
sadnessojisan
46
13k
DMARC 対応の話 - MIXI CTO オフィスアワー #04
bbqallstars
1
160
Evangelismo técnico: ¿qué, cómo y por qué?
trishagee
0
360
安心してください、日本語使えますよ―Ubuntu日本語Remix提供休止に寄せて― 2024-11-17
nobutomurata
1
990
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
iOS/Androidで同じUI体験をネ イティブで作成する際に気をつ けたい落とし穴
fumiyasac0921
1
110
VideoMamba: State Space Model for Efficient Video Understanding
chou500
0
190
Amazon CloudWatch Network Monitor のススメ
yuki_ink
1
200
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
290
Engineer Career Talk
lycorp_recruit_jp
0
130
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
300k
Featured
See All Featured
KATA
mclloyd
29
14k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Rails Girls Zürich Keynote
gr2m
94
13k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Navigating Team Friction
lara
183
14k
Making Projects Easy
brettharned
115
5.9k
Code Review Best Practice
trishagee
64
17k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Become a Pro
speakerdeck
PRO
25
5k
What's in a price? How to price your products and services
michaelherold
243
12k
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Ͱੜ ➤ ࣗಈੜ͞ΕͨϑΥϯτϑΝΠϧαΠζ͕େ͖͗ͯ͢ද͕͍ࣔ