Text File Strip Calendar

Text File Strip Calendar

As I was working on my text-file based tracking workspace, I remembered a kind of calendar I used to make back in the old days.

"Text Calendar" I think I first made this calendar sometime in the mid 90s when I was working for Qualia, Inc., a startup game company that I was part of as a game designer and project manager. I was so green, I didn’t know what project management actually meant, and I still placed more value on what I could make with my hands rather than how I could lead a team. But we were young and our bellies were filled with fire; the team members have since gone on to have rich and rewarding careers.

Anyway, at the time I needed some way of showing elapsed calendar time on a monospaced display, as our project intraweb used PRE tags to avoid doing a lot of HTML markup while updating our project files. I haven’t thought of this calendar style in quite some time, but it’s great for text files if you need to provide monthly context.

Fitting Days to 80 Columns

My goal was to fit as many days as possible onto a typical 80- to 132-column text display. 80 columns is the magic number that’s burned into my head from the 80s, and most printers of the time assumed this when printing (all printers had the ability to print text straight as a teletype back then…I’m not sure if this capability has gone away). These days you can print graphically at very high resolutions or make your web page really wide, but back then a typical monitor was probably 640×480 to 800×600, with 1024×768 starting to really push the limits of what CRTs were capable of displaying with reasonable quality. Anyway, an 800×600 screen gives you about 100-132 characters to work with, assuming a character matrix of about 6×8 pixels and margins for the various application windows. My point is that resolution was precious.

If you want to make a compact horizontal strip calendar in text, the first instinct is to do this:

APRIL 2007 .. Mo Tu We Th Fr .. .. Mo Tu We Th Fr .. .. Mo Tu We Th Fr .. .. 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22

Unfortunately, each day takes up three horizontal characters. If you compress the numbers vertically, you can get one day per column:

APRIL 2007 .mtwrf..mtwrf..mtwrf..mtwrf..mtwrf..mtwrf..mtwrf..mtwrf..mtwr 0000000001111111111222222222230000000001111111111222222222233 1234567890123456789012345678901234567890123456789012345678901

This actually fits TWO months in less space than the first example. Admittedly it’s hard to read, but this is where the application of toning and grouping can make a big difference.

Here’s an example:

Effectiveness of Grouping in Text Editor, Word, and Illustrator In order from top to bottom:

  • Text Editor: I’m using a font I like called Vera Sans Mono, which is open source licensed by Bitstream to The Gnome Foundation. In short, it’s a free download, and it’s one of the nicest monospaced fonts I’ve come across. It’s much nicer than Courier, which is the default monospaced font for a lot of Windows text editors. While Vera Sans Mono helps legibility—I should note that the use of periods to replace Saturday and Sunday also helps visually group the week—, there’s little control over spacing between characters and between lines. What we want to see is the days reading as single units grouped into a strip that represents the month.
  • Microsoft Word: While Word gives us the ability to color-code text, that’s about it. We can’t control the interletter spacing or shrink the linespacing between the two rows of numbers; that would have allowed us to make the numbers read a little better. This example is also using the Courier New font, and you can see while it’s legible, it has a kind of looseness compared to Vera Sans Mono that makes the entire strip into a gray blob. Using a lighter gray for the weekend days helps bring back the sense of grouping, but it’s not great. The biggest crime is that the vertical space between the rows of numbers is greater than the horizontal space between them, which breaks the grouping that we’re trying to establish. Bah.
  • Adobe Illustrator CS2: When it comes to adjusting type, it comes back to Illustrator. We can not only add more space between all the letters, but we can adjust the line spacing so that implied grouping through adjacency is working. I could have increased the inter-letter spacing more to make it more obvious, of course, but this felt about right. You could import the EPS into a Word document if this is the way you want to go, though it sort of defeats the purpose of having a nice way to insert compact calendars in-line with your text document. On the other hand, Word is a terrible program for maintaining formatting, so using EPS might be the way to go. Of course, once you’re making EPS files, you have the option of varying the size of the text a lot more, or flipping the numbers on their side, multiple fonts, and using background colors to push the legibility of the design even more, so the point of the exercise becomes rather academic.



p>So what’s the point of all this? Sometimes it’s handy to be able to quickly make a calendar in your text document for reference. They’re easy to make because you can copy/paste the ..mtwrf characters and paste it over and over again. Same with the 1234567890 characters. The tricky part is knowing the starting and ending days of the month, but it’s easy once you have any given date. Use the knuckle mneumonic to know how many days there are in a month. You can quickly generate the calendar in whatever application you happen to be using.

