Apple's OS X is basically a UNIX system; as such it supports the many open-source programs available for UNIX and LINUX, including the ones that create the environment in which Guiguts can run: the Perl language, the Tk interface toolkit, the Aspell spelling checker, and the Tidy utility. These items are not installed in your OS X system by default, but you can add them. In the process you will need to become something of a UNIX expert.
The following page covers two topics: first, the lengthy process of installing Guiguts and its open-source environment for the first time. A much shorter topic at the end tells how to update Guiguts for a new version.
These instructions are based on OS X 10.4 "Tiger." The process in Tiger is somewhat easier than in the older OS X 10.3 "Panther." If you are still using Panther you might postpone this installation until you are ready to upgrade to Tiger.
Open-source installations require you to issue UNIX commands. Some of these are "privileged," that is, issued under the authority of a system administrator, so that files can be written into system-owned folders.
The following steps are for the person who has never used the UNIX command-line. If you have already ventured into the open-source world, for example using the Fink and Fink Commander tools, follow along to make sure you have all the right environment variables set.
Launch the program Applications> Utilities> Terminal.app. Enter the command
Open the menu item Terminal> Window Settings... and from the popup menu, select Buffer. Click the choice for Unlimited Scrollback. Now there will be a complete transcript of everything that happens in a Terminal window. You can select text in the Terminal window and paste it into other programs; for example, you can email a transcript of a failed installation to another user for help.
Optional fun: in the Window Settings, pop up the Color choice. Set the color of text to white; set the background color to a nice deep blue or purple; and set the Transparency slider to the second or third division. Now your Terminal windows look like blue glass.
In most single-user OS X systems, there is only one user defined; that user is automatically logged-in when the system boots; and that user is also an administrator. Are you, in your normal work as a post-proofer, an administrator? Launch System Preferences and click on Accounts:
When you enter commands in a Terminal window you are entering them to a command shell. There is more than one of these, but if you've not used the terminal before, you almost surely are using the default bash shell. (If you know enough UNIX to have set yourself up with a different shell, you know all this.)
One service of the shell is that it maintains a set of environment variables which you can think of as a set of extra input values to any program you run. There are a few of these environment variables that are not set by default, and that need to be set for all normal use. You can arrange for all the needed values to be set automatically whenever you open a new terminal window, by creating a file named .profile (note the leading dot) in your home directory. Enter the following two commands in your terminal window:
If you know UNIX and have set up to use ksh or tcsh instead of bash, review this page and make sure your login sets the same items in some fashion.
Guiguts uses the Tk interface kit to create its user interface. It would be nice if Tk supported the OS X Aqua window manager but it does not; it uses instead the X window system, an older window manager that is not installed in OS X by default. See if you already have X11 installed: look in the Utilities folder in the Applications folder for a program named X11.app. If it's there, proceed to testing it.
X11 is one of the optional packages in the Tiger distribution. If you are installing Tiger for the first time, find X11 by clicking Customize instead of Easy Install. The X11 package is the last item in the list. Select it to include X11 as part of your Tiger ugrade.
If you have already installed Tiger, mount the Tiger DVD and scroll down its window until you find Optional Installs package:
Double-click the X11 application. After a few moments a very plain little window titled xterm opens. This is a UNIX terminal; enter a command like ls -l to verify it's working.
The X11 environment lets you start multiple programs, each using X11 to create its user interface. Enter the command
You need Apple's Developer Tools package because the installation process for various open-source packages requires compiling source code. Unlike Linux, OS X doesn't come with a compiler by default. You may have already installed the Developer Tools; if you have, there is a top-level folder named Developer on your boot drive.
Mount the Tiger distribution CD (see picture earlier) and double-click the folder Xcode Tools, and in it, double-click the package XcodeTools.mpkg. This brings up an installer in which, by clicking Customize, you can select the minimum tools you need:
You have now prepared OS X to compile and run open-source software. The first packages of open-source software are extensions to the Perl language. Thousands of Perl extensions are maintained by devoted volunteers at the Comprehensive Perl Archive Network or CPAN. CPAN is not only a software archive and a website, but a standard extension to Perl. Perl and CPAN are both included automatically in OS X.
To install Perl extensions we will invoke cpan in a terminal window. We will use the OS X terminal because, unlike the Xterminal, it keeps a scrolling history of commands.
Some of the installations that follow expect that X11 will be running when they perform functional tests. So start X11 and leave it running in the background.
In your terminal window, start CPAN in privileged mode as follows:
If this is the very first time you have ever used cpan, you may be prompted to enter a rather lengthy manual configuration process. Open this commented transcript in a separate window and proceed through the interrogation.
With configuration out of the way, we can start installing. In the following, remember that CPAN module names are case-sensitive; "ToolBar" is not equal to "Toolbar." Also understand that you can end the cpan session at any time by entering a command of quit, and restart it later with sudo cpan.
Begin with the LWP bundle, comprising code that lets Perl programs browse the web:
Now the big one: the Tk bundle of code that lets Perl programs use the Tk user interface package. Guiguts uses this for its entire interface.
The following commands install three smaller modules that Guiguts uses:
Guiguts and friends work best when file pathnames are short and simple, like /dp/pp/bookname (note the leading slash, indicating the folder is at the top level of the boot drive—not in your user folder). Enter these commands to make a top-level folder for your PGDP work.
Also use the Finder to make a new folder pp (for "post-proof") inside /dp. This is where you can keep your projects: each book will be a folder /dp/pp/bookname.
Go to the Guiguts site and click on the link to download guiguts.zip. Double-click the downloaded zip file to unpack it. Drag the resulting folder named guiguts into the dp folder. Then you can throw away the zip file.
In a Terminal or an Xterminal window,
Use the Xterminal window (so you know that X11 is up) and issue the commands
In the Xterminal window do:
You may already have the excellent image viewer and converter, GraphicConverter. If not, consider using it to display and manage PGDP image files. You can use it as the page-viewer from Guiguts. You can also use it on its own to process book illustrations, either singly to crop, align, and adjust contrast, or in batch mode, for example to make scaled-down copies of every image in a folder.
Download GraphicConverter and, following its instructions, just drag the application GraphicConverter into the Applications folder.
Now, to make it possible for Guiguts to invoke GraphicConverter when you want to view a page image, you need to create the following, two-line file:
Use File> Save As to save the two-line file in /dp/guiguts under the name launchgc.sh.
In the Xterminal window, make the file executable:
When you click the See Image button in Guiguts, it sends the open message to GraphicConverter, which displays the page in a new window. When you are looking at a page image in GraphicConverter, typing cmd-right-arrow causes GraphicConverter to open the next file in sequence in the same window. Typing command-left-arrow opens the preceding image. Thus once you have one page image open in GraphicConverter, you can step forward and backward through the book.
An image viewer is included with OS X, the Preview application. You can use Preview as your Guiguts image viewer by preparing the file launchgc.sh as described above for GraphicConverter, but with the following contents:
Preview, in Tiger, has a useful option that makes it open page images at a good zoom factor. Launch Preview and select Preview> Preferences. Click the Images button. Set the choice Default image size: Scale large images to fit window. Also set the option "Respect image DPI..."
If you choose Preview as your page-viewer, you can work in either of two ways. The simple way is to let Guiguts call Preview for any page you want. You click the See Image button; Guiguts calls Preview; Preview opens the page image in a new window.
Here's another way. Before you start Guiguts to work on a book, launch Preview. Select File> Open. Navigate to the pngs folder of the book. In the open dialog, select all the pages of the book (click any one, then type cmd-a to select all) and click Open. Preview takes a deep breath and opens all the pages of the book. The pages appear in the thumbnail drawer and you can rapidly scroll through them. Cmd-up/down arrows step through the pages one by one. Now you can view any page without clicking the Guiguts button. When you do this in Tiger, if you click Guiguts's See Image button, nothing will happen. It sends the "open file" message to Preview and Preview says, I already have that file open, and does nothing.
The recommended page viewer for Guiguts under Windows is XnView. XnView is a free program that under Windows, does much of what GraphicConverter does in OS X. You can download an OS X version of XnView; it is an X11 application. The downloaded file expands to create a folder named viewer. Drag this folder to your /dp folder. You can launch the program from the Xterminal window with the command /dp/viewer/xnview &.
Unfortunately there does not appear to be any way to control the window size, window location, or zoom factor with which XnView for OS X opens an image. If you use XnView for your viewer you will have to move, resize, and re-zoom every image you display. (In fact, from the lack of change on the program website, it appears that XnView may be dying or losing its maker's attention.)
Guiguts uses the open-source program Aspell to perform spellchecking (an essential post-proofing step). Currently Guiguts requires version 0.5x of Aspell. Although this is not the latest version, it is still available; this is a link to the zip file.
Download that file and double-click it so that OS X unpacks it to form a folder aspell-0.50.5. Drag this to your dp folder.
In your terminal window perform the installation. Interestingly, this installation will not work in Tiger with the new, gcc 4.0 compiler; you must switch to the older gcc 3.3. Here are the commands to issue:
From the archive of Aspell dictionaries you need to download at least one dictionary. The following link: dictionaries is an ftp link. With most browsers you navigate it as a web page, clicking on a filename to download it. if you are using Safari, clicking it will open a new Finder window named "dict" containing many folders with two-letter names that stand for languages. Navigate in it and copy files from it as you would in any Finder window; when you are done, click the "eject" symbol to eject volume "dict."
Download at least one dictionary. The latest English dictionaries for Aspell 5 are in a single zip file aspell5-en-6.0-0.tar.bz2. Download this file and double-click it. OS X unpacks it to make a folder aspell5-en-6.0-0; drag this into the dp folder.
For each set of dictionaries you download you must perform an installation. The process is just like the Aspell installation:
When you finish installing Aspell and its dictionaries, you should probably put the gcc compiler default back to 4.0.
The open-source HTML Tidy program is a utility that reformats HTML and finds errors in it. If you have a Tidy executable, Guiguts will invoke it for you from the HTML Palette.
To get Tidy for OS X, visit the Tidy Project Page. Scroll down near the bottom where "Mac OS X" is listed under "Other Builds." Click on that link, which downloads a file tidy_mosx.tgz. Double-click this file and OS X unpacks it to create a folder named bin whic contains a single UNIX executable named tidy. Drag the tidy executable to /dp.
You need to tell Guiguts where to find all these helper programs. Start Guiguts and select Prefs> Set File Paths> Locate Gutcheck Executable.
Select Prefs> Set File Paths> Locate Aspell Executable. Browse to find /usr/local/bin/aspell. Click Open.
If you downloaded Tidy, select Prefs> Set File Paths> Locate Tidy Executable. Browse to find /dp/tidy. Click Open.
Select Prefs> Set File Paths> Locate Image Viewer Executable. For use of GraphicConverter or Preview, browse to find the file /dp/guiguts/launchgc.sh that you created, and click Open. For use of XnView, browse to find /dp/guiguts/viewer/xnview and click Open.
Your Guiguts installation is now ready to use!
When you download an archive compressed with zip (the Guiguts distribution folder or a folder of text or images from PG), the browser may automatically unzip it for you. Or if it does not, you can always double-click the .zip file and OS X will unzip it then. No separate unzip utility is needed.
When you are going to upload a finished book, the PPVer expects to receive the folder of completed files compressed with zip. The OS X Finder offers a convenient option: File> Create Archive of... (also available by control-clicking any folder). The Finder uses Gnu Zip (gzip), whose output is acceptable to some PPV persons, but not to all. If you use this method to create your upload, be sure to document "compressed with gzip" in the comments field of the upload page.
If the PPVer says they couldn't open your uploaded archive, you need to use the basic Zip utility, which is run from a command line. The zip command is installed as /usr/bin/zip as part of the Developer Tools package in Step Two. Suppose you have a folder /dp/pp/projectID406d17b43e9c9 containing a book ready to upload. The following commands create a zip file:
The DPCustomMono2 font is very helpful to proofing. No doubt you have installed DPCustomMono2.ttf into either /Library/Fonts or Library/Fonts in your home directory, so you could use it when proofing the 400 pages you've done before becoming a post-proofer.
You might imagine that since OS X and all your different browsers can access this font, an X11 program should also. Well ha, ha! X11 has an amusing surprise for you! It doesn't.
The font technology of this current version of Apple's X11 is completely independent from the font technology used by the rest of OS X. X11 has its own font collection and knows nothing about the fonts managed by OS X.
If you really want to post-proof using DPCustomMono2, set aside a couple of free hours and follow the instructions in this post, after which you can pass yourself off as a real UNIX geek. "Oh, I was just editing my dot-x-init-r-c file..."
Thundergnat often updates Guiguts with fixes and new features. You can find if there is a new version by selecting the Guiguts menu option Help> Check for Updates. When you learn that a new version is available, go to the Guiguts site and click on the link to download guiguts.zip. (Alternatively, you may see a link to the new version in a forum posting.)
The downloaded guiguts folder is basically a duplicate of your /dp/guiguts folder except that it lacks your versions of two, and possibly three, files that you have modified:
To update Guiguts, open the old and new guiguts folders in the Finder. Select all the files in the new folder except for the gutcheck folder (and except for header.txt, if you have modified it). Drag the selected files and drop them onto the old folder. When the Finder asks if you want to replace a file, click Yes To All. This sequence updates the distributed files without replacing settings.rc or the gutcheck folder.
Compare the modification dates of the new and old gutcheck.c files. If the one in the new folder has been updated, replace it also and compile it anew as you did in step Six.
If you had modified header.txt, open the old and new versions in an editor, figure out what has changed, and resolve any updates so that the new version contains the class-names on which Guiguts depends with your styling.