[comp.windows.x] creating new font files in X11

mantak@hub.ucsb.edu (02/24/88)

Is there any documentation for the font compiler that came
with X11 R1 tape ?

I guess that the *.snf are created from *.bdf files.
But, what is the format of the 'bdf' files?
What is the process needed for creating a new font file ?

Thanks in advance.

karlton@decwrl.dec.com (Philip Karlton) (02/24/88)

In article <439@hub.ucsb.edu> mantak@hub.ucsb.edu () writes:
>But, what is the format of the 'bdf' files?

See .../X11/doc/bdf.ps.

>What is the process needed for creating a new font file ?

Emacs? Nobody that I know of has placed a bitmap editor that generates .bdf
files into the public domain. Some commercial companies do sell fonts.

PK

phr@web5h.berkeley.edu (Paul Rubin) (02/24/88)

In article <295@bacchus.DEC.COM> karlton@decwrl.UUCP (Philip Karlton) writes:
  In article <439@hub.ucsb.edu> mantak@hub.ucsb.edu () writes:
  >But, what is the format of the 'bdf' files?
  
  See .../X11/doc/bdf.ps.
  
  >What is the process needed for creating a new font file ?
  
  Emacs? Nobody that I know of has placed a bitmap editor that generates .bdf
  files into the public domain. Some commercial companies do sell fonts.
  
Yes, Emacs does an ok job at this.  I wrote a rudimentary font editor
in Emacs Lisp last summer that decodes the BDF entry for a character
into a picture made from spaces and asterisks, lets you edit it in
picture mode, and packs the picture back into BDF format.  It was
reasonably useful for examining/tuning existing fonts but probably
not too good for making whole new ones.  If interest warrants it,
I will attempt to dredge up a copy and post it here.

leres@cory.Berkeley.EDU (Craig Leres) (02/24/88)

If you want to create X11 fonts from scratch, you can always use
fontedit on a Sun and convert the resulting vfont file to a bdf file
with my vtobdf conversion program. A current version of vtobdf is
available via anonymous ftp from lbl-rtsg.arpa (128.3.254.68) in
vtobdf.shar.

		Craig

mwette@newton.ucsb.edu (Matt Wette) (02/25/88)

Re: emacs font editor from Paul Rubin:

I'm interested.
Matt

 _____________________________________________________________________________
 Matthew R. Wette			| ARPA: mwette%gauss@hub.ucsb.edu
 Scientific Computation Lab		| UUCP: ucbvax!ucsbhub!gauss!mwette
 Dept. Elec. and Comp. Eng.		|
 University of California		|
 Santa Barbara, CA  93106		|
 -----------------------------------------------------------------------------

bzs@bu-cs.BU.EDU (Barry Shein) (02/25/88)

>I guess that the *.snf are created from *.bdf files.
>But, what is the format of the 'bdf' files?
>What is the process needed for creating a new font file ?

There should be a document in the doc/ dir called bdf.ps which
describes the font format adequately, I've written programs using that
info. BDF is Adobe's Bitmap Distribution Format (I think that's right)
and the same information appears in one of the Adobe Postscript
manuals, maybe it's the Transcript looseleaf.

	-Barry Shein, Boston University

bzs@bu-cs.BU.EDU (Barry Shein) (02/25/88)

I was asked to submit a program for the R2 tape which converts
MetaFont's GF output format to BDF. I suppose the question remains
whether anyone really wants to design fonts in MetaFont, but at least
once you do you can mechanically reproduce them for various resolution
output devices. In theory it should be a very powerful way to produce
fonts but no doubt a few more little pieces are needed (like finishing
the GF to PostScript download format.) Not to mention figuring out
MetaFont itself.

My real goal was to be able to produce fonts which were true to the
resolution of various screens (and printers) rather than the current
situation in the X11 distribution which just punts the issue and
distributes a single resolution font. I find this important if one
wants to be able to calculate screen positioning based upon what the
font should be, etc.  Ideally you should be able to throw a font up on
the screen and print it on a piece of paper, hold them side-by-side
and they at least should take up exactly the same space (resolution
differences will make the quality somewhat different.) This approach
seems to allow this although it's not unique. If postscript stroke
fonts existed for public consumption I probably would have used that.

	-Barry Shein, Boston University

guido@cwi.nl (Guido van Rossum) (02/25/88)

I know of sombody collecting programs to convert between bdf format and
various other formats.  They may end up on the R2 tape.  I have
contributed a converter from Macintosh fonts to bdf.  (K., speak up if
you wish to receive mail to coordinate efforts!)
--
Guido van Rossum, Centre for Mathematics and Computer Science (CWI), Amsterdam
guido@cwi.nl or mcvax!guido or (from ARPAnet) guido%cwi.nl@uunet.uu.net

ken@cs.rochester.edu (Ken Yap) (02/26/88)

In article <216@piring.cwi.nl> guido@cwi.nl (Guido van Rossum) writes:
|I know of sombody collecting programs to convert between bdf format and
|various other formats.  They may end up on the R2 tape.  I have
|contributed a converter from Macintosh fonts to bdf.  (K., speak up if
|you wish to receive mail to coordinate efforts!)

OK, ouch, stop twisting my arm. :-)

I have a couple of BDF to something converters. I was using BDF as
an UNFOL. I'm putting the lot on zap in ~ftp/contrib.

Here is what's in bdf-converters.tar:

