💾 Archived View for sotiris.papatheodorou.xyz › gemlog › 20241127_re_a_compact_calendar_pocketcal.gm… captured on 2024-12-17 at 10:10:17. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
A few days ago I saw Dominique's excellent compact calendar. It's a yearly calendar that's designed to be printed on a piece of paper small enough to fit in a wallet. This inspired me to make my own pocket calendar generator.
The efforts of the past couple of days resulted in pocketcal, a small printable calendar generator. The calendar layout is s̶t̶o̶l̶e̶n̶ ̶f̶r̶o̶m̶ inspired by Dominique's. The program generates a PostScript file designed to be printed on A4 paper. Each page of the generated file contains the calendar for a single year, tiled on the page multiple times. When printing the generated file double-sided, calendars on both sides of the paper should align. This allows cutting a part of the page and obtaining a small calendar with a different year on each side.
Pocketcal is written in C99 and requires no dependencies other than the standard library and getopt.h. The C code isn't that interesting as all it does is compute the weekdays for the first week of each month. This also accounts for almost all of the program-generated PostScript, the rest being written by hand to do the calendar rendering and positioning on the page. A notable feature is the dynamic tiling of the calendar on each page. By simply changing the font size in the generated PostScript file with a text editor, the number of calendars on each page is automatically adjusted.
Now to actually print it...
Sotiris 2024-11-27