Screenshot of terminal, text #TDC5055 FigLet Fun in a figlet 'font'

I’ve been thinking about the DS106 experience recently due to my marginal involvement in the combobulating experience. This was very much focused on The Daily Create, a bit of fun I dip into occasionally. One of the things that I thought about was the fact I often got more fun out of the DS106 assignment bank than the daily tasks. Today Alan’s post reminded me why. It made me dig into this post, notes for which were sitting the my drafts app, spiff it up a bit and post it.

The other day I saw the #tdc5055 #ds106 ASCII Art on The Daily Create

Use the ASCII Art Paint site to create something interesting with the thematic symbols.

It immediately reminded me of figlet. Took me a couple of minutes to remember the name.

Figlet makes big ASCII text on the command line. You just type in “figlet “#DS106” and you get something like this in the terminal:

You can try figlet out online if you don’t want to use the terminal and install it: Asciified

asciified is a small webapp that gives you the ability to create figlets using the figlet package

I had a dim memory that figlet had the concept of “fonts” so checked the help. The fonts were stored in a folder. As there didn’t seem to be an easy way to preview them, I thought I’d just write a script. This would loop through all the fonts I’d copied to a text file, and allow me to pick the best version.

while IFS= read -r font; do
    figlet -f "$font" -c -S "Daily Create"
	sleep 0.5
done < figfonts.txt

Watching them scroll past then made me think a screen recording might be interesting. I cleaned up the list of fonts1 a little and recorded my window, posted it to YouTube and replied to @creating. Job done2.

The next day I wondered if I could do a better job of this: automate the screen capture by grabbing screenshots and then taking them and stringing them together to make a “video” with ffmpeg. And indeed I could.

#!/usr/bin/env bash

WINID=$(osascript -e 'tell application "Terminal" to id of front window')

screencapture -l $WINID  -o  0000.png  >/dev/null 2>&1

while IFS= read -r font; do
	pngfile=$(printf "%04d.png") 
    figlet -f "$font" -c -S "Daily Create"
 	screencapture -l $WINID  -o  $pngfile  >/dev/null 2>&1
	sips --resampleWidth 1200 $pngfile  >/dev/null 2>&1
done < figfonts.txt

ffmpeg -framerate 5 -i %04d.png -c:v libx264  -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" -r 24 -pix_fmt yuv420p figfontfun.mp4

screencapture can capture just a window if you give it a Window ID. A search showed me how to get that. sips resizes the images. I sent the output off screen with >/dev/null 2>&1. Taking a screenshot of the window without shadow, the -o bit, made for neater images.

The loop give me a bunch of png files which are concatenated into a video. I’ve done that a few times. Unfortunately I don’t use ffmpeg enough to get that right the first time. Video codec and many ffmpeg paramaters seem very complicated. Again a few searches put me right3. And I had a short script that would work.

Here is the result:

I am still not sure why writing up this post, trying to put a rather silly idea in order, is satisfying. But it was.

  1. I just copied out the list of items in the figlet font folder to a text file, removed folder and then file names that didn’t work. I am sure a smarter script could do that without the manual clean up. ↩︎
  2. When I say job done I mean footering about for an hour or two with figlet, and QuickTime Player to record the screen. ↩︎
  3. FFMPEG solutions are very searchable. NTS: the bit about rounding sizes to even numbers has bitten me before. Hopefully this footnote will help me remember that the next time. ↩︎

One thought on “Daily Create #tdc5055 catch up

  1. I completely understand that satisfaction of writing the “making of” post. If I just saw your video shared, I might pause and say “that’s neat”. But reading your post, I can feel that sense of curiosity flowing, like I am watching you at work. And I get much more. I might not know one could screen capture on command line or pass it to ffmpeg to make a video.

    I get it so much.

    I do miss the assignment bank site. It is harder to find things as the last redesign seems to have mixed up a few parts.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)