Bdf2gf		BDF to GF (TeX generic font)
Bdf2vf		BDF to vfont
Mac2bdf		Mac to BDF
Remapbdf	Change glyph mappings in BDF files
Vf2bdf		Vfont to BDF

I'm also putting my small collection of extra screen fonts in
miscfonts.tar. Here is what's there:

4x6.bdf			cour-cap-r-12.bdf	screen-r-13.bdf
6x10b.bdf		cour-cap-r-14.bdf	screen-r-14.bdf
6x13b.bdf		cour-r-10.bdf		screen-r-7.bdf
9x15b.bdf		cour-r-12.bdf		serif-cap-r-12.bdf
apl-r-10.bdf		cour-r-14.bdf		serif-cap-r-14.bdf
cmr-b-14.bdf		cour-r-16.bdf		serif-cap-r-16.bdf
cmr-r-14.bdf		cour-r-18.bdf		serif-r-10.bdf
cour-b-10.bdf		cour-r-24.bdf		serif-r-11.bdf
cour-b-12.bdf		gallant-r-19.bdf	serif-r-12.bdf
cour-b-14.bdf		screen-b-12.bdf		serif-r-14.bdf
cour-b-16.bdf		screen-b-14.bdf		serif-r-16.bdf
cour-b-18.bdf		screen-r-11.bdf		vstadocfxb.bdf
cour-b-24.bdf		screen-r-12.bdf		vthack.bdf

Please don't ask me to mail these to you.  I'm done with fonts for a
while (the TeX fonts generated with bdf2gf looked less than acceptable
because the originals were from a WW engine) and I would like to do
something other than play postman.

	Ken

grmp@papaya.ucsb.edu (xperts@cornu.ucsb.edu) (02/27/88)

Questions about Font files:

I read the documentation about the fonts in X11/doc/bdf.ps.
Are there any more documentations explaining bdf in detail?
I need information about the different 'properties' of fonts 
('MinSpace' was used in the doc. but was not explained),
the reason behind calculating 'SWIDTH' & 'DWIDTH', ... etc.

If I am interested in creating a 16 bit font, how should I 
set up the 'STARTCHAR' and the 'ENCODING'? 
(ENCODING is restricted to 0 to 255 ?)

After creating a 'snf' font file using the 'fc'.
How can I print a text file using this new font ?
How does X handles output using a font file with a poscript
printer?

One method I am exploring is using 'enscript'.  
But, the '*.afm' (font metrics files)
format is different then the '*.bdf' format.
How can I add my 'snf' font file into the library,
so that I can do something similar to enscript?

Please send reply to 'xperts@cornu.ucsb.edu'.
	
Thanks in advance.

ken@cs.rochester.edu (Ken Yap) (02/27/88)

In article <443@hub.ucsb.edu> grmp@papaya.ucsb.edu (xperts@cornu.ucsb.edu) writes:
|Questions about Font files:
|
|I read the documentation about the fonts in X11/doc/bdf.ps.
|Are there any more documentations explaining bdf in detail?
|I need information about the different 'properties' of fonts 
|('MinSpace' was used in the doc. but was not explained),
|the reason behind calculating 'SWIDTH' & 'DWIDTH', ... etc.

The document actually tells you all you need to know. Well, no, not
quite, you need to understand something about font metrics.  SWIDTHs
are the ratios of the width and height of a character to design size
(point size). Ideally, the 'x' in 10 point and the 'x' in 12 point of
the same font should have the same SWIDTHs although their DWIDTHs will
differ.  The numbers following SWIDTH are intended to be reals. They
will typically range in the high hundreds.  DWIDTHs are in units of
pixels and obviously whole numbers.  `fc' ignores SWIDTH. It appears
BDF is an Adobe standard for distributing hi-res fonts, adapted for X11
use.

What gets put in the PROPERTIES fields depends on the compiler.
MinSpace is obviously some property the Adobe compiler is interested
in.

|If I am interested in creating a 16 bit font, how should I 
|set up the 'STARTCHAR' and the 'ENCODING'? 
|(ENCODING is restricted to 0 to 255 ?)

What comes after STARTCHAR is just a label. It is meant to be a phrase
for human consumption like "grave accent". What comes after ENCODING is
a decimal number.  You could put a 16 bit number here if your compiler
groks it.  I don't think `fc' generates 16 bit fonts.  (Haven't
checked.)

|After creating a 'snf' font file using the 'fc'.
|How can I print a text file using this new font ?
|How does X handles output using a font file with a poscript
|printer?

It doesn't. Snf is just for screen fonts at the moment, as far as I can
tell.  You could translate BDF into something that can be downloaded
into a printer. But remember the fonts supplied are for ~80 dpi and
your printer is probably 300 dpi. So the characters you get with the
supplied fonts will be too small to read on your printer.

|One method I am exploring is using 'enscript'.  
|But, the '*.afm' (font metrics files)
|format is different then the '*.bdf' format.
|How can I add my 'snf' font file into the library,
|so that I can do something similar to enscript?

Well, bdf files contain both metrics and bitmaps. afm files contain
only metrics, the bitmaps are inside the printer ROMS.  If you have
some downloadable font, you should also send along width specs with the
bitmaps. Or explicitly put spacing commands in the PostScript code,
like some dvi to ps filters do.

Bottom line: forget about using the supplied bdf fonts for printing -
they are screen fonts. BDF can be used as a font description language
though.

	Ken