The built-in Stickies dashboard widget lets you use a few Apple-selected fonts, but the selection doesn't have very many options. I wanted a way to add other fonts to the Stickies widget. By adding two lines to the code that supports the widget, you can add any font on your computer.
It may be helpful to have some knowledge of HTML and JavaScript, but the procedure is simple enough that you should be able to do it even if you don't have experience with those languages.
The first step is to make a copy of the widget so you're not working on the original. Go to /Library/Widgets and find Stickies. Copy it and paste it into ~/Library/Widgets and name it something else, like StickiesWithFonts.
Close the Stickies widget in your Dashboard; you won't be needing that version anymore.
Next, we begin modifying the code. You'll need a good text editor like TextWrangler or Fraise (both free).
Now, find the first file we're going to modify. Right click on the copy you made (StickiesWithFonts) and choose Show Package Contents. In the new window that appears, open the Stickies.js file with your editor. Next is to modify the JavaScript code.
To start, find the line that goes
<select id='font-popup' class='popup' onchange='fontchanged(this);'> (should be around line 40).
Below, you'll find a few lines that are similar to each other. Each one begins with<option value.
As with the previous file, copy the last line and paste it below itself. Change the line say <option value='font name'>Font Name</option> where font name is the name of the font you added earlier.
Now, restart Dashboard by opening Terminal and typing killall Dock.
Now you're ready to install the new widget you made. Double click on your StickiesWithFonts in ~/Library/Widgets. It will open in Dashboard.
Choose a font how you normally would, and you'll notice your new font in the popup menu. Select it, and you'll be writing in your newly-added font like this.
Repeat this process whenever you want to add another font.
[crarko adds: I haven't tested this one. As advised, make sure you edit a copy of the original in case something goes awry.]
It may be helpful to have some knowledge of HTML and JavaScript, but the procedure is simple enough that you should be able to do it even if you don't have experience with those languages.
The first step is to make a copy of the widget so you're not working on the original. Go to /Library/Widgets and find Stickies. Copy it and paste it into ~/Library/Widgets and name it something else, like StickiesWithFonts.
Close the Stickies widget in your Dashboard; you won't be needing that version anymore.
Next, we begin modifying the code. You'll need a good text editor like TextWrangler or Fraise (both free).
Now, find the first file we're going to modify. Right click on the copy you made (StickiesWithFonts) and choose Show Package Contents. In the new window that appears, open the Stickies.js file with your editor. Next is to modify the JavaScript code.
- Find the line that goes var fontArray = new Array; (it should be around line 407).
- Below it are a few other lines that are similar to each other. They follow the form of fontArray["font name"] = 0;.
- Copy the last line of this type (probably American Typewriter) and paste it below itself.
- Now, change the line you pasted to this: fontArray["font name"] = 8;.
- For the font name, type in the name of the font you want to add. Make the number at the end of the line one more than the line above it.
- Save this file and close it.
To start, find the line that goes
<select id='font-popup' class='popup' onchange='fontchanged(this);'> (should be around line 40).
Below, you'll find a few lines that are similar to each other. Each one begins with<option value.
As with the previous file, copy the last line and paste it below itself. Change the line say <option value='font name'>Font Name</option> where font name is the name of the font you added earlier.
Now, restart Dashboard by opening Terminal and typing killall Dock.
Now you're ready to install the new widget you made. Double click on your StickiesWithFonts in ~/Library/Widgets. It will open in Dashboard.
Choose a font how you normally would, and you'll notice your new font in the popup menu. Select it, and you'll be writing in your newly-added font like this.
Repeat this process whenever you want to add another font.
[crarko adds: I haven't tested this one. As advised, make sure you edit a copy of the original in case something goes awry.]
•
[4,418 views]

