Skip to content

Commit da3253c

Browse files
committed
Convert XGP fonts in KST format.
1 parent a19cbd4 commit da3253c

File tree

3 files changed

+76
-1
lines changed

3 files changed

+76
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ lodepng.c
2424
tito
2525
dart
2626
od10
27+
font

Makefile

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ OBJS = pdp10-opc.o info.o dis.o symbols.o \
1212

1313
UTILS = cat36 itsarc magdmp magfrm dskdmp \
1414
macdmp macro-tapes tape-dir harscntopbm palx cross \
15-
ipak kldcp klfedr scrmbl unscr tvpic tito dart od10
15+
ipak kldcp klfedr scrmbl unscr tvpic tito dart od10 \
16+
font
1617

1718
all: dis10 $(UTILS) check
1819

@@ -72,6 +73,9 @@ od10: od10.o $(OBJS) libwords.a
7273
harscntopbm: harscntopbm.o libwords.a
7374
$(CC) $(CFLAGS) $^ -o $@
7475

76+
font: font.o libwords.a
77+
$(CC) $(CFLAGS) $^ -o $@
78+
7579
palx: palx.o $(OBJS) libwords.a
7680
$(CC) $(CFLAGS) $^ -o $@
7781

font.c

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/* Copyright (C) 2021 Lars Brinkhoff <lars@nocrew.org>
2+
3+
This program is free software: you can redistribute it and/or modify
4+
it under the terms of the GNU General Public License as published by
5+
the Free Software Foundation, either version 2 of the License, or
6+
(at your option) any later version.
7+
8+
This program is distributed in the hope that it will be useful,
9+
but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
GNU General Public License for more details.
12+
13+
You should have received a copy of the GNU General Public License
14+
along with this program. If not, see <http://www.gnu.org/licenses/>. */
15+
16+
#include <stdio.h>
17+
#include <unistd.h>
18+
#include <string.h>
19+
#include "dis.h"
20+
21+
static int height;
22+
23+
static void
24+
character (FILE *f)
25+
{
26+
int row, column, width, bytes, words;
27+
word_t word;
28+
29+
word = get_word (f);
30+
if (feof (f))
31+
exit (0);
32+
fprintf (stderr, "USER ID: %012llo\n", word);
33+
word = get_word (f);
34+
fprintf (stderr, "LEFT KERN,,CODE: %06llo,,%06llo\n",
35+
word >> 18, word & 0777777);
36+
word = get_word (f);
37+
width = word >> 18;
38+
fprintf (stderr, "RASTER WIDTH,,CHARACTER WIDTH: %06llo,,%06llo\n",
39+
width, word & 0777777);
40+
41+
bytes = (width + 7) / 8;
42+
words = (height * bytes + 3) / 4;
43+
44+
for (column = 0; column < words; column++)
45+
{
46+
word = get_word (f);
47+
fprintf (stderr, "Data: %012llo\n", word);
48+
}
49+
}
50+
51+
int
52+
main (int argc, char **argv)
53+
{
54+
word_t word;
55+
56+
word = get_word (stdin);
57+
fprintf (stderr, "KSTID: %012llo\n", word);
58+
word = get_word (stdin);
59+
height = word & 0777777;
60+
fprintf (stderr, "Column position adjustment: %03llo\n", word >> 27);
61+
fprintf (stderr, "Base line: %03llo\n", (word >> 18) & 0777);
62+
fprintf (stderr, "Character height: %06llo\n", height);
63+
64+
for (;;)
65+
{
66+
character (stdin);
67+
}
68+
69+
return 0;
70+
}

0 commit comments

Comments
 (0)