QZ qz thoughts
a blog from Eli the Bearded
Page 8 of 146

New logos, in bulk


After my last post, I got to thinking logo making was far too manual, so I decided figure out how to get Imagemagick to generate the images for me. Imagemagick is a powerful set of tools, but it has super shitty documentation. What you can find, however, is example usage which is sometimes enough to get you going. Testing with on-hand TTF files I was able to convince myself this would work.

Then I started looking for fonts. I found Font Space. There are more fonts than I'd want to shake a stick at, but it suffers from some odd organization. The list of tags associated with, say, "Vegan Style", means it comes up in tons of searches. It's a tattoo font, and a summer font, and a vintage font, and a modern font, and a tropical font, and a sexy font, and a resume font, and a fun font, and a recipe font, and a Christmas font, and I could go on. Anyway, I found a lot of fonts and started downloading.

Fonts from there are all zip files. Some of which have subdirectories, many of which have multiple font files within the zip, and all of which seem to have bad Unix file permissions. I wrote my script to accomodate all that. Hand it a zip, and it pulls the fonts out, constructs an image with that font, and then deletes all the temp files.

The logo-tool works relatively fast. On my slow, cheap, computer I made 1944 images from 846 font zip files in about 12 minutes. It took me a lot longer to find the files at Font Space, and a lot longer to sort the output into "use" and "do-not-use". Because I don't want all of the bold and the italic and the outline and the bold-italic and bold-outline ... versions of a font. I kept one or two from most fonts, but discarded all from some because, eg, the font lacked a glyph for "Z" or ended up being totally unreadable.

How I did the sorting is worth sharing. I love the Linux image viewer feh, it is fast, flexible, and powerful. In this case I updated an old tool of mine called fehcopy to have a "move" mode, then created a new "theme" for feh:

$ echo "fontsort --cycle-once -A 'fehcopy -m -d ../do-not-use %f'" >> \
  $HOME/.config/feh/themes
$

The --cycle-once bit means feh will not restart from the beginning upon reaching the end. The -A action argument is the powerful one. When I hit "0" (zero key) on an image, it will run that command with %f being expanded to the current filename. Then it's just a matter of going through hitting space (for keep / next), zero for do-not-use, and sometimes "p" for previous when I want to compare a pair of files. feh supports up to ten different actions, using 0 to 9 to trigger them. I wrote fehcopy years ago to help with that sorting stuff between a bunch of directories. I can't recall why I preferred copy to move now.

Themes in feh can be invoked in two ways. I used the simpler way for this feh -T fontsort, the more complicated (but good for frequent use) is create a symlink to feh with the name of the theme, then run the theme as a program. I use that with my fehonce theme now, and I've had others in the past:

$ grep fehonce $HOME/.config/feh/themes
fehonce --scale-down --cycle-once
$ cd ~/bin/
lrwxrwxrwx 1 elijah elijah 12 Nov  3  2013 fehonce -> /usr/bin/feh
$ 

Anyway, that's how I have 891 new logos today.