PfaEdit
PfaEdit -- A postscript font editor
that lets you create your own postscript, truetype, opentype, cid-keyed and
bitmap (bdf) fonts, or edit existing ones. Also lets you convert one format
to another.
I will not be responding to bug
reports (etc.) between 14-Mar and
3-Apr.
Contents
I have no one to do QA for me except users on the net, so this is essentially
beta software. Expect to find bugs. Please let me know when
you do.
Binary distributions:
If you want to do autotracing around character images you should also download
Martin Weber's autotrace
program. (there's a new version as of Dec 2001)
If you want to edit CID keyed fonts you probably need these
character set descriptions. (These were last updated
6-Mar-2002)
Source distribution
You can download a source RPM: Version:
12-Mar-2002
Or you can download the entire source tree
in one .tgz file: Version
12-Mar-2002
If you want to do autotracing around character images you should also download
Martin Weber's autotrace
program.(there's a new version as of Dec 2001)
If you want to edit CID keyed fonts you need these character
set descriptions. (These were last updated 6-Mar-2002)
With the appropriate libraries, PfaEdit can import
png, tiff, and gif images to act as character backgrounds for tracing purposes
(PfaEdit can import bmp and xbm formats without external libraries). With
the freetype library PfaEdit will do a better job making bitmap characters
for you. None is required for the proper compilation/execution of PfaEdit,
if the libraries are not present they will not be used. If your machine doesn't
have them and you want them they are available from:
PfaEdit has been ported to the following systems (at some point in its life)
-
Linux (obviously, (redhat, debian, suse),
386,spark,arm,alpha,ia64,m68k,mips,mipsel,powerpc,s390)
-
Solaris
-
Irix
-
FreeBsd
-
NetBsd
-
Mac OS/X
-
OpenVMS7.3 for Alpha
-
cygwin with X running on top of MS windows.
If you are editing CID keyed fonts you should pull
down the following file
-
cidmaps.tgz (These were last updated
6-Mar-2002)
and then
$ gunzip cidmaps.tgz
$ tar xf cidmaps.tar
$ mkdir -p /usr/share/pfaedit
$ mv *.cidmap /usr/share/pfaedit
You might also want to pull down some unicode
bitmap fonts that pfaedit uses
All the documentation files in this directory bundled up into one
tgz file 14-Feb-2002.
If you do the following then PfaEdit will find the docs for you when you
press F1 (ie. PfaEdit it will look in /usr/share/doc/pfaedit before it looks
on the web):
$ mkdir -p /usr/share/doc/pfaedit
$ cd /usr/share/doc/pfaedit
$ gunzip pfaedit_htdocs-*.tgz
$ tar xf pfaedit_htdocs-*.tar
$ rm pfaedit_htdocs-*.tar
Or you can download an rpm which
should install them properly for you.
Or you can just browse the docs online.
License
Copyright © 2000,2001,2002 by George Williams
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
The name of the author may not be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
Changes (Enhancements & Bug Fixes)
-
???
-
Nifty. The modifier keys auto-repeat under cygwin (if Control is down one
gets a series of Press/Release, Press/Release... while normal X just gives
one Press.) This meant we'd keep refreshing the tools palette, which meant
an annoying flicker and slowed things down.
-
Raise the palettes after a resize
-
PfaEdit didn't handle 8bit colormaps well. I've improved the behavior, and
added an x resource to give the user some control over behavior.
-
10-Mar-2002
-
Oops. I broke CID-keyed postscript input (ie. none-otf) when I added the
6-Mar fix for type1utils
-
Applied another patch from KANOU Hiroki, on otf cid support
-
9-Mar-2002
-
8-Mar-2002
-
Added a new program, sfddiff, to compare fonts
and show their differences.
-
6-Mar-2002
-
Small change to the format of cidmap files (to bring names into conformance
with adobe's spec on modifed unicode names), and corresponding changes to
a few routines.
-
Add support for the type1 format produced by GNU type1utils. Which is vaguely
like that used by ghostview.
-
4-Mar-2002
-
Fixed more problems with reading eps files (these were mostly within Expand
Stroke, so presumably also problems with Element->Expand Stroke)
-
And one more problem with the file chooser.
-
Scripting additions:
-
Ability to generate a pfm file from script
-
Ability to Merge Kerning Info from a script
-
Ability to Remove All Kerning info from a script
-
Will now display something useful for rotated and italic cids
-
3-Mar-2002
-
Fixed a number of problems involved in reading in eps files.
-
28-Feb Mac work introduced a bug in the file picker dlg (in wildcarding).
-
2-Mar-2002
-
Rounding errors could accumulate when generating Type1 fonts.
-
Fix for some overlap problems due to KANOU Hiroki
-
If PfaEdit crashed (or was interrupted) after making some (unsaved) changes
to a font, and that font was subsequently deleted, the PfaEdit's autorecovery
would complain about a missing file each time it was started. Now it will
notice the problem and ask whether it should delete the recovery file (whereupon
it will stop complaining).
-
Enabled a fix from Greg Ford so that PfaEdit set the mac style bits
appropriately.
-
28-Feb-2002
-
When running under Mac OS/X PfaEdit is now able to open/create mac resource
forks
-
I may have fixed a bug displaying images on solaris screens with bit depth
8
-
Cleaned up a problem with the postscript name table (in a ttf file) when
there was a .notdef character
-
Fixed some problems with references when reading in truetype.
-
24-Feb-2002
-
Substr() did not work when given three arguments
-
Added
-
$bitmaps (returns an array of all bitmap sizes rasterized for the current
font)
-
BitmapsAvail()
-
BitmapsRegen()
-
Changed the FontInfo dlg to give direct access to the postscript names rather
than trying to build the fontname out of family and modifiers.
-
Added the ability to create an encoding which is any given plane of unicode
(ie BMP is plane 0, SMP is plane 1, SIP is plane 2...)
-
Fixed a bug in Revert
-
More work on hints.
-
Build Composit will now build a dotlessi from an "i" (and same for dotlessj)
-
20-Feb-2002
-
Made Shift-Arrow keys move along italic axis.
-
$argv didn't work in scripting. (broken when I added arrays)
-
19-Feb-2002
-
Bugs in the generation of MacRoman encoding tables in ttf output (introduced
14-Feb)
-
The Goto Dlg sometimes didn't notice Returns (ie. OK button wasn't always
invoked)
-
Some linear splines were not noticed as such.
-
18-Feb-2002
-
Cancelling the Point Info dlg would leave minimum distance hints in a bad
state.
-
Using Undo also left the MD hints wonky
-
added $fontchanged to scripting
-
Added SaveAll menu item in font view.
-
Sometimes the underlines for accelerators didn't print in the menu (depended
on what PfaEdit thought the screen resolution was).
-
Added a new minimum distance hint for serifs of diagonal stems.
-
Fixed a bug where some extra serif stems were hinted.
-
16-Feb-2002
-
Created a "Select" submenu of the edit menu in the outline view. Moved
Edit->Select All, View->Next Point, View->Prev Point into it.
-
Added Deselect All, Select Next Control Point, Select Prev Control Point,
Select First Point, Select Width, Select VWidth
-
It is now possible to select the width (right bearing) line and move it with
the arrow keys or transform dlg (or to move points and the width line
concurrently). VWidth too.
-
Added variables with global and font scope to Scripting.
-
Yet another bug in the new simplify/merge code
-
Cleaned up unicode range names a bit more.
-
Changed the Goto Character dialog so that it will now (for two/four byte
encodings) display a list of unicode ranges which are in the font and allow
you to go to a range by name.
-
Made it possible to copy and paste the left and right side bearings (from
menus and scripts)
-
14-Feb-2002
-
My TrueType parser will now read cmap subtable formats 8,10 and 12 (the 4
byte encoding tables) and will produce format 12 subtables for full unicode
fonts.
-
Cleaned up various encoding problems.
-
Fixed display of SJIS.
-
Added better commentary on unicode outside of BMP
-
Cleaned up the spec file
-
In pfb files subroutines for references didn't work if the first thing called
was untranslated.
-
The arrow keys can be used to move a control point.
-
12-Feb-2002
-
Added sjis and Wansung encodings
-
Used freetype for a couple of other things (generating gdf files and exporting
bitmaps)
-
Textfields didn't respond to middle button clicks (to paste the primary
selection).
-
PfaEdit would sometimes fail to exit properly if you brought up a script
dlg.
-
Added a --version command line option.
-
Fixed another bug in generating postscript.
-
Added a user defined print command option to the print dlg.
-
Fixed a bug in Simplify/Merge
-
Fixed a bug in loading integer resources
-
Cleaned up the help command line option.
-
9-Feb-2002
-
PfaEdit will now use freetype (if available) to generate bitmaps for the
fonts (results are much better).
It still does its own rasterizing for the fontview (there's a lot of overhead
involved with freetype, and this needs to be fastish)
-
Made the Generate Font dlg settings sticky across invocations of pfaedit.
-
8-Feb-2002
-
PfaEdit would crash when generating a PostScript font from ARIAL.TTF.
-
Changed the bitmap dlgs so that they allow you to specify some control over
interesting screen resolutions. (before just support X standard res. of 75
and 100, now support MS 96&120 and Mac 72).
-
Oops, Apple now documents that the bdat and bloc tables should have version
number 0x20000. But when I last looked it said 0x10000 and that didn't work.
-
Put the docs in their own rpm file.
-
7-Feb-2002
-
I think I've figured out how Apple does asian bitmaps now. They don't use
NFNTs at all (or they do, but those NFNT are tiny stubs with no real data
in them). All the data are in the sfnt. I should produce them properly now.
-- Except I don't.
-
I've also added the ability to create bitmap only sfnts for the mac.
-- Which also isn't recognized by the mac.
-
Made it possible for scripts to generate bitmaps without generating an outline
font
-
Fixed some problems loading bitmaps from ttf files.
-
Fixed some problems loading bitmaps from anything...
-
Allowed importation of eps files from the font view (to the extent that I
can parse eps files, that is)
-
Oops, scripting didn't support importation of pcf files.
-
5-Feb-2002
-
Sometimes popup windows (tool tips) would show up with nothing in them. That
should be fixed now.
-
Added icons for pcf files
-
Started work on 32 bit unicode.
-
Oops. Scripting handled the caligraphic pen angle incorrectly.
-
Put something into the about box.
-
4-Feb-2002
-
Oops. PfaEdit was misusing the type1 "seac" command in some cases. I had
not realized that the character being built needed to have the same width
as the base (non-accent) character. This has been fixed.
-
When using the charinfo dlg to change the name of a char, and that name was
in use, and you cancelled the dlg after being warned about it then PfaEdit
would crash (it would muck up memory).
-
PfaEdit wasn't always calling subroutines (in postscript) when a character
was in a subr.
-
PfaEdit will now read in X11 pcf font files (they can be compressed, if so
PfaEdit will decompress them first).
-
Bug in wildcard processing for file chooser window.
-
1-Feb-2002
-
Nifty! SUSE ships some greek (bitmap) fonts with iso8859-1 encodings rather
than iso8859-7. PfaEdit is now alert and when it sees a bitmap font with
foundary "greek" and encoding "iso8859-1" it will pretend it has encoding
"iso8859-7".
-
PfaEdit got confused by some fonts produced by type1fix.pl. Should be fixed.
-
Build Composit Characters will now check the user defined ligature string
to see what characters to use to build a ligature.
-
31-Jan-2002
-
Conversion tables between JIS0201 (Katakana) and Unicode were wrong. KANOU
Hiroki provided correct ones.
-
30-Jan-2002
-
Oops. I'd left diagonal stems enabled in ttf generation. Caused problems.
Disabled now.
-
More work on accented characters.
-
29-Jan-2002
-
Sped up background image drawing (finally)
-
28-Jan-2002
-
Added
-
Strtol
-
Strskipint
-
AskUser
-
Error
-
Added a menu of commonly used scripts which the user can specify with the
preference dlg.
-
25-Jan-2002
-
Oops. Generate command in scripting language only generated pfb fonts
-
PfaEdit would get confused if it loaded a font from a script when running
with windows. Eventually it would crash, but perhaps not until you exited.
-
Added
-
$italicangle
-
$cidfontname, $cidfamilyname, $cidfullname
-
$weight, $copyright
-
$cidweight, $cidcopyright
-
SetItalicAngle
-
Removed $cidname (replaced with $cidfontname)
-
Added a Call... button to the execute script dlg to allow you to insert a
call to a script file easily
-
24-Jan-2002
-
Added a way to scale dlgs in different languages.
-
23-Jan-2002
-
Fixed a crash in merge (caused by selecting all points on a path and merging
it (to remove the path))
-
Improved positioning of ogonek and cedilla accents in Build Accented Character
-
22-Jan-2002
-
Added:
-
SetCharCnt
-
SetCharName
-
SetUnicodeValue
-
CIDChangeSubFont
-
SetFontNames
-
CIDSetFontNames
-
$curcid, $nextcid, $firstcid, $cidname
-
Cleaned up ligature handling in char info dlg
-
Cleaned up array freeing in scripting.
-
Fixed a crash in FontInfo introduced yesterday
-
21-Jan-2002
-
Import will now allow you to import background images from the font view
(and the default setting of "Background" for "pk" files has been set to true)
-
Added a scripting command to access
-
Import
-
strlen
-
strstr
-
strcasecmp
-
strsub
-
arrays
-
access to the postscript names of the font
-
access to information about individual characters
-
Cleaned up some display oddities in the fontview.
-
Added a Set Width command to the bitmap view IF there is no outline font.
-
Added a menu item to invoke a script
-
Added a "Comment" field to FontInfo. This does not correspond to any postscript
or truetype entity. It is to be used for a changelog within the sfd file
(or something similar).
-
19-Jan-2002
-
Initial version of scripting.
-
Optimizer caused rounding errors which caused test for divide by zero to
fail leading to errors in Simplify and Merge commands.
-
bdf fonts with an encoding which did not itself include "-1" (or similar)
failed to get the implied "-0" added.
-
Earlier Changes
PfaEdit is by no means complete. And probably doesn't work very well. Be
prepared to save frequently and always work on a copy of the original.
-
No attempt has been made to be efficient.
-
No attempt has been made to read truetype instructions (hints)
-
No attempt has been made to retain the change-over points for hint substitution.
PfaEdit will refigure this when it saves the font.
-
Many type 3 fonts will not be read in correctly (those generated by pfaedit
should always be acceptable)
-
Importing a type0 font loses the encoding. PfaEdit only imports simple type0
fonts (such as those made by itself), will get confused if there's more than
one font with a chars dictionary.
-
After adding the Johab encoding, any old fonts which had a unicode encoding
will suddenly claim to have a Johab encoding. I don't see a way around this
at the moment. Just reencode them as unicode and all should be well.
-
When reading in TrueType PfaEdit will not get the correct offset for composit
glyphs where offsets are specified by point matching rather than as x,y values.
(some mac fonts)
-
My truetype hinting is still bad. Especially for diagonals.
-
Some truetype fonts (kaiu and mingliu) do not store the correct outline.
Instead they rely on using the instructions to move points around to generate
the outline. The outline does not appear to be grid-fit at all, just positioned.
PfaEdit will not read the instructions. In most fonts this would be the wrong
thing to do, and I don't know how I could tell when it needs to be done...
-
PfaEdit's support for the GPOS table output is limitted. Currently it only
recognizes latin,cyrillic,greek,arabic and hebrew scripts. It assumes everything
it doesn't recognize is latin. It makes at most two lookup tables for kerning
one for left to right scripts, one for right to left scripts. If you want
to work with a different script let me know, and let me know something about
it. It should be easy enough to add (I hope). Furthermore I don't know what
to do about digits which appear in arabic/hebrew in l2r ordering, so I shall
give the r2l scripts access to both lookups.
-
I'm told AutoKern doesn't work too well.
-
PfaEdit is confused by small splines, on the order of one em unit. If you
need something that small, scale the font up by a factor of 2 or more (including
the ascent and descent).
-
The MetaFont command doesn't work well.
-
???
Installing it
The executable tarball contains the pfaedit executable and a man page. Put
it wherever you'd like.
The build script will do an install to /usr/local/bin if you want it to.
Running it
$ pfaedit font.pfa font2.pfb font3.sfd font4.ttf font5.otf font6.gsf
font7.bdf
will start pfaedit looking at the fonts you specify on the command line.
It can read either pfb or pfa fonts, and some ps fonts (type 0 fonts based
on a type 1 dictionary) as well as truetype fonts, non-CID open type fonts
and bitmap fonts.
$ pfaedit -new
will cause pfaedit to create a new font (in iso-8859-1 encoding)
$ pfaedit
will open up a file picker dialog and allow you to browse till you've found
a font file (or have created a new one).
Reporting bugs...
I'm sure you'll find some. If you can isolate it and come up with a reproduceable
minimal case, that would be great. The executable has symbols in it so if
you run it in gdb you should be able to get a stack trace... Do what you
can.
gww@silcom.com
-
My writing leaves much to be desired. Anyone who can make my
documentation more readable is encouraged to do so. (or who wishes to translate
it into other languages)
-
The UI can be translated into different languages. Unfortunately
it does not use gnu gettext.
-
English I take care of
-
Russian Valek handles
-
I've also created very minimal French & German translations that lapse
into English, anyone who wants to take these on is encouraged to do so.
-
Anything other language additions would be great (the entire UI does not
need to be translated)
-
Different font formats
PfaEdit supports Type1, truetype and opentype fonts (to greater and lesser
extents), also bdf and NFNT for bitmaps
But there are other formats out there that I can't find descriptions of:
-
Microsoft FON files (bitmap font resource files for windows)
-
There are certain commands which don't work very well and if someone
else wanted to they might code them better than I...
-
Remove overlap
-
Autohint
-
Metafont
-
generating instructions to do hinting in truetype (especially hints for diagonal
stems)
The sample text in File->Print comes from many
sources.
The following people have helped debug pfaedit. Many thanks!
PfaEdit was inspired by AltSys's
Fontographer
now placed in graceful retirement by MacroMedia.
Other font links
Other Encodings
-
BDF editors
-
xmbdfed -- bdf editor.
-
gfe -- GNU font editor.
Eventually supposed to support other formats
-
Postscript/ttf font editors
-
MetaFont the original computer vector font editor & other TeX utilities
-
Postscript utilities
-
gfontview -- displays a
postscript/ttf font
-
gglyph
-- another font displayer
-
t1utils -- Type 1 utility programs
& multiple master utilities
-
Type1inst
-- helps to install type 1 fonts under X and ghostscript
-
ttf2pt1 -- Converts truetype
to type1 postscript fonts and generates hints
-
type1fix -- (part of the TeXtrace package).
Used to make some Type1 fonts work with ATM.
-
my stuff
-- Type 1 decoders and converters. True Type & open type decoder.
-
TrueType utilities
-
Microsoft provides a bunch of stuff (for windows only of course)
-
And Apple does too
(mac only)
-
Rasterizers
-
Other related links...