Index: /branches/eam_branches/ipp-20150625/Ohana/src/libkapa/Makefile
===================================================================
--- /branches/eam_branches/ipp-20150625/Ohana/src/libkapa/Makefile	(revision 38916)
+++ /branches/eam_branches/ipp-20150625/Ohana/src/libkapa/Makefile	(revision 38917)
@@ -18,6 +18,9 @@
 FULL_LDFLAGS  = $(BASE_LDFLAGS) -ldvo -lFITS -lohana
 
-install: $(DESTINC)/kapa.h $(DESTLIB)/libkapa.a $(DESTLIB)/libkapa.$(DLLTYPE)
-libkapa: $(LIB)/libkapa.$(ARCH).a $(LIB)/libkapa.$(ARCH).$(DLLTYPE)
+install: ROTFONT $(DESTINC)/kapa.h $(DESTLIB)/libkapa.a $(DESTLIB)/libkapa.$(DLLTYPE)
+libkapa: ROTFONT $(LIB)/libkapa.$(ARCH).a $(LIB)/libkapa.$(ARCH).$(DLLTYPE)
+
+ROTFONT:
+	cd rotfont && make all
 
 INCS = $(DESTINC)/kapa.h
Index: /branches/eam_branches/ipp-20150625/Ohana/src/libkapa/include/alphabet.h
===================================================================
--- /branches/eam_branches/ipp-20150625/Ohana/src/libkapa/include/alphabet.h	(revision 38916)
+++ /branches/eam_branches/ipp-20150625/Ohana/src/libkapa/include/alphabet.h	(revision 38917)
@@ -1,2 +1,13 @@
+
+# if (0) 
+# include "../rotfont/times8.h"
+
+# define DEFFONT 1
+static FontSet HardwiredFonts[] = {
+  {times8font,  "times", 8}
+};
+# endif
+
+# if (1)
 # include "../rotfont/times8.h"
 # include "../rotfont/times12.h"
@@ -49,4 +60,5 @@
   {symbol24font, "symbol", 24}
 };
+# endif
 
 /* put these as static in RotFont.c with accessor functions */
Index: /branches/eam_branches/ipp-20150625/Ohana/src/libkapa/include/kapa.h
===================================================================
--- /branches/eam_branches/ipp-20150625/Ohana/src/libkapa/include/kapa.h	(revision 38916)
+++ /branches/eam_branches/ipp-20150625/Ohana/src/libkapa/include/kapa.h	(revision 38917)
@@ -109,5 +109,8 @@
 
 typedef struct {
-  int dx, dy, ascent;
+  int dx;
+  int dy;
+  float dXps;
+  int ascent;
   unsigned char *bits;
 } RotFont;
@@ -233,4 +236,5 @@
 void PSDumpRotSegment PROTO((FILE *f, char *segment, int *Nseg));
 void PSSetFont PROTO((FILE *f, char *name, int size));
+int PSRotStrlen PROTO((char *c));
 
 /* bDrawFuncs.c */
Index: /branches/eam_branches/ipp-20150625/Ohana/src/libkapa/src/DrawRotString.c
===================================================================
--- /branches/eam_branches/ipp-20150625/Ohana/src/libkapa/src/DrawRotString.c	(revision 38916)
+++ /branches/eam_branches/ipp-20150625/Ohana/src/libkapa/src/DrawRotString.c	(revision 38917)
@@ -22,4 +22,13 @@
     return (TRUE);
 }
+
+/* position can be one of 9 values center the text in the following way 
+   0 1 2
+   3 4 5
+   6 7 8
+
+   e.g., 4 has the center of the string at the x,y position
+         0 has the lower-right corner at the position (left & up justified)
+*/
 
 int DrawRotText (int x, int y, char *string, int pos, double angle) {
Index: /branches/eam_branches/ipp-20150625/Ohana/src/libkapa/src/PSRotFont.c
===================================================================
--- /branches/eam_branches/ipp-20150625/Ohana/src/libkapa/src/PSRotFont.c	(revision 38916)
+++ /branches/eam_branches/ipp-20150625/Ohana/src/libkapa/src/PSRotFont.c	(revision 38917)
@@ -9,5 +9,5 @@
   int i, N, code, protect;
   int dX, dY, Xoff, Yoff, X, Y, Nseg, NSEG, YoffBase;
-  double cs, sn, fscale, currentscale;
+  double cs, sn, currentscale;
   int basesize, currentsize;
   RotFont *currentfont;
@@ -23,11 +23,5 @@
   
   /* compute string length */
-  /* PS fonts are somewhat different scales from bitmap font equivalents */
-  fscale = 1.0;
-  if (!strcmp (currentname, "times")) fscale = 1.07;
-  if (!strcmp (currentname, "courier")) fscale = 1.5;
-  if (!strcmp (currentname, "helvetica")) fscale = 0.9;
-  if (!strcmp (currentname, "symbol")) fscale = 1.2;
-  dX = fscale*RotStrlen (string);
+  dX = PSRotStrlen (string);
   dY = currentfont[65].ascent;
   
@@ -201,4 +195,50 @@
 }
 
+# define NROT 256
+int PSRotStrlen (char *c) {
+
+  int i, N, dX, code;
+  double currentscale, scale; 
+
+  RotFont *currentfont = GetRotFontData (&currentscale);
+  scale = currentscale;
+
+  /* find string length */
+  dX = 0;
+
+  code = FALSE;
+  for (i = 0; i < strlen (c); i++) {
+    N = (int)(c[i]);
+    /* skip non-printing characters */
+    if ((N < 0) || (N >= NROT)) continue;
+
+    /* check for special characters */
+    if (!code) {
+      if (N == 94) { /* super-script */
+	scale *= 0.8;
+	continue;
+      }
+      if (N == 95) { /* sub-script */
+	scale *= 0.8;
+	continue;
+      }
+      if (N == 124) { /* normal-script */
+	scale = currentscale;
+	continue;
+      }
+      if (N == 92) { /* backslash */
+	code = TRUE;
+	continue;
+      } 
+      if (N == 38) { /* font-code */
+	i++;
+	continue;
+      }
+    }
+    code = FALSE;
+    dX += scale*currentfont[N].dXps + 1;
+  }
+  return (dX);
+}
 
 
