pdp10-its-disassembler icon indicating copy to clipboard operation
pdp10-its-disassembler copied to clipboard

Convert XGP fonts to... something modern

Open larsbrinkhoff opened this issue 4 years ago • 5 comments

larsbrinkhoff avatar Sep 08 '21 18:09 larsbrinkhoff

KST Font Format

KST is  CMU's  oldest  and  MITAI's only  compiled  binary  font  format.
SCRIMP,  TJ6, PUB,  and other  programs all use  KST files  as their font
definitions.  KST format is as follows:
Word 0/ KSTID
Word 1/ 9 bits COLUMN POSITION ADJUSTMENT, 9 bits BASE LINE,,HEIGHT
The remainder of the file has one block of data for each character.  Each
block looks like:
        USER ID ;not currently used but  low order bit is on.   This  bit
                can  be used to find the  beginning of a new block.   The
                last block is followed by two -1's.
        LEFT KERN,,CHARACTER CODE
        RASTER WIDTH,,CHARACTER WIDTH
        CHARACTER MATRIX
The character matrix is stored four  8-bit bytes per word, so that  ILDBs
with  8-bit byte size get successive bytes.  The remaining four low order
bits are 0.   The bits are reversed in each byte (because of the way  the
XGP  interface  works)  so that  the  high  order (leftmost)  bit  of the
character is the low order bit of the byte.   The matrix is stored row by
row;  rows  follow  one another with no extra separating bytes.  The last
word is filled out with 0 bytes, if necessary.  Note that HEIGHT rows are
stored for each character, and (RASTER WIDTH + 7)/8 bytes  are  used  for
each row.

Some  old MIT KST  files, and all CMU's  KST files do  not use the RASTER
WIDTH variable.  (All characters have RASTER WIDTH=CHARACTER WIDTH.)  The
third word  of those  files  has 0  in  the left  half.   Programs  which
directly  examine KST files for RASTER  WIDTH should therefore, if RASTER
WIDTH=0, use CHARACTER WIDTH instead.   (Note  that this also means  that
while  MITAI can use  CMU's KST files,  CMU cannot use  MITAI KST files.)
Since when RASTER WIDTH=0, MITAI programs substitute CHARACTER WIDTH, you
should not write a program which will set RASTER WIDTH to zero.  When FED
finds a character with  zero RASTER WIDTH, FED  will write the  character
with  RASTER WIDTH=1. This does  not waste any space  in the XGP's PDP11,
since the PDP11 does  a vertical compaction  of rasters, eliminating  top
and bottom blank lines.

larsbrinkhoff avatar Sep 08 '21 19:09 larsbrinkhoff

I had a play with this before: ksttobdf. (Although BDF doesn't really count as modern...)

atsampson avatar Sep 09 '21 09:09 atsampson

Thanks! I was about to do the same.

larsbrinkhoff avatar Sep 09 '21 10:09 larsbrinkhoff

Running ksttobdf and then mkttf results in widely spaced characters, according to https://products.aspose.app/font/viewer

40vshd

larsbrinkhoff avatar Sep 09 '21 11:09 larsbrinkhoff

THE SICK BROWN QUUX JUMPED OVER THE LAZY FROG.

larsbrinkhoff avatar Sep 09 '21 11:09 larsbrinkhoff