Cow Font for pdfLaTeX

Cow font in some of its glory.

Cow font in some of its glory.

Way back, there were cows. Duane Bibby, responsible for the cartoons that adorn a lot of TeX and LaTeX material, drew some cows.  This font is part of ConTeXt, a TeX implementation.  There is no simple way to use it to its full extent on LaTeX that I know of.  But you can do this:

  1. Download
  2. Extract the archive and make sure all the files go into the right places.  I would use your local (userspace) texmf tree.  For example /home/username/texmf (on Linux).  If you extract the file to a temporary directory, you can see that it obeys the Tex Directory Structure.  I must confess I just manually moved the tfm files from their place in the temp folder to /home/username/texmf/fonts/tfm/hoekwater/koeieletters/ and similarly for the other types of files just because I was not sure what would happen if I did it all automatically.
  3. You can try running the rehashing and map updating commands like:
    sudo mktexlsr


    sudo updmap-sys --Enable Map

    and who knows what else — it is always a bit vexed whether you need sudo and whether to use updmap or updmap-sys.  I can’t help there.

  4. The rehashing did not work properly for me.  When I ran pdflatex on my test file (see below), it found everything except the map file that tells pdftex what PostScript fonts to associate with what TeX font names.  After messing around for too long, I…
  5. …Typed
    find /usr/ -iname "*.map" | grep pdftex

    to find out where the pdftex-related map files were kept and used sudo cp to stick the file in there manually (a bit naughty). (It was called in the archive.)

  6. Did the rehashing/updating again, and now it all worked.  But…
  7. …There is no ‘cowfont.sty’ to load to use the font in LaTeX.  So I went here: and stole the example file.  Then it worked.
  8. And one more thing: If I did not want to manually stick the map file where only root ought to tread, I could have use the commented-out line in my example below, which directs pdftex to the map file explicitly.  For something as un-useful as cow font (i.e., something that really does not need to be installed system wide), this is a reasonable thing to do.
  9. Does not work for LaTeX outputting to dvi, just for pdflatex.

The example .tex file:

% For scalebox, load this:

\DeclareFontShape{T1}{CowFont}{m}{n}{<-> koeieletters}{}

\DeclareFontShape{T1}{CowFont-contour}{m}{n}{<-> koeieletters-contour}{}

% This next line told pdftex where to find the map file explicitly. Managed to
% remove the need for it but left in for information.


The quick brown cow jumped over the lazy fox.



The quick brown cow jumped over the lazy fox.


And then back to normal text.
% This bit it just to get some big output to use as a screen grab in
% the blog post. And to show some characters.
\scalebox{2}{``The cow JumPed oVer the Moon.''}\\
\scalebox{2}{" \textbackslash\ * () \_ + = ? < > "}


Also useful to look here:


Font pointlessness.

Tags: , , , , , , , , ,

About Darren

I'm a scientist by training, based in Australia.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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

%d bloggers like this: