The other day, I downloaded a number of really cool source files for Metrowerks PowerPlant. I had been teaching myself PowerPlant, and I was eager to look at some good examples. I was a little surprised to learn, however, that all the files I downloaded were saved in a 9 point Chicago font — not my idea of legible.
I began to change the files to the 9 point Monaco that I am familiar with. One file wasn't too hard to change. But after doing 3 files, and then looking at the 68 more files left to go, I realized this wasn't going to be a fun process. I figured I could either spend half an hour doing it all by hand, or I could spend 6 hours writing a program to do it in a few seconds. Several days after hacking together the first working prototype, Source Font Fixer was finished.
And so, my evening's entertainment has become a small, specific tool. I'm distributing it in the hopes that someone somewhere will find it useful.
System Requirements
~~~~~~~~~~~~~~~~~
A Macintosh;
A monitor;
Some brand of keyboard and mouse;
System 7 or better. Try as I might, and I've tried pretty hard, I no longer have sympathy for System 6 users;
RAM (about 250k free (or more) for PowerMacs, 150k free for 68k Macs);
A Hard Disk (about 100k free);
Installation
~~~~~~~~~
The Source Font Fixer program comes in a Stuffit Deluxe archive, which can be decompressed with Stuffit Deluxe, Stuffit Expander, or some other Aladdin products. If you have read this far, chances are you've managed to uncompress the archive.
The archive contains three files, Source Font Fixer, a "ReadMe" file, and this manual. The ReadMe file contains the License agreement and legal information, please read it!
Move the Source Font Fixer folder somewhere on your hard drive. Source Font Fixer is most useful when dragging files and folders onto it within the Finder, so it's a good idea to put the program within easy reach of other files.
Running the program for the first time
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The first time Source Font Fixer runs, it will install a preferences file in the Preferences folder in your System Folder. It will then open the preferences window, giving you the opportunity to change the default settings. For information on the preferences window, see "Setting Your Preferences" below.
- Using the Program -
"Fixing" a File
~~~~~~~~~~~
Perhaps the term "Fixing" is a little intolerant. Different fonts aren't "broken" fonts, or wrongs that must be righted. On the other hand, some fonts are more equal than others. The Source Font Fixer program and documentation refers to changing a file's font settings as "Fixing" that file. This is a subjective world, and you'll have to learn to live in it.
You can direct Source Font Fixer to "fix" a file in one of two ways: through the Finder, and through the program itself. Source Font Fixer is most useful as a Drag 'n' Drop application — that is, as an application primarily invoked by dragging files and folders onto its icon in the Finder. Specifically, you can drag Text files, folders, and disks onto the Source Font Fixer icon, though dropping folders and disks will only have an effect if "Search Folders Recursively" has been set in the preferences.
Source Font Fixer will only alter Metrowerks Codewarrior, Symantec C/C++ (aka THINK C), and MPW source files; it will not alter other files. The Finder may let you drag unworthy files onto Source Font Fixer, forcing the program to run, but do not be fooled — the file will not be changed.
While Source Font Fixer is meant to be primarily used as a Drag 'n' Drop application, it does provide a simple interface for you to "Fix" files manually. To do so, run the program and select "Fix Source File…" from the File menu. Then choose a Metrowerks Codewarrior source file from the standard Macintosh file selection window. A small dialog will appear, allowing you to change the font and size for that file:
The Font pop-up menu displays all the fonts available on your system. The Size pop-up menu will display the sizes available for the font between 3 and 24 points. It is not unusual for some fonts, especially Screen Fonts (BitMaps), to have only one or two sizes available, while other fonts may have considerably more sizes available. The pop-up menus will initially be set to the file's current font name and size.
Note: Strange things can happen if the font named in the preferences file, or if the font named in a source file, doesn't exist on your system. If Source Font Fixer can't find the font named in a file, it will try a number of logical defaults before giving up and selecting the first font on the list. You can encourage me to spend time ironing out this condition by paying the $5 shareware fee.
Setting Your Preferences
~~~~~~~~~~~~~~~~~~~
Source Font Fixer's preferences screen allows you to choose the program's behavior for batch jobs; i.e., when files are dropped onto the program from the Finder. The preferences window can be opened by selecting "Preferences" from Source Font Fixer's "File" menu. The preferences window contains two pop-up menus and two check boxes:
Default Font and Default Size: When you instruct Source Font Fixer to "fix" a file, it will use the font and size specified in the dialog box here. The Default Font pop-up menu displays all the fonts available on your system. The Default Size pop-up menu will display the sizes available for the font between 3 and 24 points. It is not unusual for some fonts, especially Screen Fonts (BitMaps), to have only one or two sizes available, while other fonts may have considerably more sizes available.
Search Folders Recursively: If this box is checked, Source Font Fixer will allow you to drop folders and disks onto the program's icon from the Finder. When a folder or disk is encountered, the entire contents of that folder or disk will be examined, including additional folders. If this box is not checked, folders and disks, and their contents, will be ignored.
Quit When Finished: If this box is checked, Source Font Fixer will quit automatically if the program was started by dragging one or more files or directories onto the program's icon. For example, if this box is checked and Source Font Fixer is not currently running, if you drag some files onto the program icon, the program will start, "fix" the files, and then quit. If the box is not checked, Source Font Fixer continues. This box has no effect if the program is started without documents; e.g., by double-clicking on the program, choosing it from the Apple Menu, etc.
Press OK to keep your changes to this window - changes will immediately be saved to the preferences file; press Cancel to close the window without saving changes.
Viewing the Splash Screen
~~~~~~~~~~~~~~~~~~~~
When Source Font Fixer starts, a small splash screen appears as the program is loading. The program will wait 2 seconds before dismissing the splash screen; you can hurry the screen up a bit by pressing a key or the mouse button. Note that if you have started Source Font Fixer by dragging one or more files onto its Icon in the Finder, the splash screen will remain on the screen as long as files are being processed; this may take more than (or less than) 2 seconds, and it is unaffected by keystrokes and mouse clicks.
You can also view the splash screen by choosing "About Source Font Fixer…" from the Apple menu. The window will remain open until you click or type, it will not go away automatically. This allows you to do two things: 1) write down my address so you can send in your $5 shareware fee; 2) marvel at my lack of artistic ability. Critics, please be gentle.
- Advanced Features -
Source Font Fixer contains some interesting features, some of which are not for the weak-hearted. Suggestions for interesting improvements will be happily accepted.
Push-Button Keyboard Control
~~~~~~~~~~~~~~~~~~~~~~~
Every program that employs push buttons should allow some way for users to choose them without using the mouse. There it is, in black and white. Alas, many programs — many good programs — fail to do this. It makes me sad.
When presented with a push-button (i.e., OK or Cancel), you can choose that button by pressing the first letter in it's title (i.e., press 'o' to select "OK"; press 'c' to select "Cancel"). You may be wondering what happens if two buttons share the same first letter. Well, that's my little secret.
If I were John Norstad, I'd add a check-box to the preferences screen, allowing the users to decide if they want push-buttons to respond to Command-keystrokes or normal keystrokes. Alas, I am not. Pay the fee, that way you can let guilt influence my future development plans.
Editing File Types and Creators
~~~~~~~~~~~~~~~~~~~~~~~~
It has been noted that Source Font Fixer will only let you select Metrowerks Codewarrior, Symantec C/C++, and MPW source files. Behind the scenes, Source Font Fixer has lists of file Types and Creators that it uses to determine if a file is 'worthy' or not. Source Font Fixer comes configured with the ability to recognize all the Metrowerks compilers that I know about (including CW 7's Integrated Development Environment), Symantec C/C++ and older THINK Cs, and MPW. If for some reason (say, file creators change in a future release of Metrowerks Codewarrior - not that that would ever happen) you need to modify the file types, you will need to reach for your old friend ResEdit.
Warning: ResEdit is a powerful tool which can do irreparable damage to things if you are not careful. Always edit a copy of the file you are working with, never edit the original. Mac wizards may, optionally, disregard this warning.
The file Types and Creators that Source Font Fixer recognizes are stored in the program's 'STR#' resources; Creators are stored in ID# 129, and Types are stored in ID# 130. You can change or delete existing Creators and Types, or you can add new ones. Source Font Fixer will recognize any number of Creators, but it will only honor the first 4 Types entered.
Warning: Source Font Fixer performs very little error checking on these resources. If you must change them, please pay attention to these guidelines: 1) Types and Creators must be exactly 4 characters long, including any spaces; 2) do not leave a Type or Creator blank; 3) don't enter a Type or Creator unless you're really really sure it represents a source file with projector information.
Source Font Fixer will do enough error checking to prevent itself from crashing (I think), but, aside from these lists, it takes no responsibility to ensure it doesn't try to "Fix" the wrong kind of file. If you change the Type or Creator list, you are responsible.
Please do not remove any of the 'STR#' resources; though you may remove all the strings INSIDE a 'STR#' resource instead. If the Creator list 'STR#' resource contains 0 strings, Source Font Fixer will not discriminate by file creator. If the Type list 'STR#' resource contains 0 strings, Source Font Fixer will not recognize ANY files. Life is unfair.
- Technical Discussion pt. 2 -
When I first wrote Source Font Fixer, I thought the projector information I was using was unique to Metrowerks. I even went so far as to name this program "MW Font Fixer", make screen shots, stuff it, and prepare to upload it to the world. Then I accidentally realized the projector info was used by all three major platforms — I had to change a lot of resources! If you come across references to "MW Font Fixer" in the program or in the documentation, please let me know; I'll remove them immediately.
Further evidence of my ignorance: I don't know what the format for the projector resource is. If any of you knows the format of the MPSR resource (or knows of documentation describing said resource), let me know, and I'll make some stunning improvements in the program. I am smart enough to figure out font size and name, but I'm not quite willing to invest the time to reverse-engineer the rest of it.
- Credits and Thanks -
Source Font Fixer was written in, and compiled with, Metrowerks Codewarrior release 6. The application is written entirely in C and compiled as a Fat binary. The PowerPC version requires about 100k more RAM than the 68k version — that makes me sad. Debugging was done via Metrowerks' Debugging programs ('cause I can't afford "The Debugger").
Resources were created and modified with ResEdit ('cause I can't afford "Resourcerer").
The splash screen was created in Super Paint 3.0 ('cause I can't afford to buy a new computer, lotsa RAM, Photoshop, Infini-D, Studio Pro, and whatever else). Screen shots for the manual were made using Snapz by Ambrosia. Screen shots were further processed by JPEGView by Aaron Giles, and GIFConverter by Kevin A. Mitchell.
This document was written in Simple Text. I figured out how to put pictures into a Simple Text document all on my own (e-mail me and I'll tell you how). This file uses Geneva 9 for the basic text and Helvetica 14 for the larger titles.
The routine used for enabling push-button keyboard support originally appeared in MacTech Magazine's Tip of the Month ("Hot Tip for Hot Keys." March 1995, Vol. 11, No. 3. Page 67.) submitted by Jeff Beeghly (jbeeghly@u.washington.edu). I discovered an error (a honest-to-god off-by-one error) in the routine — as of when I wrote this, my correction has not been published in MacTech.
The code used for searching through folders looking for files is a file dirscan.c, submitted to the Info-Mac archive by Andrew E. Page. It seems to be public domain. I had to write a small routine to make it understand System 7 FSSpec records.
Inspiration for writing this program came from a huge number of PowerPlant classes uploaded to Info-Mac in late August/early September by Éric Forget <ForgetE@aol.com>.
Thanks go to Metrowerks for making awesome compilers; Symantec for at-one-time-in-the-distant-past creating and supporting good compilers and development tools (notably THINK Pascal and THINK Reference); everyone who keeps the Mac programming faith alive by writing books and messages to comp.sys.mac.programmer.*, uploading source code, and the like; people (like me) who actually pay shareware fees; and lastly, Clarus the DogCow — I have always loved you.
About Azathoth Software
~~~~~~~~~~~~~~~~~~~
If you want, you might go looking for other Azathoth software products:
CPU Reporter
A small program that displays the Mac's CPU model in a small window bar — good for people with PowerMac Upgrade Cards who forget what CPU they booted off of. $5 Shareware.
Simple Sockets
A Berkeley sockets implementation for MacTCP. It's a simple implementation, supporting all the major BSD socket routines (including select, accept, listen, etc.). The code is small, well documented and structured, and is good for people who want to learn MacTCP programming. Public Domain.
Ult. 3 Character Editor
A character editor for Ultima III '95, the surprise shareware resurrection hit of the year! Freeware.
Coming Soon:
A nifty file naming utility. I know that sounds stupid, but give it a chance… $5 shareware.
Be warned: I just bought a Newton Message Pad 100 (for $150 bucks! What a bargain!!) … Once I can afford a Flash Card and the real (not restricted) Newton ToolKit, there's just no telling what will happen!
Azathoth Software can be contacted via mail and Internet e-mail at:
Michael D. Trent
Azathoth Software
3302 Leopold Way #110
Madison, WI 53713
mtrent@msn.fullfeed.com
mtrent@epicsys.com
trentmd@stu.beloit.edu
(e-mail addresses are listed in preferential order — try msn.fullfeed.com first, moving down the list only if you have trouble sending there.)
- Legal Stuff -
Licensing agreement
~~~~~~~~~~~~~~~
Source Font Fixer is $5 shareware. If you find this program useful, and you decide to keep it, please pay the $5 fee. Please send your payment to:
Michael D. Trent
Azathoth Software
3302 Leopold Way #110
Madison, WI 53713
Legal Stuff
~~~~~~~~~
Although copyrighted, Source Font Fixer may be freely distributed by electronic means, provided that it is not modified in any way and that it is accompanied by all of the original documentation unaltered. However, ownership of and interest in this software, together with all associated codes, techniques, software tools, formats, designs, concepts, methods, ideas, and documentation shall remain with the author. Use and distribution of this software is governed by the following terms in an effort to reasonably ensure that this software will remain freely available and that no one other than the author will derive a commercial benefit from distributing this software.
You may:
1. Use this software on as many computers as you want.
2. Make as many backup copies of this software as you want.
3. Freely distribute this software via wire or electronic communications (BBS's and online information systems) for the sole purpose of use by their customers.
4 Terminate this agreement at any time by destroying all copies of this software and derivatives of this software and cease distributing the same.
You may not:
1. Create any derivative works from this software for distribution.
2. Charge money for this software other than reasonable charges for downloading time or shipping expenses.
Disclaimer of warranty:
In using this software, you understand and agree that this software is provided “as is” without warranty of any kind. The entire risk as to the results and performance of using this software lies entirely with you, the user. The author does not make any warranties, either expressed or implied, including but not limited to implied warranties of merchantability and fitness for a particular purpose, with respect to this software.
In no event shall the author be liable for any consequential, incidental, or special damages whatsoever (including without limitation damages for loss of critical data, loss of profits, interruption of business, and the like) arising out of the use or inability to use this software. Because some states do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitations may not apply to you.
Although the author would appreciate any feedback and bug reports, the author shall not be responsible for correcting any problems which you discover or otherwise help you maintain and use this software. Furthermore, the author may at any time replace, modify, alter, improve, enhance or change this software.
Complete agreement:
This agreement constitutes the entire agreement and supersedes any prior agreements between you and the author concerning this software. This agreement cannot be amended, modified, or waived except in writing.
General:
If any provision of this agreement shall be found to be unenforceable, it shall be deemed severed from the remainder of this agreement.