Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
X GUI

Can You Create X11 Fonts With METAFONT? 7

Mike Hicks asks " The current state of fonts for XFree86 has been lamented many times by many people. The resolution and clarity of modern displays continues to get better, meaning that fonts designed for 75 and even 100 dpi are becoming small and unreadable. Not to mention the fact that many fonts are relatively poor -- many only have a single set of attributes. Most fonts that I come across are just normal, bold, or italic. It is very hard to find a new font set that has normal, bold, italic, and bold italic typefaces. Of course, a true Open Sourcerer would go out and make these fonts, but there are only a handful of font-creation utilities out there (and most of them are only good for bitmapped fonts). All seems nearly lost, but I re-discovered something this weekend. The METAFONT package was developed by Donald E. Knuth (et al) in the late 1970s in order to produce high-quality fonts for the Tau Epsilon Chi (TEX -- now you know why it sounds like `blech') typesetting system." Has anyone used METAFONT for the express purpose of creating fonts for X11? How did it work out?

"After reading through Knuth's 1979 book, TEX and METAFONT: New Directions in Typesetting, it seems to me that METAFONT would be a good way to produce new fonts for X Windows (and console and printing..). I'm not certain if it's possible to produce PostScript Type 1 fonts from METAFONT (some say it isn't possible, while the GNU Font Utils package seems to be a way to do it), it would still be possible to create a large number of bitmapped fonts for various point sizes and display resolutions.

Well, I -think- it's possible...

Has anyone ever done what I'm describing? I haven't had much luck deciphering the documentation I've been able to find. Granted, I haven't yet plunked down $50 for a copy of The METAFONTbook, but even that reference may not be of any use, as it probably predates any widespread use of X Windows."

This discussion has been archived. No new comments can be posted.

A Solution for X11 Fonts?

Comments Filter:
  • This has nothing to do with metafont, but I stumbled across this editor a while back looking for Linux fonts: The XmBDFEd BDF Font Editor [nmsu.edu]

    This is a Motif based BDF (Bi Directional Font?) format font editor. Hope that helps.

  • by Anonymous Coward

    You could use mf to make bitmaps, but its hinting is really designed for 150 dpi at the very least, and screen resolutions aren't really there yet. Computer Modern rendered at 100dpi is downright awful, but that's a fairly fussy font so you might be able to do somewhat better.

    Metafont is 1-bit only, so you'd have to do anti-aliasing by rendering to a higher resolution and squishing down - the results tend to be rather fuzzy compared with something like TrueType, as your hinting system doesn't know that you're going to do that. Greyscaling may not matter if you're targetting X, of course.

  • This is a Motif based BDF (Bi Directional Font?)

    BDF is the Adobe Bitmap Distribution Format for fonts. You can get a copy of the spec at http://www.wotsit.org [wotsit.org].

  • Long answer: no, unless there are tools for converting TeX/METAFONT fonts to Adobe Type 1 [...] or TrueType

    Yes and no. In order to use Metafont, you need to either provide your X server with a metafont rasterizer, or you need to convert your fonts to a format for which a rasterizer already exists. For the latter option, you mentioned Type1 and TrueType, but as another poster said, there's also bitmap fonts. Note that converting to Type1 or TrueType will be non-trivial. They're both outline fonts, where the shape of a glyph within the font is defined by a set of curves (cubic for Type1, quadratic for TrueType) that describe the outline of that glyph. Metafont, on the other hand, describes a glyph by defining a path along which a notional brush is dragged, and varying the size and shape of the brush along that path.

    Either ay, the only option that exists today (that I'm aware of) for using metafont, is to convert to bitmap fonts (either BDF or PCF).

  • Long answer: no, unless there are tools for converting TeX/METAFONT fonts to Adobe Type 1 (not merely PostScript; Type 1 is a specially structured subset of PS) or TrueType. I haven't heard of any. It's more likely that there exist tools to make a set of bitmap (BDF/PCF) fonts from a METAFONT font, but that's not quite the same.

    If you want to make fonts and have a Mac (or Windows machine) around, Macromedia's Fontographer is the canonical tool, though it's proprietary (and its file format is as well; not only that but the two platforms' formats aren't compatible; probably due to byte order lossage of some sort). If you don't have this, and are masochistically inclined, you could download the free (GPLed, I think) t1utils and the Adobe Type 1 font spec (it's in PDF somewhere on their site) and hand-code the charstring code.

    There are open-source vector font editor projects (such as Raph Levien's gfonted), but they seem to all be at a very early stage.

    (Incidentally, if anyone's interested, I am working on a Python module for encoding/decoding Type 1 fonts, which may ultimately become part of a font editing package. The (rather early) code is here [null.org].
  • It's probably not the answer you want, but since MetaFont it Turing-complete, you can use it to calculate anying. :-)

    In a reasonable sense, probably not. MF is made to spit out PK (TeX bitmap) fonts, and probably won't easily do anything else.

    You might be able to get MF to give you a PK bitmap and then hack up a converter which converts that to a bitmaped font of a given size. It's probably even possible to integrate that with XFree so it happens on the fly.

    Probably not worth it, though.

    Greg

  • by SamHill ( 9044 ) on Monday July 17, 2000 @11:00AM (#927906)

    Long answer: no, unless there are tools for converting TeX/METAFONT fonts to Adobe Type 1 (not merely PostScript; Type 1 is a specially structured subset of PS) or TrueType. I haven't heard of any. It's more likely that there exist tools to make a set of bitmap (BDF/PCF) fonts from a METAFONT font, but that's not quite the same.

    I think you're missing the point. For X screen fonts, you don't want Type 1 PostScript or TrueType fonts, you want well-crafted bitmaps that have been designed for screen display. I don't know about your machine, but on my system, Type 1 and TrueType fonts (other than Microsoft's Web fonts, which were specifically designed for screen display) look awful. Only the bitmap fonts (and Microsoft Web fonts) are readable and acceptable for everyday use. I leave PostScript fonts to gv.

    The mf program translates METAFONT format (MF) source files into GF (font raster) and TFM (TeX Font Metrics) files; GF files must be processed by gftopk to produce PK (packed font raster) files. xmbdfed, however, can import PK or GF font files and produce BDF files.

    For a neat example of PK fonts in use as screen fonts, check out TeXmacs [u-psud.fr], which gives you a really nice looking WYSIWYG display (better than anything else I've ever seen running under X). TeXmacs uses fairly large font sizes, however; I'm not sure if you can get legible PK fonts at smaller sizes (for, say, a terminal window).

    (By the way, the Type 1 Utils are not GPLed, but are freely available for use or modification (provided you maintain the existing copyright notices), and can be found on Eddie Kohler's Web site [lcdf.org]. If you want Debian packages, an ancient (pre-Eddie) version is available from the main archives (t1utils), with the current version (t1utils-ek) available from this site [eskimo.com] (as source, unless you have a PowerPC machine).)

What is research but a blind date with knowledge? -- Will Harvey

Working...