Home > Archive > PostScript > November 2005 > Text to ps with box-forming characters
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Text to ps with box-forming characters
|
|
| Bob Babcock 2005-11-17, 3:57 am |
| I need to take text reports from some legacy DOS programs and convert them
to postscript (and then to pdf). Two complications: there are embedded PCL
commands to change the font size and there are a lot of box-forming
characters from the IBM extended ascii character set. I've written a
filter that handles the font size changes and replaces the box-forming
characters with +, - and |. This is good enough for the first cut, but I'd
like to do better if possible. Is there a simple way to add box-forming
characters to the Courier font? I've looked at what comes out of a Windows
printer driver when I use the MS linedraw font, but printer drivers never
do things simply.
| |
| Ian Wilson 2005-11-17, 3:57 am |
| Bob Babcock wrote:
> I need to take text reports from some legacy DOS programs and convert them
> to postscript (and then to pdf). Two complications: there are embedded PCL
> commands to change the font size and there are a lot of box-forming
> characters from the IBM extended ascii character set. I've written a
> filter that handles the font size changes and replaces the box-forming
> characters with +, - and |. This is good enough for the first cut, but I'd
> like to do better if possible. Is there a simple way to add box-forming
> characters to the Courier font? I've looked at what comes out of a Windows
> printer driver when I use the MS linedraw font, but printer drivers never
> do things simply.
The HP LaserJets which I've used, have a Courier font which includes all
the box-drawing glyphs. If you want to print DOS text which is using the
old DOS character set (Code Page 437) then you just need to adjust the
encoding vector for the Courier font.
There has been prior discussion of this subject in this newsgroup. You
can use google groups to find it.
(Search for 'CP437 group:comp.lang.postscript')
http://groups.google.com/group/comp...618167ff65cbf43
Note that this works on a HP LaserJet printer but not in Ghostscript
because Ghostscript's Courier lacks the required glyphs (in the GS
versions I used).
| |
| Ian Wilson 2005-11-17, 3:57 am |
| Ian Wilson wrote:
> Bob Babcock wrote:
>
>
>
> The HP LaserJets which I've used, have a Courier font which includes all
> the box-drawing glyphs. If you want to print DOS text which is using the
> old DOS character set (Code Page 437) then you just need to adjust the
> encoding vector for the Courier font.
>
> There has been prior discussion of this subject in this newsgroup. You
> can use google groups to find it.
>
> (Search for 'CP437 group:comp.lang.postscript')
>
> http://groups.google.com/group/comp...618167ff65cbf43
>
>
> Note that this works on a HP LaserJet printer but not in Ghostscript
> because Ghostscript's Courier lacks the required glyphs (in the GS
> versions I used).
Thinking about it a little more, maybe GNU a2ps does what you want.
Apparently it can handle CP437 and PDF production.
| |
| Bob Babcock 2005-11-18, 7:01 pm |
| Ian Wilson <scobloke2@infotop.co.uk> wrote in
news:dlhiqc$mc$1@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com:
> There has been prior discussion of this subject in this newsgroup. You
> can use google groups to find it.
>
> (Search for 'CP437 group:comp.lang.postscript')
Thanks for the pointer. I see several promising things in that thread.
| |
| Bob Babcock 2005-11-20, 3:58 am |
| Ian Wilson <scobloke2@infotop.co.uk> wrote in
news:dlhiqc$mc$1@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com:
> (Search for 'CP437 group:comp.lang.postscript')
I found out from the above search that the X11 Courier font includes the
CP437 box-forming characters. So, I used FontForge
(http://fontforge.sourceforge.net/) under Fedora Core 4 to delete
everything but the box-forming characters from Courier, saved this as
Courier-box and brought it over to Windows. I modified the program that
creates the postscript files to use this font where needed, and I used the
/RE function from page 116 of the Green Book
(http://www.rightbrain.com/pages/books.html) to put the box-forming
characters in the same slots as they are in CP437.
Here's the code that puts the glyphs in the right slots. The first one is
the vertical bar, 0x7c in CP437. My samples don't use all the box-forming
characters, so I can't guarantee that these are all correct, but I think
they are.
/stdencoding [124/SF110000 179/SF110000 /SF090000 /SF190000 /SF200000
/SF210000 /SF220000 /SF230000 /SF240000 /SF250000 /SF260000 /SF270000
/SF280000 /SF030000 /SF020000 /SF070000 /SF060000 /SF080000 /SF100000
/SF050000 /SF360000 /SF370000 /SF380000 /SF390000 /SF400000 /SF410000
/SF420000 /SF430000 /SF440000 /SF450000 /SF460000 /SF470000 /SF480000
/SF490000 /SF500000 /SF510000 /SF520000 /SF530000 /SF540000 /SF040000
/SF010000 ] def
stdencoding /Courier-box /Courier-box RE
Now, I just have to make sure the Courier-box font gets embedded when I
convert postscript to pdf. Time to read some documentation...
|
|
|
|
|