News

( My personal website has gone to dust, any links thereto will fail. This site will be home for a while. )

Friday, 25 July 2008

Adding folders of fonts to a Pog

Hello world,
I was asked in an email the other day if I could add a function to gather all the fonts in a given folder into a Pog. While this is a cool idea for a future release, it's possible right now from the command-line. Lemme show you how.

Open a console/terminal (like konsole or gnome-terminal). I will use square brackets [ ] to surround the command you can type but don't type the brackets. I will use ~/somefonts as the example folder you want to use.

The idea is to build a pog, which is a plain text file containing full paths to each font file. Okay, let's start:
  1. Use [cd ~/.fontypython] to go where the pogs live.
  2. [echo "not installed" > newpog.pog] You can use any name you want. Just make *sure* you don't overwrite some other pog!
  3. [find ~/somefonts -iname "*.ttf" >> newpog.pog] That will go and find the ttfs (you can change that to say "*.otf" but Type1 fonts might be more tricky) and then it will append them to the 'newpog.pog' file you just started.
  4. If you want to add other fonts from other folders, just use the same find command, but change the path. Make sure you use 2 ">" symbols (>>) because that means append-to.
Right, that's it. Now open fonty and go look at newpog:
[fontypython newpog]

You can also install those fonts with:
[fontypython -i newpogs]

Have a look at [fontypython --help]

Simple, I hope ;)
\d

No comments: