Index: trunk/Ohana/src/libkapa/rotfont/fixfont.c
===================================================================
--- trunk/Ohana/src/libkapa/rotfont/fixfont.c	(revision 5854)
+++ trunk/Ohana/src/libkapa/rotfont/fixfont.c	(revision 38986)
@@ -1,4 +1,6 @@
 # include <stdio.h>
 # include <math.h>
+# include <stdlib.h>
+# include <string.h>
 # define TRUE 1
 # define FALSE 0
@@ -24,5 +26,9 @@
 
 typedef struct {
-  int dx, dy, ascent, Nb;
+  int dx;
+  int dy;
+  float dXps;
+  int ascent;
+  int Nb;
   unsigned char *bits;
   char name[64];
@@ -32,5 +38,5 @@
 int scan_line (FILE *f, char *line);
 
-main (int argc, char **argv) {
+int main (int argc, char **argv) {
 
   int BitMap, Nvalue, code;
@@ -43,12 +49,34 @@
   FILE *f;
 
-  if (argc != 3) {
-    fprintf (stderr, "USAGE: fixfont (file.bdf) (name)\n");
+  if (argc != 4) {
+    fprintf (stderr, "USAGE: fixfont (file.bdf) (file.psx) (name)\n");
     exit (0);
   }
 
-  f = fopen (argv[1], "r");
+  char *bdfname = argv[1];
+  char *psxname = argv[2];
+  char *fontname = argv[3];
+
+  // read in the PS sizes first
+  f = fopen (psxname, "r");
   if (f == (FILE *) NULL) {
-    fprintf (stderr, "failed to open file %s\n", argv[1]);
+    fprintf (stderr, "failed to open file %s\n", psxname);
+    exit (0);
+  }
+
+  while (scan_line (f, buffer) != EOF) {
+    int N;
+    float dXps;
+    int Nread = sscanf (buffer, "%d %f", &N, &dXps);
+    if (Nread != 2) continue;
+    if (N < 1) continue;
+    if (N > 255) continue;
+    font[N].dXps = dXps;
+  }
+  fclose (f);
+
+  f = fopen (bdfname, "r");
+  if (f == (FILE *) NULL) {
+    fprintf (stderr, "failed to open file %s\n", bdfname);
     exit (0);
   }
@@ -112,5 +140,5 @@
       strcpy (font[i].name, "blank");
     }
-    fprintf (stdout, "static unsigned char %s_%d_bits[] = {", argv[2], i);
+    fprintf (stdout, "static unsigned char %s_%d_bits[] = {", fontname, i);
     for (j = 0; j < font[i].Nb; j++) {
       if (!(j % 12)) fprintf (stdout, "\n");
@@ -121,13 +149,14 @@
   }
   
-  fprintf (stdout, "static RotFont %sfont[] = {\n", argv[2]);
+  fprintf (stdout, "static RotFont %sfont[] = {\n", fontname);
   for (i = 0; i < 255; i++) {
-    fprintf (stdout, "{%d, %d, %d, %s_%d_bits},\n", 
-	     font[i].dx, font[i].dy, font[i].ascent, argv[2], i);
-  }
-  fprintf (stdout, "{%d, %d, %d, %s_%d_bits}};\n", 
-	   font[i].dx, font[i].dy, font[i].ascent, argv[2], i);
+    fprintf (stdout, "{%3d, %3d, %5.2f, %3d, %s_%d_bits},\n", 
+	     font[i].dx, font[i].dy, font[i].dXps, font[i].ascent, fontname, i);
+  }
+  fprintf (stdout, "{%3d, %3d, %5.2f, %3d, %s_%d_bits}};\n", 
+	   font[i].dx, font[i].dy, font[i].dXps, font[i].ascent, fontname, i);
 
       
+  exit (0);
 }
 
@@ -178,3 +207,2 @@
 
 }
-
