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.
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
25-Nov-2001)
Source distribution
You can download a source RPM: Version:
8-Feb-2002
Or you can download the entire source tree
in one .tgz file: Version
14-Feb-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
25-Nov-2001)
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
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 8-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)
-
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.
-
17-Jan-2002
-
PfaEdit used to crash (sometimes anyway) if a list popup were active when
a window was destroyed.
-
TextFields within tabsets (like Font Info) responded to some events twice.
-
Bug in the new TTF hinting routines could cause a crash (and did cause glyph
programs which were erroneous)
-
Crash caused by long names in /etc/passwd when creating a new font
-
Redid fontname handling in Font Info dlg to allow URW names to pass through
unscathed
-
Recognize "Regu" as meaning "Regular"
-
Only updates the fullname (human readable name) if it were previously in
sync
-
Recognize "-" as starting the modifiers rather than trying to find the end
of the family name
-
If you don't change the family or the modifiers then pfaedit will now leave
the fontname untouched
-
14 Jan 2002
-
The 9 Jan metrics view fix caused crashes when changing the last character
displayed.
-
The outline view now will display points at extrema in a different color
from other points if you want that.
-
Added a command to the font view to clear out the backgrounds of all selected
characters.
-
Fixed one more image freeing problem (see 29-Dec-2001)
-
bdf fixes of 9&11 Jan did not work on bdf files with character encodings
of "-1"
-
Fixed several bugs with ttf bitmap tables.
-
Added a mechanism for specifying a font inside a truetype collection from
the command line:
$ pfaedit "gulim.ttc(GulimChe)"
will load the GulimChe font within the collection file.
-
12 Jan 2002
-
Russian ui had an unexpected space in it which confused makenomenh. Have
fixed both (makenomenh & nomen.ru)
-
Last fix to Merge made most merges return straight lines
-
Added an elide command which allows the slopes of the endpoints to change
-
Releasing the control or super key when in one of the palettes did not update
the tool cursor.
-
The point info dlg now comes up beside (rather than on top of) the selected
point.
-
11 Jan 2002
-
bdf "fix" of 9 Jan. lost the encoding of the font.
-
PfaEdit source included "ushort" in a couple of places. Linux must define
this but some systems don't. It has been changed to uint16 which I define.
-
Worked around some imaging bugs of the X server under cygwin (PfaEdit seems
to work under cygwin now)
-
Using the arrow keys to scroll only worked if something were selected. should
always work now.
-
The fontview now contains an indication of which characters have backgrounds
-
Minor improvements to merge when given an impossible problem.
-
9 Jan 2002
-
destroy window fix on 2 Jan was not enough, it popped up again. Hope I've
killed it this time
-
PfaEdit had trouble reading bdf fonts that
-
did not have standard X font names (-vendor-family-weight-italic-...)
-
had the same name used for different characters
-
The metrics view got confused by characters with negative lbearings.
-
Added some Japanese (Kanji) text samples.
-
8 Jan 2002
-
Fixed a bug in gdf output
-
7 Jan 2002
-
Added a traditional chinese sample
-
In the metrics view, the kerning offset was not rescaled when the size of
the window changed.
-
Added a preference item to control the amount by which the arrow keys move
selected points
-
Changed the behavior of the grid layer so that now points will snap to any
spline in the grid layer, not just horizontal and vertical splines
-
Added a preference item to control this snap distance.
-
Added a couple new outline display sizes to the fontview
-
Use the "super" modifer to simulate a mouses middle button. If the super
key (the one with a windows flag on it on pc keyboards) is depressed then
any mouse click will be treated as if it were mouse button 2 that was used.
-
Minor improvements in truetype hinting
-
4 Jan 2002
-
if a dfont (or other mac resource file) contains multiple truetype fonts,
pfaedit will let you pick one (before it would read in the first and ignore
the others)
-
The tools palette now shows the mouse bindings.
-
Next/Prev control points are drawn in different colors now, and those colors
are reflected in the point get info dlg.
-
Merge and Simplify will now retain the slope of curve points.
-
Simplify will no longer remove points at the extrema of their curves (PostScript
fonts are supposed to have points at the extrema)
-
New command in Element menu to add
points at extrema to a spline or set of splines.
-
Next/Prev Point commands will shift the screen so the newly selected point
is visible.
-
Metrics View now allows for anti aliased character display.
-
Metrics View View menu was broken and was missing half its entries.
-
Revert Font would leave pfaedit in a state where some commands would cause
a crash. Should be fixed now.
-
TextFields did not scroll properly with the arrow keys.
-
The outline and bitmap views may be scrolled with the arrow keys by holding
down either the control or meta key.
-
When reading a ttf file with an encoding pfaedit doesn't recognize which
has some glyphs which are refered to from multiple code points, then pfaedit
used to crash.
-
Support Menu key on windows keyboard
-
Use the Windows "flag" key as a modifier to indicate mouse button 2 (so if
that key is depressed, and a mouse button is pressed/released pretend it
was button2)
-
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 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...