Index: unk/Ohana/src/kii/overlay/bDrawColormap.c
===================================================================
--- /trunk/Ohana/src/kii/overlay/bDrawColormap.c	(revision 7040)
+++ 	(revision )
@@ -1,72 +1,0 @@
-# include "Ximage.h"
-
-/* this list must match the one in mana/include/package.h, and equiv
- * we need to define library calls to the kapa and kii packages which mana
- * and other programs would link against.  This would allow them to have 
- * access to the list of available colors.  Or... we need to have mana, etc
- * query kapa/kii about it list of colors...
- */
-
-/* the three columns here are : (opihi name) : (X11 name) : (PostScript coordinate) */
-# define NGRAPHCOLORS 23
-static char GRAPHCOLORS[NGRAPHCOLORS][3][16] = {
-{"black",    	 "black",    	 "0.00 0.00 0.00"}, 
-{"white",    	 "white",    	 "1.00 1.00 1.00"}, 
-{"red",      	 "red",      	 "1.00 0.00 0.00"}, 
-{"pink",     	 "pink",     	 "1.00 0.75 0.80"}, 
-{"orange",   	 "orange",   	 "1.00 0.65 0.00"}, 
-{"yellow",   	 "yellow",   	 "1.00 1.00 0.00"}, 
-{"wheat",    	 "wheat",    	 "0.96 0.87 0.70"}, 
-{"gold",     	 "gold",     	 "1.00 0.84 0.00"}, 
-{"green",    	 "green",    	 "0.00 1.00 0.00"}, 
-{"darkgreen",	 "darkgreen",	 "0.00 0.40 0.00"}, 
-{"blue",     	 "blue",     	 "0.00 0.00 1.00"}, 
-{"skyblue",  	 "skyblue",  	 "0.53 0.81 0.92"}, 
-{"indigo",   	 "mediumpurple", "0.57 0.44 0.86"}, 
-{"violet",   	 "darkviolet", 	 "0.58 0.00 0.88"},
-{"grey10",   	 "grey10",   	 "0.10 0.10 0.10"},
-{"grey20",   	 "grey20",   	 "0.20 0.20 0.20"},
-{"grey30",   	 "grey30",   	 "0.30 0.30 0.30"},
-{"grey40",   	 "grey40",   	 "0.40 0.40 0.40"},
-{"grey50",   	 "grey50",   	 "0.50 0.50 0.50"},
-{"grey60",   	 "grey60",   	 "0.60 0.60 0.60"},
-{"grey70",   	 "grey70",   	 "0.70 0.70 0.70"},
-{"grey80",   	 "grey80",   	 "0.80 0.80 0.80"},
-{"grey90",   	 "grey90",   	 "0.90 0.90 0.90"}};
-
-png_color *MakePNGPalette (int *Npalette) {
-
-  int i;
-  float red, green, blue;
-  png_color *palette;
-
-  ALLOCATE (palette, png_color, NGRAPHCOLORS);
-
-  /* define the palette */
-  for (i = 0; i < NGRAPHCOLORS; i++) {
-    sscanf (GRAPHCOLORS[i][2], "%f %f %f", &red, &green, &blue);
-    palette[i].red = (0xff * red);
-    palette[i].green = (0xff * green);
-    palette[i].blue = (0xff * blue);
-  }
-  *Npalette = NGRAPHCOLORS;
-  return (palette);
-}
-
-/* default to black */
-bDrawColor GetColorByName (char *name) {
-
-  bDrawColor i;
-
-  for (i = 0; i < NGRAPHCOLORS; i++) {
-    if (!strcasecmp (name, GRAPHCOLORS[i][0])) return (i);
-  }
-  return (0);
-}
-
-/*
-
-kapa objects, bDraw, and png all use the same pallete sequence, defined by
-GRAPHCOLORS above.  the color correspond to a color sequence.  
-
-*/
Index: unk/Ohana/src/kii/overlay/bDrawFrame.c
===================================================================
--- /trunk/Ohana/src/kii/overlay/bDrawFrame.c	(revision 7040)
+++ 	(revision )
@@ -1,89 +1,0 @@
-# include "Ximage.h"
-
-int bDrawFrame (Layout *layout) {
-  
-  int i, P, IsLabel, fontsize;
-  double fx, fy, dfx, dfy, range, major, minor, first, next;
-  char *fontname;
-
-  /* each axis is drawn independently */
-  fontname = GetRotFont (&fontsize);
-  for (i = 0; i < 4; i++) {
-    fx  = layout[0].axis[i].fx;
-    fy  = layout[0].axis[i].fy;
-    dfx = layout[0].axis[i].dfx;
-    dfy = layout[0].axis[i].dfy;
-    P = hypot ((double)layout[0].axis[(i+1)%2].dfx, (double)layout[0].axis[(i+1)%2].dfy);
-
-    if (layout[0].axis[i].isaxis) { 
-      bDrawLine (fx, fy, fx+dfx, fy+dfy); 
-    }
-    
-    if (layout[0].axis[i].areticks) {
-      range = layout[0].axis[i].max - layout[0].axis[i].min;
-
-      AxisTickScale (&layout[0].axis[i], &major, &minor);
-
-      first = minor*((int)(layout[0].axis[i].min/minor));
-      if ((range > 0) && (first < layout[0].axis[i].min)) {
-	first += minor;
-      }
-      if ((range < 0) && (first > layout[0].axis[i].min)) {
-	first -= minor;
-      }
-      for (next = first; ((range > 0) && (next <= layout[0].axis[i].max)) || ((range < 0) && (next >= layout[0].axis[i].max));) {
-	IsLabel = FALSE;
-	if ((fabs((int)(next/major) - (next/major)) < 0.5*(minor/major)) || 
-	    (fabs ((int)((next + 0.5*minor)/major) - (next/major)) < 0.5*(minor/major)) ||
-	    (fabs ((int)((next - 0.5*minor)/major) - (next/major)) < 0.5*(minor/major)))
-	  IsLabel = layout[0].axis[i].islabel;
-	bDrawTick (fx, fy, dfx, dfy, P, layout[0].axis[i].min, layout[0].axis[i].max, next, IsLabel, i);
-	if (range > 0) 
-	  next += minor;
-	else 
-	  next -= minor;
-      }
-    }
-  }
-  return (TRUE);
-}
-
-void bDrawTick (double fx, double fy, double dfx, double dfy, int P, double min, double max, double value, int mode, int naxis) {
-  
-  int pos, dir, fontsize;
-  double size, n, x, y, dx, dy;
-  char string[64], *fontname;
-
-  pos = size = 0;
-
-  if (mode == 1) { size = MAX (0.02, 7.0 / P); }
-  if (mode == 0) { size = MAX (0.01, 4.0 / P); }
-  
-  n = P / sqrt ((double)(dfx*dfx + dfy*dfy));
-  x = fx + (value-min)*dfx/(max - min);
-  y = fy + (value-min)*dfy/(max - min);
-
-  dir = +1;
-  if ((naxis == 0) || (naxis == 1)) dir *= -1;
-  dx = dir*size*dfy*n;	
-  dy = dir*size*dfx*n;
-  
-  bDrawLine (x, y, x+dx, y+dy);
-
-  if (mode == 1) {
-    fontname = GetRotFont (&fontsize);
-
-    /* temporarily assume rectilinear axes */
-    if (naxis == 0) { dx = 0; dy = -dir*(0.8*fontsize + 1); pos = 1; }
-    if (naxis == 2) { dx = 0; dy = -dir*(0.8*fontsize + 1); pos = 7; }
-
-    if (naxis == 1) { dy = 0; dx = -(0.8*fontsize + 1); pos = 3; }
-    if (naxis == 3) { dy = 0; dx = +(0.8*fontsize + 1); pos = 5; }
-
-    x = fx + (value-min)*dfx/(max - min) + dx;
-    y = fy + (value-min)*dfy/(max - min) + dy;
-    if (fabs(value) < 1e-14) { value = 0.0; }
-    sprintf (string, "%g", value);
-    bDrawRotText ((int)x, (int)y, string, pos, 0.0);
-  }
-}
Index: unk/Ohana/src/kii/overlay/bDrawFuncs.c
===================================================================
--- /trunk/Ohana/src/kii/overlay/bDrawFuncs.c	(revision 7040)
+++ 	(revision )
@@ -1,417 +1,0 @@
-# include "Ximage.h"
-
-static int bWeight;
-static int bType;
-static bDrawColor bColor;
-static bDrawBuffer *bBuffer;
-
-bDrawBuffer *bDrawBufferCreate (int Nx, int Ny) {
-
-  int i, j;
-  bDrawColor white;
-  bDrawBuffer *buffer;
-
-  white = GetColorByName ("white");
-
-  ALLOCATE (buffer, bDrawBuffer, 1);
-  buffer[0].Nx = Nx;
-  buffer[0].Ny = Ny;
-
-  ALLOCATE (buffer[0].pixels, bDrawColor *, Ny);
-  for (i = 0; i < Ny; i++) {
-    ALLOCATE (buffer[0].pixels[i], bDrawColor, Nx);
-    for (j = 0; j < Nx; j++) {
-      buffer[0].pixels[i][j] = white;
-    }
-  }
-  return (buffer);
-}
-
-void bDrawBufferFree (bDrawBuffer *buffer) {
-
-  int i;
-
-  for (i = 0; i < buffer[0].Ny; i++) {
-    free (buffer[0].pixels[i]);
-  }
-  free (buffer[0].pixels);
-  free (buffer);
-  return;
-}
-
-void bDrawSetBuffer (bDrawBuffer *buffer) {
-  bBuffer = buffer;
-  return;
-}
-
-void bDrawSetStyle (bDrawColor color, int lw, int lt) {
-  bColor = color;
-  bWeight = lw;
-  bType = lt;
-  return;
-}
-
-// draw a point in the current color 
-void bDrawPoint (int x, int y) {
-
-  if (x < 0) return;
-  if (y < 0) return;
-  if (x >= bBuffer[0].Nx) return;
-  if (y >= bBuffer[0].Ny) return;
-  bBuffer[0].pixels[y][x] = bColor;
-  return;
-}
-
-// draw a point in the current color 
-void bDrawPointf (float x, float y) {
-
-  bDrawPoint (ROUND(x), ROUND(y));
-  return;
-}
-
-void bDrawTriOpen (double x1, double y1, double x2, double y2, double x3, double y3) {
-
-  bDrawLine (x1, y1, x2, y2);
-  bDrawLine (x2, y2, x3, y3);
-  bDrawLine (x3, y3, x1, y1);
-
-  return;
-}
-
-void bDrawRectOpen (double x1, double y1, double x2, double y2) {
-
-  int X1, Y1, X2, Y2;
-
-  if (x1 > x2) SWAP (x1, x2);
-  if (y1 > y2) SWAP (y1, y2);
-
-  X1 = MIN (MAX (ROUND (x1), 0), bBuffer[0].Nx - 1);
-  X2 = MIN (MAX (ROUND (x2), 1), bBuffer[0].Nx);
-
-  Y1 = MIN (MAX (ROUND (y1), 0), bBuffer[0].Ny - 1);
-  Y2 = MIN (MAX (ROUND (y2), 1), bBuffer[0].Ny);
-
-  bDrawLineHorizontal (X1, X2, Y1);
-  bDrawLineHorizontal (X1, X2, Y2);
-  bDrawLineVertical (X1, Y1, Y2);
-  bDrawLineVertical (X2, Y1, Y2);
-  return;
-}
-
-void bDrawRectFill (double x1, double y1, double x2, double y2) {
-
-  int i;
-  int X1, Y1, X2, Y2;
-
-  if (x1 > x2) SWAP (x1, x2);
-  if (y1 > y2) SWAP (y1, y2);
-
-  X1 = MIN (MAX (ROUND (x1), 0), bBuffer[0].Nx - 1);
-  X2 = MIN (MAX (ROUND (x2), 1), bBuffer[0].Nx);
-
-  Y1 = MIN (MAX (ROUND (y1), 0), bBuffer[0].Ny - 1);
-  Y2 = MIN (MAX (ROUND (y2), 0), bBuffer[0].Ny);
-
-  for (i = Y1; i < Y2; i++) {
-    bDrawLineHorizontal (X1, X2, i);
-  } 
-  return;
-}
-
-// identify the quadrant and draw the correct line
-void bDrawLine (double x1, double y1, double x2, double y2) {
-
-  int FlipDirect, FlipCoords;
-  int X1, Y1, X2, Y2, dX, dY;
-
-  /* rather than draw the line from float positions, we find the closest
-     integer end-points and draw the line between those pixels */ 
-
-  X1 = ROUND(x1);
-  Y1 = ROUND(y1);
-  X2 = ROUND(x2);
-  Y2 = ROUND(y2);
-
-  dX = X2 - X1;
-  dY = Y2 - Y1;
-
-  FlipCoords = (abs(dX) < abs(dY));
-  FlipDirect = FlipCoords ? (y1 > y2) : (x1 > x2);
-
-  if (!FlipDirect && !FlipCoords) bDrawLineWeight (X1, Y1, X2, Y2, FALSE);
-  if ( FlipDirect && !FlipCoords) bDrawLineWeight (X2, Y2, X1, Y1, FALSE);
-  if (!FlipDirect &&  FlipCoords) bDrawLineWeight (Y1, X1, Y2, X2, TRUE);
-  if ( FlipDirect &&  FlipCoords) bDrawLineWeight (Y2, X2, Y1, X1, TRUE);
-
-  return;
-}
-
-// draw a series of lines to give the line weight
-void bDrawLineWeight (int X1, int Y1, int X2, int Y2, int swapcoords) {
-
-  int dN, dNs, dNe;
-
-  dNs = -0.5*(bWeight - 1); 
-  /* 0, 0, 0, -1, -1, -2, -2 */
-
-  dNe = +0.5*bWeight + 1; 
-  /* 1, 1, 2, 2, 2, 3, 3 */
-
-  for (dN = dNs; dN < dNe; dN++) {
-    bDrawLineBresen (X1, Y1 + dN, X2, Y2 + dN, swapcoords);
-  }
-  return;
-}
-
-// use the Bresenham line drawing technique
-// integer-only Bresenham line-draw version which is fast
-void bDrawLineBresen (int X1, int Y1, int X2, int Y2, int swapcoords) {
-
-  int X, Y, dX, dY;
-  int e, e2;
-  int N, DashOn;
-
-  dX = X2 - X1;
-  dY = Y2 - Y1;
-
-  DashOn = TRUE;
-
-  Y = Y1;
-  e = 0;
-  for (X = X1, N = 0; X <= X2; X++, N++) {
-    if (bType == 1) { DashOn = (N % 10) < 5; }
-    if (bType == 2) { DashOn = (N % 6) < 3; }
-    if (swapcoords) {
-      if (DashOn) bDrawPoint (Y,X);
-    } else {
-      if (DashOn) bDrawPoint (X,Y);
-    }
-    e += dY;
-    e2 = 2 * e;
-    if (e2 > dX) {
-      Y++;
-      e -= dX;
-    } 
-    if (e2 < -dX) {
-      Y--;
-      e += dX;
-    }
-  }
-  return;
-}
-
-void bDrawLineHorizontal (int X1, int X2, int Y) {
-  
-  int i;
-
-  for (i = X1; i < X2; i++) {
-    bBuffer[0].pixels[Y][i] = bColor;
-  }
-  return;
-}
-
-void bDrawLineVertical (int X, int Y1, int Y2) {
-  
-  int i;
-
-  for (i = Y1; i < Y2; i++) {
-    bBuffer[0].pixels[i][X] = bColor;
-  }
-  return;
-}
-
-void bDrawTriFill (double x1, double y1, double x2, double y2, double x3, double y3) {
-
-  bDrawTriOpen (x1, y1, x2, y2, x3, y3);
-  return;
-}
-
-void bDrawArc (double Xc, double Yc, double Xr, double Yr, double Ts, double Te) {
-
-  float t, dt;
-  int x, y;
-
-  /* drawing a complete circle */
-//  if ((fabs(Te - Ts) > 360.0) && (Xr == Yr)) {
-//    bDrawCircle (Xc, Yc, Xr);
-//    return;
-//  }
-
-  /* only draw a single loop */
-  if (fabs(Te - Ts) > 360.0) {
-    Te = 360.0;
-    Ts = 0.0;
-  }
-
-  /* smallest angle is 1/Rmax */
-  dt = MAX (fabs(Xr * sin(Ts*RAD_DEG)), fabs(Yr * cos(Ts*RAD_DEG)));
-  dt = 1.0 / dt;
-
-  for (t = Ts*RAD_DEG; t <= Te*RAD_DEG; t += dt) {
-    x = Xr*cos(t) + Xc;
-    y = Yr*sin(t) + Yc;
-
-    /* we could use the value of MAX(dy/dt,dx/dt) to set dt */
-    bDrawPoint (x,y);
-
-    dt = MAX (fabs(Xr * sin(t)), fabs(Yr * cos(t)));
-    dt = 1.0 / dt;
-  }
-  return;
-}
-
-// draw a series of circles to give line weight
-void bDrawCircle (double xc, double yc, double radius) {
-
-  int dN, dNs, dNe;
-
-  dNs = -0.5*(bWeight - 1); 
-  /* 0, 0, 0, -1, -1, -2, -2 */
-
-  dNe = +0.5*bWeight + 1; 
-  /* 1, 1, 2, 2, 2, 3, 3 */
-
-  for (dN = dNs; dN < dNe; dN++) {
-    bDrawCircle (xc, yc, radius + dN);
-  }
-  return;
-}
-
-// draw a pure circle  
-void bDrawCircleSingle (double xc, double yc, double radius) {
-
-  int Xc, Yc, Radius;
-  int x, y, d;
-
-  Xc = ROUND(xc);
-  Yc = ROUND(yc);
-  Radius = ROUND(radius);
-
-  x = 0;
-  y = Radius;
-
-  // d = 3 - 2*Radius;
-  d = 5 - 4*radius;
-
-  while (x <= y) {
-    bDrawPoint (Xc+x, Yc+y);
-    bDrawPoint (Xc+x, Yc-y);
-    bDrawPoint (Xc-x, Yc+y);
-    bDrawPoint (Xc-x, Yc-y);
-    bDrawPoint (Xc+y, Yc+x);
-    bDrawPoint (Xc+y, Yc-x);
-    bDrawPoint (Xc-y, Yc+x);
-    bDrawPoint (Xc-y, Yc-x);
-
-    if (d < 0) {
-      // d = d + 4*x + 6;
-      d = d + 8*x + 4;
-    } else {
-      // d = d + 4*(x-y) + 10;
-      d = d + 8*(x-y) + 8;
-      y--;
-    }
-    x++;
-  }
-}
-
-// draw a pure circle  
-void bDrawCircleFill (double xc, double yc, double radius) {
-
-  int Xc, Yc, Radius;
-  int x, y, d;
-
-  Xc = ROUND(xc);
-  Yc = ROUND(yc);
-  Radius = ROUND(radius);
-
-  x = 0;
-  y = Radius;
-
-  // d = 3 - 2*Radius;
-  d = 5 - 4*radius;
-
-  while (x <= y) {
-    bDrawLineHorizontal (Xc-x, Xc+x, Yc+y);
-    bDrawLineHorizontal (Xc-x, Xc+x, Yc-y);
-    bDrawLineHorizontal (Xc-y, Xc+y, Yc+x);
-    bDrawLineHorizontal (Xc-y, Xc+y, Yc-x);
-
-    if (d < 0) {
-      // d = d + 4*x + 6;
-      d = d + 8*x + 4;
-    } else {
-      // d = d + 4*(x-y) + 10;
-      d = d + 8*(x-y) + 8;
-      y--;
-    }
-    x++;
-  }
-}
-
-/* 
-the discriminant of inside or outside the circle is:
-
-f(x,y) = x^2 + y^2 - r^2
-
-- negative: (x,y) inside circle
-- positive: (x,y) outside circle
-
-given d(0) = f(x,y); find d(1) = f(x+1,y):
-d(1) = (x+1)^2 + y^2 - r^2
-d(1) = d(0) + 2x + 1
-(use d(1) if d(0) < 0, ie inside circle)
-
-given d(0) = f(x,y); find d(1) = f(x+1,y-1):
-d(1) = (x+1)^2 + (y-1)^2 - r^2
-d(1) = d(0) + 2x + 1 - 2y + 1
-d(1) = d(0) + 2(x-y) + 2
-
-* init d to f(1,r-1/2) instead of r, keeping the effective boundary 
-  between two pixels (also, an inside point)
-
-f(1,r-1/2) = 1 + (r-1/2)^2 - r^2 = 5/4 - r
-f(1,r-1/4) = 1 + (r-1/4)^2 - r^2 = 1 + r/2 + 1/16 = 17/16 + r/2
-
-f(1,r-x)   = 1 + (r-x)^2 - r^2 = 1 - 2xr + x^2 = A (3 - 2r)
-
-1+x^2 = 3A
--2x = -2A
-
-A = x
-
-1 - 3x + x^2 = 0
-
-(3 +/- sqrt(9 - 4))/2 = (3 - sqrt(5))/2
-
-multiply all d values by 4 to get integer tests:
-
-d'(0) = 5 - 4r
-d'(in) = d' + 8x + 4
-d'(out) = d' + 8(x-y) + 8
-
-*/
-
-/* This is the Bresenham line-drawing algorithm for 1st and 4th quandrant
-   vectors with positive and negative slopes < 1. this is the sequence if we use
-   float errors and tests it is easy to understand, but slower than it could be
-
-  { 
-    float e, m;
-    m = dY / dX;
-    Y = Y1;
-    e = 0;
-    for (X = X1; X <= X2; X++) {
-      plot (X,Y);
-      e += m;
-      if (e > 0.5) {
-	Y++;
-	e -= 1.0;
-      }
-      if (e < -0.5) {
-	Y--;
-	e += 1.0;
-      }
-    }
-  }
-*/
Index: unk/Ohana/src/kii/overlay/bDrawRotFont.c
===================================================================
--- /trunk/Ohana/src/kii/overlay/bDrawRotFont.c	(revision 7040)
+++ 	(revision )
@@ -1,211 +1,0 @@
-# include "Ximage.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)
-# define NEARINT(x) ((x < 0) ? ((int)(x - 0.5)) : ((int)(x + 0.5)))
-  
-static bDrawColor black;
-static bDrawColor white;
-
-int bDrawRotText (int x, int y, char *string, int pos, double angle) {
-
-  unsigned char *bitmap;
-  char *currentname, basename[64], *c; 
-  int i, dy, dx, N, X, Y, code;
-  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 */
-  for (c = string; (*c == ' ') || (*c == '\t'); c++);
-  if (*c == 0) return (FALSE);
-  
-  /* compute string length */
-  cs = cos(angle*RAD_DEG);
-  sn = sin(angle*RAD_DEG);
-  dX = RotStrlen (c);
-  dY = currentfont[65].ascent;
-
-  /* apply appropriate offset */
-  Xoff = Yoff = 0;
-  switch (pos) {
-  case 0: Xoff =     -dX; Yoff = dY; break;
-  case 1: Xoff = -0.5*dX; Yoff = dY; break;
-  case 2: Xoff =       0; Yoff = dY; break;
-  case 3: Xoff =     -dX; Yoff = 0.5*dY; break;
-  case 4: Xoff = -0.5*dX; Yoff = 0.5*dY; break;
-  case 5: Xoff =       0; Yoff = 0.5*dY; break;
-  case 6: Xoff =     -dX; Yoff = 0; break;
-  case 7: Xoff = -0.5*dX; Yoff = 0; break;
-  case 8: Xoff =       0; Yoff = 0; break;
-  }
-
-  code = FALSE;
-
-  YoffBase = Yoff;
-  /* draw characters one-by-one */
-  for (i = 0; i < strlen(c); i++) {
-    N = (int)(c[i]);
-    if ((N < 0) || (N >= NROTCHARS)) continue;
-
-    /* check for special characters */
-    if (!code) {
-      if (N == 94) {
-	SetRotFont (currentname, (int)(0.8*currentsize));
-	currentfont = GetRotFontData (&currentscale);
-	Yoff -= 0.5*currentscale*dY;
-	continue;
-      }
-      if (N == 95) { 
-	SetRotFont (currentname, (int)(0.8*currentsize));
-	currentfont = GetRotFontData (&currentscale);
-	Yoff += 0.5*currentscale*dY;
-	continue;
-      }
-      if (N == 124) {
-	SetRotFont (currentname, basesize);
-	currentfont = GetRotFontData (&currentscale);
-	Yoff = YoffBase;
-	continue;
-      }
-      if (N == 92) {
-	code = TRUE;
-	continue;
-      } 
-      if (N == 38) {
-	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++;
-	continue;
-      }
-    }
-    code = FALSE;
-
-    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 (basename, basesize);
-  return (TRUE);
-}
-
-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;
-  bDrawColor color;
-  double i, j, cs, sn, rscale, tmp;
-  int X, Y, X0, X1, X2, Y0, Y1, Y2, x0, y0;
-
-  /* this mode option is nort actually used... */
-  if (mode) {
-    color = black;
-  } else {
-    color = white;
-  } 
-    
-  byte_line = (int) ((dx + 7) / 8);
-
-  cs = cos(angle*RAD_DEG);  sn = sin(angle*RAD_DEG);
-  rscale = 1.0 / scale;
-
-  X0 = 0;
-  Y0 = 0;
-  x0 = 0;
-  y0 = 0;
-
-  X2 = X1 = XPROC (0,0);
-  Y2 = Y1 = YPROC (0,0);
-
-  X = XPROC (dx,0);
-  Y = YPROC (dx,0);
-# ifdef DRAWBOXES
-  bDrawLine (x+X, y+Y, x+X1, y+Y1);
-  Xt = X;
-  Yt = Y;
-# endif
-  X1 = MIN (X, X1);
-  X2 = MAX (X, X2);
-  Y1 = MIN (Y, Y1);
-  Y2 = MAX (Y, Y2);
-
-  X = XPROC (dx,dy);
-  Y = YPROC (dx,dy);
-# ifdef DRAWBOXES
-  bDrawLine (x+X, y+Y, x+Xt, y+Yt);
-  Xt = X;
-  Yt = Y;
-# endif
-  Y1 = MIN (Y, Y1);
-  Y2 = MAX (Y, Y2);
-  X1 = MIN (X, X1);
-  X2 = MAX (X, X2);
-
-  X = XPROC (0,dy);
-  Y = YPROC (0,dy);
-# ifdef DRAWBOXES
-  bDrawLine (x+X, y+Y, x+Xt, y+Yt);
-  Xt = X;
-  Yt = Y;
-# endif
-  Y1 = MIN (Y, Y1);
-  Y2 = MAX (Y, Y2);
-  X1 = MIN (X, X1);
-  X2 = MAX (X, X2);
-
-  bDrawSetStyle (color, 0, 0);
-  if (scale > 1) {
-    for (i = X1; i <= X2; i+=1) {
-      for (j = Y1; j <= Y2; j+=1) {
-	tmp = rscale*(cs*(i - X0) + sn*(j - Y0)) + x0;  ii = NEARINT (tmp);
-	tmp = rscale*(cs*(j - Y0) - sn*(i - X0)) + y0;  jj = NEARINT (tmp);
-	if ((ii < 0) || (ii >= dx) || (jj < 0) || (jj >= dy)) continue;
-	byte = byte_line * jj + (ii / 8);
-	bit = ii % 8;
-	flag = 0x01 & (bitmap[byte] >> bit);
-	if (flag) bDrawPointf (x + i, y + j);
-      }
-    }
-  } else {
-    for (i = X1; i <= X2; i+=scale) {
-      for (j = Y1; j <= Y2; j+=scale) {
-	tmp = rscale*(cs*(i - X0) + sn*(j - Y0)) + x0;  ii = NEARINT (tmp);
-	tmp = rscale*(cs*(j - Y0) - sn*(i - X0)) + y0;  jj = NEARINT (tmp);
-	if ((ii < 0) || (ii >= dx) || (jj < 0) || (jj >= dy)) continue;
-	byte = byte_line * jj + (ii / 8);
-	bit = ii % 8;
-	flag = 0x01 & (bitmap[byte] >> bit);
-	if (flag) bDrawPointf (x + i, y + j);
-      }
-    }
-  }
-  bDrawSetStyle (black, 0, 0);
-  return (TRUE);
-}
