Index: trunk/Ohana/src/kapa/graph/bDrawRotFont.c
===================================================================
--- trunk/Ohana/src/kapa/graph/bDrawRotFont.c	(revision 5610)
+++ trunk/Ohana/src/kapa/graph/bDrawRotFont.c	(revision 5611)
@@ -1,6 +1,6 @@
 # include "Ximage.h"
 # include "bDraw.h"
-# include "alphabet.h"
-
+
+# define NROTCHARS 256
 # define XPROC(x,y) (scale*(cs*((x) - x0) - sn*((y) - y0)) + X0)
 # define YPROC(x,y) (scale*(cs*((y) - y0) + sn*((x) - x0)) + Y0)
@@ -12,12 +12,19 @@
 int bDrawRotText (int x, int y, char *string, int pos, double angle) {
 
-  char *c, *bitmap, basefont[64];
+  unsigned char *bitmap;
+  char *currentname, basename[64], *c; 
   int i, dy, dx, N, X, Y, code;
-  int dX, Xoff, dY, Yoff, YoffBase, basesize;
-  double cs, sn;
-
-  // return (TRUE);
+  int dX, Xoff, dY, Yoff, YoffBase;
+  int currentsize, basesize;
+  double cs, sn, currentscale;
+  RotFont *currentfont;
+
   white = GetColorByName ("white");
   black = GetColorByName ("black");
+
+  currentname = GetRotFont (&currentsize);
+  currentfont = GetRotFontData (&currentscale);
+  strcpy (basename, currentname);
+  basesize = currentsize;
 
   /* strip leading whitespace */
@@ -29,5 +36,5 @@
   sn = sin(angle*RAD_DEG);
   dX = RotStrlen (c);
-  dY = activefont[65].ascent;
+  dY = currentfont[65].ascent;
 
   /* apply appropriate offset */
@@ -47,12 +54,9 @@
   code = FALSE;
 
-  strcpy (basefont, currentname);
-  basesize = currentsize;
-
   YoffBase = Yoff;
   /* draw characters one-by-one */
   for (i = 0; i < strlen(c); i++) {
     N = (int)(c[i]);
-    if ((N < 0) || (N >= NROT)) continue;
+    if ((N < 0) || (N >= NROTCHARS)) continue;
 
     /* check for special characters */
@@ -60,14 +64,17 @@
       if (N == 94) {
 	SetRotFont (currentname, (int)(0.8*currentsize));
-	Yoff -= 0.5*activescale*dY;
+	currentfont = GetRotFontData (&currentscale);
+	Yoff -= 0.5*currentscale*dY;
 	continue;
       }
       if (N == 95) { 
 	SetRotFont (currentname, (int)(0.8*currentsize));
-	Yoff += 0.5*activescale*dY;
+	currentfont = GetRotFontData (&currentscale);
+	Yoff += 0.5*currentscale*dY;
 	continue;
       }
       if (N == 124) {
 	SetRotFont (currentname, basesize);
+	currentfont = GetRotFontData (&currentscale);
 	Yoff = YoffBase;
 	continue;
@@ -80,13 +87,17 @@
 	if (c[i+1] == 'h') {
 	  SetRotFont ("helvetica", currentsize);
+	  currentfont = GetRotFontData (&currentscale);
 	}
 	if (c[i+1] == 't') {
 	  SetRotFont ("times", currentsize);
+	  currentfont = GetRotFontData (&currentscale);
 	}
 	if (c[i+1] == 'c') {
 	  SetRotFont ("courier", currentsize);
+	  currentfont = GetRotFontData (&currentscale);
 	}
 	if (c[i+1] == 's') {
 	  SetRotFont ("symbol", currentsize);
+	  currentfont = GetRotFontData (&currentscale);
 	}
 	i++;
@@ -96,17 +107,17 @@
     code = FALSE;
 
-    bitmap = activefont[N].bits;
-    dx = activefont[N].dx;
-    dy = activefont[N].dy;
-    X = x + (int)(Xoff*cs - Yoff*sn) + (int)(activescale*activefont[N].ascent*sn);
-    Y = y + (int)(Xoff*sn + Yoff*cs) - (int)(activescale*activefont[N].ascent*cs);
-    bDrawRotBitmap (X, Y, dx, dy, bitmap, TRUE, angle, activescale);
-    Xoff += 1 + (int)(activescale*dx + 0.5);
+    bitmap = currentfont[N].bits;
+    dx = currentfont[N].dx;
+    dy = currentfont[N].dy;
+    X = x + (int)(Xoff*cs - Yoff*sn) + (int)(currentscale*currentfont[N].ascent*sn);
+    Y = y + (int)(Xoff*sn + Yoff*cs) - (int)(currentscale*currentfont[N].ascent*cs);
+    bDrawRotBitmap (X, Y, dx, dy, bitmap, TRUE, angle, currentscale);
+    Xoff += 1 + (int)(currentscale*dx + 0.5);
   }
-  SetRotFont (basefont, basesize);
+  SetRotFont (basename, basesize);
   return (TRUE);
 }
 
-int bDrawRotBitmap (int x, int y, int dx, int dy, char *bitmap, int mode, double angle, double scale) {
+int bDrawRotBitmap (int x, int y, int dx, int dy, unsigned char *bitmap, int mode, double angle, double scale) {
 
   int ii, jj, byte_line, byte, bit, flag;
