In my last post, I discussed how you can use AutoHotkey and SlickRun to quickly display useful text information. Although I’ve been using that technique for months to show me my credit card number, and often-called phone numbers, I recently decided that I wanted to do more. Specifically, I wanted to be able to quickly see a yearly calendar. You know, you’re thinking about something, and suddenly need to know exactly what day the 5th of October is?
My normal technique is to simply minimize everything on my desktop (Win + M key) to see my desktop background. That’s because I’ve got tiny calendars of the next three months sitting there, courtesy of Samurize (see my posts on my desktop for more details). But, really, that’s a pain to do. So I said to myself, why not a popup box with a calendar? And heck, go big, show the whole year at once!
So, using the Cygwin “cal” command, I created a text file, called year.txt, that contains the 2007 year in text. I’m including it here, in case you want to use it, but don’t have Cygwin installed.
Then, using the technique discussed previously, I set up an AutoHotkey script to read the file, and a SlickRun magic word to launch it with a couple of key strokes.
Unfortunately, when I use a message box with calendar information, the default proportional font looks absolutely awful. Unreadable really.
Changing Windows Default Font for Message Boxes
So, I decided to try switching the Windows default font for text boxes. You can get to this from the Control Panel’s “Display Properties”. Go to the Appearance tab, and then select the “Advanced” button. You want to change the Font value for the “Message Box” Item. I’m a big fan of Bitstream Vera Sans Mono. Here’s what your dialog would look like. You can pick any fixed-font for the font. Even if you’ve never installed any extra fonts on your machine, you could use Courier New.
Click OK, and then Apply on the Display Properties window. Now, all message boxes will use this fixed font. I figured that for how often I see a message box, it wouldn’t bug me too much to see a fixed-width font there.
Look at How Pretty It Is
Here is what my yearly calendar looks like now, using the Bitstream Vera Sans Mono font:
Isn’t that pretty? What a clever little solution I found. How easy was that?
Ugly Side Effect
Was I ever surprised when I looked at my FireFox next! Most of the fonts in the FireFox application seem to be based on the same font that the Windows message boxes use. Not the guts of a web page, but things like the address bar, search bar, bookmarks bar, tabs, and status bar. It looked bizarre, to say the least.
Here’s what FireFox used to look like:
And now here’s what it looks like:
I didn’t mind so much on the status bar, but I found the effect really distracting on the tabs, and even in the Extensions list.
Fixing FireFox Fonts
Given how much customization people do with their FireFoxes, I figured there had to be a way to fix this. And there is. You do have to modify your userChrome.css file, which actually isn’t as scary as it sounds.
One of the best sites I found discussing the userChrome.css file was here. The author tells you how to find the file if it already exists (and it might, if you’ve done some other customizations), or how to create it with a text editor. He’s also got several things to stick in there to make other changes to your FireFox.
However, I just used that page to make sure I was editing my file properly. The change that you want to make, to “undo” the font problems caused by changing the Windows default font for message boxes, is as follows:
You want to add the following code to your userChrome.css file:
/* Set font size and family for dialogs
* and other miscellaneous text
* http://www.mozilla.org/unix/customizing.html#usercss
*/
window, tooltip {
font-family: ‘Microsoft Sans Serif’ !important
}
I got the idea from the Mozilla.org Customizing Mozilla page. The example they have their changes the font of everything to Helvetica, with a size of 3.5. I didn’t want that (although you might); I just wanted to change it back to the default font, which is ‘Microsoft Sans Serif’. (Don’t forget the single quotes!)
So, add that little snippet to your userChrome.css file. Save the file. Close FF and reopen it. Now, your FireFox should look right, and you can still have nicely fixed font message boxes.
The example from the Mozilla page didn’t completely fix FireFox though - tooltips were still showing with the fixed font.
So, based on an example from here, I added in the “tooltip” to the code above. That fixed the tooltips, and “window” seems to take care of the rest. There’s probably something else I’ll need to fix, but I’ll just have to keep plugging away at it :)
Update [6 Aug 07]: Instead of using a fancy font like Bitstream Vera Sans Mono, you might be better off using one of the standard fonts that come with Windows, like Courier New. Although I love the look of the Bitstream Vera Sans Mono, I noticed that I was having trouble with other applications. For instance, my SnagIt window couldn’t show some of its menu choices. No idea why, but switching to Courier New fixed that. There may be other things that look hinky. Personally, I’m willing to take a bit of hinky to get the year calendar available with a couple of keystrokes. Your mileage may vary :)









