Quantcast
Channel: Active questions tagged fonts - Super User
Viewing all articles
Browse latest Browse all 298

Extending a postscript font (filling in some glyphs for code points > 127)

$
0
0

Problem

Is there any way to create a type 3 font with some glyphs from the standard font Courier and some extra glyphs constructed from scratch in Postscript?

X-Y Problem?

After reading the background below, you may wonder why I don't just use enscript or a2ps. One reason is that enscript doesn't have access to a suitable font and changes the box-draw characters to question marks. The a2ps program works with option -X ibm-cp437 on some platforms -- but I'm not sure it works everywhere.

Besides which, I'd enjoy learning how to extend fonts in Postscript.

Background

I have some reports produced by a legacy application for a printer using a monospaced font such as Courier. It uses the character set defined by Code Page 437 and the reports include some of the box-draw characters from that set.

Example in Unicode UTF-8

Item   │  Amount───────┼────────Widget │    3000Thing  │     745

Example as an image

Image of report with CP437 box-draw characters

I have some experience of writing programs in the Postscript language and of writing software in other languages that converts plain ASCII text into better looking Postscript reports with a variety of typefaces, logos, boxes, lines etc.

I can write a program that converts files such as the above CP437 example into a printable Postscript file that re-encodes Courier into CP437 because HP LaserJet printers support Postscript Level 3 and have a CourierPS font that includes glyphs for those characters. They are unnumbered (no code point, only name) but that isn't a problem. Re-encoding creates a CP437 compatible Courier.

I would like to also do this conversion in a way that can be fed through Ghostscript for conversion to a downloadable PDF rather than being printed. However Ghostscript's Courier is really Nimbus Mono and lacks the needed box-drawing glyphs.

In Adobe's Postscript Language Tutorial and Cookbook there is an example of creating an analytic font which makes it look like I could relatively easily create a box-drawing type-3 font since it only involves straight lines. I couldn't easily reproduce the ASCII glyphs for Courier manually though. This would mean switching back and forth between two fonts (Courier and Boxdraw) which seems sub-optimal.

I imagine Courier is not type 3.

How to create a type 3 font based on Courier (Nimbus Mono) and add a dozen extra/missing glyphs?


Viewing all articles
Browse latest Browse all 298

Trending Articles