If you’re interested in the source files, there’s a link below. They’re nothing fancy, but you can get a feel for how you might create your own text strip calendar in your own documents.

» Download TextCalendar.zip — contains TXT, Microsoft Word, and EPS versions of this file. The EPS may require you to download the vera sans mono font.


  1. Mike in Montreal 17 years ago

    Hi David,

    “While Word gives us the ability to color-code text, that’s about it. We can’t control the interletter spacing or shrink the linespacing between the two rows of numbers”—Have you looked at Format > Font > Character Spacing?  It allows you to “kern” your text horizontally.  I’m not sure from your context what you were after, but I thought that might help.

    Oh, and the way you “folded” the date #s vertically to conserve space was a great little trick – just the kind of thing that seems to be your forte.


  2. Dave Seah 17 years ago

    Mike: You’re absolutely right!!! I was looking all over for this last night in Word 2007. “I could have SWORN that this feature was in here somewhere”, but I completely missed the character spacing tab. And I guess I was ready to believe that Word had let me down (I had been trying to get it to insert a border between two paragraphs without any luck, and chalked it up to it having a nasty layout engine).

    Excellent! This is actually good to know, because there’s some nasty spacing I can fix up next time I have to write something in Word :-)

  3. Mark 17 years ago

    You have a June 00, in between June 09 and June 11.

  4. Caleb 17 years ago

    Dave –

    Thanks for the great tip – the technique is spot-on.

    Another thought for MS Word – to play with the line spacing, under the Format > Paragraph menu, try the “Line Spacing” setting.  Changing the drop-down to “Exactly” of to “Multiple” and playing with the setting can get you there, I think.

  5. Dave Seah 17 years ago

    Mark: Ooops, I see it :-) There’s the downside of hand-generated calendars :-)

    Caleb: I did try that but failed :-) I was having trouble with word getting it to obey the line spacing differently for each line (it tended to set all of the lines, instead of just the line I had selected). Maybe I need to define a custom style though. I’ll have to play around with it and see if I can’t get closer to it.

  6. Kenny D. 17 years ago

    Why not just use the “cal” command on Unix, Linux, MacOS/X, and Windows with Cygwin installed?

    The output is plain text, computer generated, and I think easier to read.

    A quick google search turns up example screenshots and an article about it: http://jack-of-all-tradez.blogspot.com/2006/11/command-line-calendars-on-linux-cygwin.html

  7. Dave Seah 17 years ago

    Kenny D: Cool, I wasn’t aware of the cal command. I should make something to generate the strip calendar. The main purpose of this, which the cal command does not directly address, is to be able to insert a compact calendar directly in-line into a planning document. There are advantages of strip-time layouts in estimating across month boundaries because of the simple continuity of the horizontal line; I talk a bit about this subject more in my compact calendar post. If you just want to see what day it is, the cal command along with other traditional calendars works fine. My application is a little different: planning and forecasting.

  8. Darius Bacon 17 years ago

    Here’s some Python code to make one of these. Save it in a file called stripcal.py. Then, for example, at the Python prompt:

    print stripcal.months(2007, [4, 5])
    April 2007             May 2007


    import calendar

    weekdays = ‘mtwrf..’

    def month_strip(year, month):
      weekday_row = []
      tens_row = []
      ones_row = []
      for week in calendar.monthcalendar(year, month):
          for day, weekday in zip(week, weekdays):
            if day != 0:
              tens_row.append(str(day / 10))
              ones_row.append(str(day % 10))
      return ‘’.join(weekday_row), ‘’.join(tens_row), ‘’.join(ones_row)

    def months(year, months):
      month_row = ‘’
      weekday_row = ‘’
      tens_row = ‘’
      ones_row = ‘’
      for month in months:
          w, d0, d1 = month_strip(year, month)
          month_name = calendar.month(year, month).split(‘n’)[0].strip()
          month_row += month_name.ljust(len(w))
          weekday_row += w
          tens_row += d0
          ones_row += d1
      return ‘n’.join([month_row, weekday_row, tens_row, ones_row])


  9. timetrap 17 years ago

    Great code Darius, but it looks like the comments took out your backslashes.

    If anyone wants to use this code remember to put a backslash in front of the two ‘n’ statements. Other wise the python code will not format correctly.

    David: Great site, keep up the good work, design and information go hand in hand.

  10. Dave Seah 17 years ago

    timetrap: thanks! I’ll re-insert the s.

  11. hue williams 11 years ago

    hi Dave, i am looking for a .txt calendar template that does not require anything like word etc…thank you