This is part of the old website. New website begins at fontforge.github.io

Are you a web developer? Help us migrate this page on Github

Autotracing bitmaps in FontForge

FontForge does not have a native autotrace, but it will happily use the output of two freely available programs which do autotracing. These are:

You must download at least one of these, (and possibly build it), and install it somewhere along your PATH.

Having done that you must get an image into the background of the glyph(s) you want to autotrace. There are several ways of doing this:

From a bitmap font
If you want to autotrace a bitmap font then (from the FontView)
  • (You will probably want to start out with a new font, but you might not)
  • File->Import
  • select the bitmap font type (bdf, FON, embedded in a ttf file, TeX bitmap (GF, PK), etc.)
  • turn on the [*] As Background flag
  • Select your font file
  • This should place the bitmaps into the background of the glyphs in the font. Nothing will be visible in the font view, but if you open up an outline glyph view, you should see the bitmap version of the glyph as a grey background.
From the clipboard
If you have an application that supports sending image selections by mime type (kde does this), then you should be able to copy the image in that application and paste it into the appropriate glyph window in FontForge
From an image file
If you have a bitmap in an image (it works best if it IS a black and white bitmap image, rather than a color image)
  • Open up an outline glyph view for the appropriate glyph
  • Make the Background layer active (this is usually not necessary)
  • File->Import
  • select Format=Image (this will show you any image format that fontforge supports)
  • Select your file
  • The image should now be visible in the background of this glyph
From multiple image files
If you have many images, you can load them with one command, but you must name them appropriately. For example if your font contains unicode characters U+0041 (LATIN CAPITAL LETTER A) through U+0049 (LATIN CAPITAL LETTER J) then create files called "uni0041.png", "uni0042.png", ... "uni0049.png" containing the images for the appropriate characters, then (from the Font View)
  • Select the requisite glyphs
  • File->Import
  • select Format=Image template
  • select the first of your images, "uni0041.png"
  • This should load all images that match that template ("uni*.png") into the appropriate glyph slot

Once you have background images in your font (and have installed an autotrace program)

This can take a while, so be patient.

Warning: Unless you are working with a TeX bitmap font, you will most likely have an extremely low resolution image. Autotrace programs work better the more resolution you give them.

If you hold down the shift key when you invoke AutoTrace from the menu then you will be prompted for arguments to pass to it, if you do not hold down the shift key FontForge will use the same arguments it used last time. AutoTrace's arguments are described in "$ autotrace -help" or in the README file that came with the program. Please do not specify input/output files or formats. FontForge fills these in.

-- Back -- TOC --