Installed FontForge on A G5 Macintosh; Want to Install AutoTrace

Steve Tiano's picture

Anyone gone this route? Can you tell me where to go for a Macintosh (UNIX, I guess) package to install AutoTrace? Is there a guide of some kind somewhere that explains the process? FontForge was relatively easy to get up and running, but the packages I've seen for AutoTrace are kind of ambiguously labelled. A little help, please?

Thank you.

Steve

Michel Boyer's picture

A good choice is potrace. I use it as a line command but I just checked that it also works in fontForge if I put PreferPotrace on in the Apps preferences.

Steve Tiano's picture

Is there anything installs like a Macintosh program, without fussing in Terminal?

Michel Boyer's picture

> without fussing in Terminal?

Not that I know of. The best I could find for you is the binaries above (you don't need to compile from the sources!). It seems no one cared to build a package that makes the intallation for you, else that would be on Peter Selinger's page, I guess.

Steve Tiano's picture

Man, I don't want to be a ninny, but is there a step-by-step somewhere for what to do once the binaries are installed. God knows, I appreciate your directing me to them so I don't have to compile from sources. But this is practically a phobia of mine, getting into Terminal and ending up with a doorstop that used to be a computer.

speter's picture

Once you expand the archive, all you have to do is copy/move the programs `potrace' and `mkbitmap' to a directory on your path. (I've added so much stuff to my path, I don't recall what is there by default.) Most likely /usr/local/bin will be on your path, so I suggest moving there. (First, open Terminal and type

echo $PATH

to see what's on your path, and if /usr/local/bin is there, cd to the expanded folder (potrace-1.8.mac-[ppc/intel]) and type

sudo mv potrace /usr/local/bin

give your password, and do the same with mkbitmap. You're done, with no doorstop.

Michel Boyer's picture

Once the binaries are downloaded, they are not installed and the guys that made those binaries really assumed the user knows the basics of Unix. If no one else can help you, I'll look tomorrow at what I can do.

Steve Tiano's picture

Okay, I downloaded the PowerPC version, 1.7--1.8 is for the Intel chips. /usr/local/bin is on the path, along with a bunch of other stuff, when I type echo $PATH.

What is "cd to the expanded folder"? Obviously I know where the expanded folder is, in a folder where all my downloads go (like when I have to download something from a publisher's FTP site for a book I'm working on)> So I looked and, yes, the expanded file, named "potrace-1.7.darwin6.0-powerpc" is there. Both "potrace" and "mkbitmap" [my quote marks, of course] are in the file named "potrace-1.7.darwin6.0-powerpc".

I gather that "cd" is somehow the command that locates "potrace-1.7.darwin6.0-powerpc". So what do I type after cd to get me to the next step, :sudo mv potrace /usr/local/bin"?

Thanks. Maybe I can through this tonight.

Steve Tiano's picture

Okay, some progress ... maybe.

I took a shot and opened Terminal. I got the Welcome and then the name of my computer, followed by the $ prompt. There's what transpired next:

[my_computer's_name]:~ [name]$ echo $PATH
/usr/local/mysql/bin:/usr/local/mysql/bin:/usr/local/mysql/bin:/bin:/sbin:/usr/bin:/usr/sbin
my-Computer:~ [name]$ cd [folder all my stuff is in]/[folder my downloads go to]
my-Computer:~[folder all my stuff is in]/[folder my downloads go to] stephentiano$ sudo mv potrace /usr/local/bin
Password:
mv: rename potrace to /usr/local/bin/potrace: No such file or directory
my-Computer:~[folder all my stuff is in]/[folder my downloads go to] [name]$

So do I need to create /usr/local/bin?

Thank you.

speter's picture

You could install into /usr/bin, which is already on your path.

To create /usr/local/bin

sudo mkdir /usr/local/bin

Then you will have to add /usr/local/bin to your path. How to do that depends on what shell you are using. For bash (now the default on OS X), edit or create .bash_profile and add the lines:

PATH=$PATH:/usr/local/bin
export PATH

Michel Boyer's picture

Steve

If things are not working yet, can you do this:

Go in /Applications/Utilities and click the X11 icon. If a xterm window does not open, click "Terminal" in the X11 Applications menu. Then, in the xterm window you get, type

echo $SHELL
echo $PATH

and tell me what you get. I'll come back two hours from now.

Michel

Steve Tiano's picture

Okay, clicking the X11 icon and typing:

echo $SHELL

resulted in:

/bin/bash

Then, typing:

echo $PATH

/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin

What's next?

Michel Boyer's picture

Next you close all windows, click here, download the quick and dirty package I made and install it. When you are done, you stard again X11 and type in your window

which fontforge
which potrace

If you get /usr/local/bin/fontforge and /usr/local/bin/potrace your problems shoud be over. You should then be able to forget about terminal windows and use Autotrace directly in FontForge. If not, you tell me again what the path is.

Michel

Steve Tiano's picture

Michel, I think I can't thank you enough. Interesting thing ... After downloading, I had two packages: potrace-1.7.darwin6.0-powerpc.pkg AND potrace-1.7.darwin6.0-powerpc.1.pkg.

I double-clicked and, therefore, installed potrace-1.7.darwin6.0-powerpc.1.pkg. Seemed to go off without a hitch.

I again opened the Terminal in X11, typed "which fontforge", hit and got:

/usr/local/bin/fontforge

Then I typed "which potrace", hit and got:

/usr/local/bin/potrace

Look right?

Steve Tiano's picture

I spoke too soon, didn't I? Isn't the idea to be able to open FontForge in X11 and also find potrace in the X11 Applications menu while FontForge is open?

Michel Boyer's picture

Yes. Now if you start fontforge directly from X11 and import some bitmap, Autotrace should be activated.

[edit] If the path is properly exported, as it seems to be, then there should be no problem. Another way to proceed now is to type "fontforge" in your Xterm window.

Michel Boyer's picture

By the way, if you want to know the parameters of potrace, you can always type

  man potrace

in some Terminal (which shows that terminals are not that bad). Same for mkbitmap that is also installed (in case you feel like trying some line commands like in Selinger's doc).

Michel

[edit] Not true because though PATH is fixed, MANPATH is not fixed by the package. You need to do it by hand or type something weird like

nroff -man /usr/local/man/man1/potrace.1 to get it (which proves there was life before tex and latex, namely nroff and troff).

Steve Tiano's picture

Damn, the tutorial I have has .png files. And FontForge doesn't seem to recognize them from the Import menu. I haven't actually started even sketching anything. Anyone have a stray bitmap of a letter they can "lend" me. I promise, I think I'm about to get out of everybody's hair on this particular thread.

Steve Tiano's picture

I opened the .png for the letter "C" in Illustrator and saved it as a .eps file. It showed up in selection box when I went to import from FontForge. But when I went to import I got a message saying it was too complex for FontForge. What gives?

Michel Boyer's picture

Open it with preview, save it as BMP and try Autotrace just for fun. [edit] I mean, open the .png with preview.

Steve Tiano's picture

I can open it with Preview. But BMP is not there to save as--only GIF, PDF, PNG, and TIFF.

Michel Boyer's picture

I have Preview 3.0.9, just opened three .png files and has as options BMP, GIF, JPEG-2000, JPEG, PDF, PHOTOSHOP, PICT, PNG, SGI, TGA, TIFF. ?

Steve Tiano's picture

I tried opening again and saving in Illustrator. Saved a SVG, another format that FontForge's menu says I can choose to open. Like the EPS one I saved earlier, I got the following Error message:

Too Complex or Bad
I’m sorry this file is too complex for me to understand (or is erroneous)

Michel Boyer's picture

Try GraphicConverter; there is always something that works. And if not try this png. My preview accepts to save it as a lot of things.

Steve Tiano's picture

Okay, that worked. I’ve imported the letterform capital C. Now how should I be able to access potrace? It's not under the X11 Applications menu, nor is it under any Edit menu—either X11’s or FontForge’s.

WHere to find potrace?

Michel Boyer's picture

I thought you wanted to do everything inside Fontforge. If so, once you imported the bitmap, say "r" in the letter "r" of fontforge, you select the menu "element" at the top of the window of the letter "r" and then click "autotrace". That's it.

Steve Tiano's picture

It is, indeed. I didn't realize that was how you did it. Thank you so much. Now I have to start reading again, big-time, so I can do some meaningful work.

I do appreciate it. Thank you, Michel.

Michel Boyer's picture

Good that it worked. I am also over with the text I was writing whilst having a look at the thread. Good luck!

Christian Robertson's picture

Good stuff here. Thanks for the tutorial Michel. Potrace is one of the best autotracers I have found, commercial or free.

Dan Gayle's picture

By the way Steve, the formats that you were trying to save to in Illustrator, SVG and EPS are vector outline formats. Saving a bitmap to either of those formats doesn't change the nature of the file, and when FF tries to open an EPS or an SVG it is looking for a vector document.

Saving to either a .tiff or .jpeg should work because their nature is that of a bitmap image.

But why Potrace/FF wouldn't accept a .PNG is beyond me since that is the better and more open format, and is widely used by the FOSS/UNIX/LINUX community...

Steve Tiano's picture

Potrace not accepting PNG format surprised me, too, Dan. But it just wasn’t available in the format menu. Nevertheless, good old Graphic Converter—hadn’t had a need for it in ages—came through. So I’ve gotten as far as opening FontForge, importing letterforms, and getting them into Potrace. Now I just need to get a better handle on what I want to draw in letterforms, actually draw them, import them, and begin the work. Geez, I just made that sound so simple.

I know it doesn’t seem like much to you folks who draw and have a bunch of typefaces under your belt already, but it’s actually taken me a bit to get to this point. Funny thing is, now that I have gotten this far—part of why I got started on exploring type design is that I was idle—my work is starting to pick up. Two books poised to start: the first a straight layout job on a WWII history, and the second a design and layout on a handbook of sorts.

You never know what the charm is going to be.

mr's picture

FontForge needs libpng to open PNG files. Perhaps you don't have that installed?

On my machine, I can open PNGs in FontForge... but I'm using Ubuntu, which sets all that stuff up for me. And they say Macs make life easier :) I just opened Add/Remove Software, selected potrace and fontforge, and BAM! everything works (except, of course, that I like to have my fontforge fresh every week, so I have to download anyway).

Michel Boyer's picture

There is png2bmp that converts .png files to .bmp format. If you have lots of .png files, and png2bmp is installed, then you only cd to the directory where the .png files are and type

   for i in *.png; do png2bmp $i; done

and you get all the corresponding .bmp files. You can also pipe the output of png2bmp into potrace so as to get all the .eps or .svg files.

For me that's enough. In fact, if I can avoid opening fontforge, I like it better, and it is in fact easy to write a script that starts with .png files with properly chosen names and generates a .sfd file where all the .bmp bitmaps are in the background of their corresponding character; that's just the kind of facility I like with fontforge.

Michel

PS. If you don't know how to compile png2bmp, here is a compiled version for a ppc with OS X 10.4 (I am not sure it requires 10.4) ready to be installed (in package form). Don't click twice on here else the package is loaded twice.

Michel Boyer's picture

> if I can avoid opening fontforge, I like it better

What I mean is that if I can avoid opening the graphics interface, I like it better (especially if I have hundreds of font files to process). Of course, if I write #!/usr/local/bin/fontforge as the first line of a script, I "open" fontforge.

Michel Boyer's picture

> But why Potrace/FF wouldn’t accept a .PNG is beyond me since that is the better and more open format, and is widely used by the FOSS/UNIX/LINUX community...

I never needed to read png files but, whilst looking at how FontForge integrates Spiro, I realized that all you need for FontForge to read png files is to install the libpng library. I compiled a version for ppc running 10.4 and added it to the resources I put here as an answer on how to get the current development version of FontForge with spiro.

Michel

Syndicate content Syndicate content