BZRedit allows hand-editing of outline fonts in the BZR font format output by Limn (see section Limn).
It is written in GNU Emacs Lisp, and thus works only inside GNU Emacs (see section `Top' in GNU Emacs Manual). It uses Ghostscript to display the character images, and thus you must have Ghostscript installed to use it. See section Archives, for information on how to obtain GNU software.
BZRedit provides only a simple form of editing: you change the textual representation of the BZR font in an Emacs buffer; when you wish to see the image corresponding to the particular character you have been editing, you type an explicit command to tell Emacs to send the image in PostScript form to a Ghostscript subprocess.
BZRedit uses BPL format for the "textual representation". See section BPL files, for the precise details on what BPL files contain; however, you will probably find them fairly self-explanatory.
A more featureful editor would allow interactive manipulation of the outlines, say via a mouse in an X window. It would also be useful to allow adding or editing of hints (additional commands which improve rasterization at low resolution and/or small sizes); right now, none of the programs do anything at all about hints.
The sections below detail using BZRedit.
BZRedit is contained in the file `bzrto/bzredit.el'. Installation of the font utilities (see section Installation) copies this file into a directory where Emacs can find it. But you still need to tell Emacs what functions `bzredit.el' defines. To do this, put the following definitions into either your own `.emacs' file (see section `The Init File: `.emacs'' in GNU Emacs Lisp Manual), if you are the only person planning to use BZRedit, or into the system initialization file `default.el' (see section `Summary: Sequence of Actions at Start Up' in GNU Emacs Lisp Manual), for a public installation:
(autoload 'bpl-mode "bzredit" "Mode for editing BPL files." t) (autoload 'bzredit "bzredit" "Set up to editing a BZR file." t)
If you want the first function to be called automatically when you visit a file with extension `.bpl', you can add the following code to (presumably) the same file:
(setq auto-mode-alist (append auto-mode-alist (list '("\\.bpl\\'" . bpl-mode))))
If you do not do this, then to make the editing commands (described in the following sections) available you must type M-x bpl-mode after visiting a BPL file.
To edit a BZR file, type M-x bzredit to Emacs. (See the previous section for how to make this function known to Emacs.) This will ask you for the filename of the BZR font. After typing the filename, type RET.
The bzredit
function then calls BZRto with the `-text'
option (see section BZRto) to produce a BPL file--the textual form of the
BZR font. Then it calls bpl-mode
and makes the resulting buffer
visible (if it isn't already).
The next section describes bpl-mode
.
To edit a BPL file in bpl-mode
, the usual Emacs editing commands
work: cursor motion, deletion, and insertion all work just as with
normal text files.
Here is an example of a piece of a BPL file. See section BPL files, for a full description of BPL files.
(char 0 (comment hex 0x0) (width "6.263") (bb "0.241" "5.782" "-0.241" "6.745") (outline "0.482" "6.745" (line "1.445" "6.504") (line "1.445" "0.241") (line "0.482" "0.241") (line "3.613" "0.000") (spline "1.682" "1.264" "2.409" "4.436" "2.409" "6.504") ... ) )
The most usual editing session is changing the numbers in the
line
and spline
commands, which are the coordinates that
determine the character outline. But you can do anything you want:
change a line
to spline
(and add the requisite other
coordinates) or vice versa, change the set width, etc.
You must retain the quotation marks around the floating-point numbers, however. (They are necessary because Emacs 18 does not recognize floating-point constants.) If you inadvertently delete one, then when you go to display the edited character (see below), you will get an error from Emacs.
When bpl-mode
is first invoked, it starts up Ghostscript in a
subprocess. The section below describes the details of this. It is
Ghostscript which does the actual displaying.
bpl-mode
provides three additional commands (we show the default
bindings in parentheses):
bpl-quit
(C-c q and C-c C-q), which kills the
Ghostscript subprocess and then removes the BPL buffer from the screen.
bpl-quit
does not convert the BPL file (back) to BZR form; that's
left for you to do by hand.
bpl-erasepage
(C-c e and C-c C-e), which sends an
erasepage
command to Ghostscript, thus erasing whatever is
currently displayed.
bpl-show-char
(C-c c and C-c C-c), which sends to
Ghostscript a PostScript translation of the character that point is in.
bpl-mode
calls bpl-mode-hook
as its last action. You can
define this to take additional actions if you like.
As mentioned above, BZRedit uses Ghostscript, the GNU PostScript interpreter, to display the character images. See section Archives, for how to obtain Ghostscript.
BZRedit assumes that Ghostscript's default output device is the correct one to use--presumably a window on an X display. The actual default depends on how Ghostscript was installed.
The following variables control various attributes of the Ghostscript output: