| See Appendix A of the VMS DECwindows Guide to Xlib Programming:
MIT C Binding (or VAX Binding). This describes how to run the
font compiler from DCL to produce the DECW$FONT binary file.
You can use any text editor to create the source BDF file.
Once you've compiled the font, you should copy it to the directory
SYS$COMMON:[SYSFONT.DECW.USER_75DPI] or [SYSFONT.DECW.USER_100DPI],
and then reset the server by logging out and logging in again.
To use the font, the application should specify whatever font name
appears in the BDF file.
|
| RE: .0
(Hi Steve!)
Well, your lucks in! I've just this minute finished writing a rudimentary
BDF font editor. It's been posted to ELKTRA::DW_EXAMPLES, note 337.
Go there for the sources...
Have fun!
Rob
<<< ELKTRA::NOTESPUBLIC:[NOTES$LIBRARY]DW_EXAMPLES.NOTE;1 >>>
-< "DECwindows examples" >-
================================================================================
Note 337.0 BDF Font editor 3 replies
NRMACP::WATSON "Because Daddy says so...thats why" 170 lines 24-JAN-1990 11:25
--------------------------------------------------------------------------------
Well, I finally got so fed up of saying "No we don't have a font editor
for DECwindows" to customers that I decided to write my own. No
guarantees, but it seems adequate for most purposes.
I've tested it on VMS, VAX/Ultrix and RISC/Ultrix.
Here is the README file, replies will contain C source, UIL and a
sample font. If anyone manages to produce any really useful fonts,
please let me know.
-- Rob
<< FONT_EDITOR.README >>
SIMPLE DECWINDOWS BDF FONT EDITOR
---------------------------------
Author: Rob Watson
Workstation specialist
NRMACP::WATSON
DTN 841-3115
This is a simple DECwindows font editor. It can be used to create BDF (Binary
Distribution Format) fonts, which can then be converted into SNF (Server Natural
Format) using the font compiler.
There are lots of limitations and bugs, but it is OK for most purposes.
Main limitations (some may be removed if I get time):
All glyphs (characters) must have the same bounding box, with the
character origin being within the bounding box.
(the compiler can optimise the bounding boxes anyway)
Fonts are limited to maximum size of 32x32 pixels
Can only edit BDF files created by this program
Very little error checking!
Maximum of 128 characters per font
Assumes 75 DPI resolution
Cannot specify many font characteristics
(e.g. caps height, x height, foundry, weight etc)
Assumes left to right fonts only
Instructions
------------
To compile the program:
(VMS) $ cc font_editor
$ link font_editor,sys$input/opt
sys$library:decw$dwtlibshr.exe/share
<cntl/Z>
$ uil font_editor
(Ultrix) % cc -o font_editor font_editor.c -ldwt -lX11
% dxuil -o font_editor.uid font_editor
To use the font editor
(VMS) $ Run font_editor
or (Ultrix) % font_editor
There is a simple example font in the file demo.bdf
To read this in enter "demo" in the font name field and hit "Open". Make changes
to the font by selecting the character you require with the character index
slider, then edit the bitmap. The pixels in the bitmap are changed using any
mouse button. Pixels are either set, cleared or inverted in the rectangle
between where the button is pressed and where it is released.
The small square window shows the current glyph at actual size, with the ASCII
representation (in the default X font) directly underneath. The "show font"
button displays a separate window with the complete font displayed. The
characters are displayed within the font bounding box, not using the character
spacing.
The font name, height, width, character origin and number of characters can also
be changed. When finished, change the name of the font if required, then save
the font using the "Save" button.
Fonts can either be fixed or variable width. The font width specifies the size
of the maximum bounding box of the font, and is the same for all glyphs. The
glyph width is the actual width of the character, and may be different for each
character in a variable width font. Changing the glyph width of a fixed width
font changes it for all characters.
To compile and load the font (VMS):
-----------------------------------
Compile the font using
$ font name.bdf [/min/report]
replacing "name" with the name of your font to produce a name.decw$font file.
The /report option produces a name.decw$rep file which gives a full description
of the font, and the /min option minimises the bounding boxes to improve font
drawing performance.
Copy the resulting name.DECW$FONT to SYS$COMMON:[SYSFONT.DECW.USER_75DPI]
You need system privileges to do this.
Reset the font path using:
$ run set_font_path
If you do not have system privileges, you can add one of your own directories to
the font search path using this program.
To try the font out, start up Notepad (DECwindows V2 only), choose the
"Customize font" menu option, and you should see your font (with the foundry
name "Digital" unless you have changed it) in the list.
Some fonts don't seem to work in Notepad - I havent worked out why, but am
willing to be educated. Other applications can use the font via the Xdefaults
mechanism.
You can also list the available fonts to check that yours has been loaded using:
$ run list_fonts
For VAX/Ultrix
--------------
Compile the font using:
dxfc [-m -r reportfile] name.bdf >name.dwf
Copy the name.dwf file to one of the directories in the font path.
Use the xset utility to find and reset the font path:
xset -q To query the font path
75 DPI fonts are usually in /usr/lib/dwf/75dpi
xset fp rehash To rescan the font directories
xlsfonts To check in font is loaded
xfd name To display the font
For RISC/Ultrix
---------------
The font compiler on RISC is different from VAX/Ultrix. It does not like
the "COPYRIGHT" line in the bdf file. Edit the name.bdf file to remove this
line and change the STARTPROPERTIES line from 23 to 22.
Compile the font using
xfc name.bdf >name.snf
Copy the .snf file to a font directory (use xset -q to find the font path).
Normally this is /usr/lib/X11/fonts/decwin/screen75.
In this directory there is a "fonts.dir" file which must be edited (the file is
set read only by default). Edit this, increasing the number in the first line
of the file by one, and adding a new line at the bottom of the file which looks
like this:
name.snf -Digital-name-Medium-R-Normal--12-115-75-75-P-80-Digital-FONTSPECIFIC
replacing "name.snf" by the filename of your font, and using the full font name
as specified in the name.bdf file.
Then rescan the font directories using xset fp rehash as for VAX/Ultrix.
|