Converting Mac fonts for use with Scribus

From Scribus Public Wiki

Jump to: navigation, search
This article is part of the HOWTOs series.
Installation Usage PDF issues DTP Other

Contents

[edit] Converting Mac fonts for use with Scribus

Some Scribus users may already have signficiant font libraries in Mac-specific font formats. Whether they're using Scribus on the Mac or on Linux, it may be useful to convert those fonts into formats Scribus can understand. Please make sure the license permits you to convert the fonts before doing so. If you plan to use the converted fonts on a different computer (ie have them installed on more than one computer), make sure the license permits you to do so.

Please do not distribute converted fonts. There could be issues with the conversion (and more broken fonts on the Internet is bad). There may also be license issues with distributing converted fonts even if the license for those fonts normally permits redistribution. Just don't do it - please.

If you're comfortable with UNIX commands and the terminal, there's a quick howto at the end (but please see the requirements below first). Otherwise, read on...

[edit] Pre-Requirements

If you are using Scribus 1.3, you can use Mac-specific fonts directly.

If you just want to convert a font to a format which can be copied to Linux (some Mac-specific formats have an empty datafork and store all info in the resourcefork), try this command in Terminal:

$ cp "My Cool Font/rsrc" "My Cool Font.dfont"

Note that ls will only list "My Cool Font", not "My Cool Font/rsrc". The "/rsrc" part is some Mac magic.

If you are using Scribus 1.2, you'll want to read on. (this section by AVox)

[edit] Requirements

To do this as described here, you will need a mac running MacOS X 10.x (Probably 10.2 or newer). It is possible to convert fonts other ways, but I will not cover that here.

All you will need is the MacOS X package of fondu. Look under Downloads on the fondu home page. Make sure you get the MacOS X package as only it will work with the method described below.

[edit] Detailed description

Install the package. You do not have to do any special configuration. Once the package is installed, you will have the fondu program in /usr/local/bin, a UNIX directory on your system. Don't worry about looking for it, we'll tell your computer how to use it below.

The first thing to do is to make a new folder (put it in your home folder and call it "Fondu") and copy the fonts you want to convert into this folder. Once that's done, open the Terminal app (You can find it in the Utilities folder in the Applications folder - I recommend putting a copy on your dock since it's so useful). You should see text in the terminal that looks something like this:

localhost:~ myname$

or possibly

localhost:~ myname%

Don't worry too much about the details of how it looks. This text, by the way, is called the "prompt". If your prompt ends in % instead of $, type bash and press the enter key. You should see a new line of text that looks something like this:

bash$

Now, type cd "Fondu" and press enter. If you called the folder you put your fonts in something different, type its name instead (in "quotes"). If there is no error message, that's ok - it won't print "success" or anything.

From now on, I'll just list the commands to type. Be sure to type them exactly as shown and press enter after each one. You can copy individual lines from here and paste them into the terminal if you like (don't try to copy and paste the whole lot though - copy and paste one by one, and press enter after pasting each one).

mkdir converted
cd converted
for file in ../* ; do echo -n "Converting $file... " ; echo | /usr/local/bin/fondu "$file" && echo "OK" ; done

The last command should list each font and whether or not it was converted OK. When it stops printing messages and you see the prompt again, you're done - your fonts are converted (see below if you see messages other than "Converting fontname.... OK"). If you look in the Fondu folder you made, you should now see a folder called converted containing a whole bunch of files. Scribus should be able to use those fonts if you tell it where to find them in the preferences. (Other X11 apps can also use them, but how to install them for X11 is beyond the scope of this document).

[edit] Errors and problems

It is possible that the conversion did not work for some of your fonts, in which case it should have printed out a message for that font. You can use the scroll bar in the terminal to go back and look at the messages if there are too many to fit on the screen.

It may have printed "Bus error" instead of OK, meaning there was an error in the converter program. The chances are these fonts can not be converted, at least not by the current version of fondu.

You may also notice questions about overwriting files in the messages that scroll past. This usually means that fondu could not find the name of the font in the font file, so it tried to call it "untitled". However, if there is already a file called untitled, perhaps from a previous conversion, fondu will ask to overwrite it. The command I gave above automatically says no. To convert these fonts, you will probably have to do them by hand. First, make sure there are no Untitled files in the 'converted' folder. Now, in the terminal, you can do something like:

fondu "../File Name Of Font That Wasn't Converted"

Make sure to use exactly the file name that the conversion command printed when it said it was converting that font. When you run the command, fondu should make a new file called Untitled(something) . If you rename that file (in the Terminal if you're comfortable with that, or in the Finder), you can now use Fondu to convert the next font it couldn't find the name of.

Please email craig@postnewspapers.com.au or the mailing list with any questions. You can use the discussion page, but it may take a while before anybody notices.

You may also find Installing additional fonts to be useful for installing your converted fonts. I recommend keeping the converted fonts separate from your other font collections to keep track of their origins.

[edit] Short 'n Sweet

Make a new folder somewhere and copy the fonts you want to convert into it. Open a terminal, make sure your shell is bash, and cd into the folder you made. Then:

mkdir converted
cd converted
for file in ../* ; do echo -n "Converting $file... " ; echo | /usr/local/bin/fondu "$file" && echo "OK" ; done

and you should be done - the new fonts will be in the 'converted' folder inside the folder you made. See the more detailed description above if you got any errors (there isn't much to be done about "bus error", but questions about replacing 'untitled' are covered above).

--Ringerc 13:54, 2 Mar 2005 (UTC)

Personal tools