Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert XGP fonts to... something modern #87

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

larsbrinkhoff
Copy link
Owner

No description provided.

@larsbrinkhoff
Copy link
Owner Author

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.

@atsampson
Copy link
Collaborator

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

@larsbrinkhoff
Copy link
Owner Author

Thanks! I was about to do the same.

@larsbrinkhoff
Copy link
Owner Author

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

40vshd

@larsbrinkhoff
Copy link
Owner Author

THE SICK BROWN QUUX JUMPED OVER THE LAZY FROG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants