Dec 062017
 
Reads a PC-Write printer definition file and outputs the font selection code information to StdOut in ASCII format. Mostly intended for working with LaserJet control codes. C source included. Uploaded by author.
File SHOWPRDF.ZIP from The Programmer’s Corner in
Category Word Processors
Reads a PC-Write printer definition file and outputs the font selection code information to StdOut in ASCII format. Mostly intended for working with LaserJet control codes. C source included. Uploaded by author.
File Name File Size Zip Size Zip Type
SHOWPRDF.C 3708 1196 deflated
SHOWPRDF.DOC 4141 1705 deflated
SHOWPRDF.EXE 14960 8440 deflated

Download File SHOWPRDF.ZIP Here

Contents of the SHOWPRDF.DOC file


SHOWPRDF 1.0 -- A program to read PC-Write printer definition files.

I wrote this program because I've been doing a lot of experimenting
with soft fonts in PC-Write, and was losing my mind going from the
decimal printer codes in a PC-Write printer definition (PR.DEF) file to
the HP manual to figure out what was being selected. What the program
does it to read a PR.DEF file specified on the command line, located
valid font characters lines (the ones that start with a #), and output
the info about that font character in a human readable form. The
output is sent to STDOUT, so it can be redirected to a file, run
through a filter, or LISTed with the LIST.COM or 4DOS "read from STDIN"
syntax: SHOWPRDF amertype.def | LIST /s

If no file name is specified on the command line, SHOWPRDF simply exits
without doing anything. I chose to always require a file name because
none of my definition files are named "PR.DEF" -- I always the specify
the proper file in the document and on the print command line because I
use a number of different files with various fonts for specific
purposes.

For example, the following output comes from processing part of the
default HP LaserJet II definition supplied by QuickSoft:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Font letter: B Font selected: 10 CPI 12P Bold Courier
On string:
27,40,49,48,85,27,40,115,48,112,49,48,104,49,50,118,48,115,51,98,51,84
Interpretation: (10U(s0p10h12v0s3b3T
Off string:

Interpretation:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Font letter: E Font selected: 12 CPI 12P Courier
zOn string:
27,40,56,85,27,40,115,48,112,49,48,104,49,50,118,48,115,48,98,51,84,27,38,107,49,48,72
Interpretation: (8U(s0p10h12v0s0b3T&k10H
Off string:

Interpretation:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

For each font letter, SHOWPRDF prints the letter, the contents of the
parenthetical comment (if any) after the printer control string line as
"Font selected," and then the on (+) and off (-) strings as they appear
in the PR.DEF file, followed by the ASCII interpretation. I use the
'' character as a substitute for ; I concluded that a single
character was preferable presentation to or something similar.

If the off string is simply -R, which in PC-Write means return to the
current selected "regular" font, then no information is printed about
the off string.

The following is an example soft font selection output from SHOWPRDF.
The "Font selected" line continues out as far as necessary, no attempt
is made to truncate or wrap it at 80 characters. I've truncated it
here in the example; normally, QuickSoft's FONT.EXE program includes
the matching soft font file name as part of the parenthetical
description so that would appear further out on the line.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Font letter: M Font selected: AmerType 10 pt, prop, bold, portrait
On string:
27,38,108,48,79,27,40,48,85,27,40,115,49,112,49,48,118,48,115,51,98,50,51,84
Interpretation: &l0O(0U(s1p10v0s3b23T
Off string:

Interpretation:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

This is a pretty simple program. There are no switches, no usage
message, no nothing! I've included the C source code so you can hack
or expand the program if it's useful. I compiled the program under Mix
PowerC 2.0.0; it's pretty vanilla C code, and should compile under
Microsoft, Turbo, etc. with no trouble. You should also be able to use
PKLITE or DIET without any trouble if you so desire.

If you improve on SHOWPRDF, please let me know:

David P. Lemire
Bit Bucket Software
9318 Farewell Road
Columbia, MD 21045

The executable and source files for SHOWPRDF are hereby released into
the public domain (12/4/91) -- David P. Lemire


 December 6, 2017  Add comments

Leave a Reply