Mike Bailey

pretty code samples in presentations

Filed under: presentations — Mike Bailey @ 3:32 am on July 6, 2007

Today is deprec day (well, the start of a deprec long weekend actually!).

I started the day with some procrastination. I decided to learn how to make super awesome eyecandy ruby slides in Keynote. I love presentations that include code samples and want to be able to make mine look good with as little effort as possible.

First I installed a Textmate bundle called Copy as RTF that copies a selection to the clipboard while preserving syntax highlighting and optimizing font size for pasting into Keynote.

Then I found the ultimate pretty font (slides 14 + 15) but can’t work out it is. I tried all the fonts on my MacBookPro to no avail. Then it occurred to me that I want a fixed width font to display code. And my Mac has only four of them: Monaco (which is the default for textmate), Courier, Courier new and Andale Mono.

make_resourceful slide - what font is that?

So what font have they used?

update - I found the font!
It’s Sunday night and I decided to have another crack at matching the font. Adobe Reader lists the fonts used under ‘Document Properties’. There’s a Textmate page listing alternative fonts. Guess what? BitstreamVeraSans and DejaVuSans are listed in both the document properties and the list of free fonts! I installed both and I reckon the winner is DejaVuSans-mono (download).

I got my Apple MacBookPro using this font by copying it to /System/Library/Fonts.

update 2
I had a problem with CopyasRTF. When pasting onto a black background in Keynote, all white text is turned black. I managed to fix this by changing the default color_index to 45 (from 0) as shown below.

unless new_style[:color_index]
new_style[:color_index] = 45
end

3 Comments »

  1. Doesn’t look like ProFont either.

    Comment by faisal — July 6, 2007 @ 4:56 am

  2. Looks like Bitstream Vera Sans Mono, available here: http://www.gnome.org/fonts/

    Comment by Walter — July 6, 2007 @ 5:09 am

  3. Thanks for the colour fix. Now slap Max around til he releases a fixed version :)

    I might also investigate porting http://python.net/~gherman/emkey.html to Ruby.

    Comment by Dr Nic — July 30, 2007 @ 5:28 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

Copyright 2007 Mike Bailey. All Rights Reserved