# include "Ximage.h"
  
void bDrawLabels (Layout *layout) {
  
  int i, pos, x, y, size;
  double angle;
  char *fontname;

  pos = 0;
  fontname = GetRotFont (&size);
  for (i = 0; i < 8; i++) {
    if (strcmp (layout[0].label[i].text, "")) {
      angle = 0;
      switch (i) {
      case 0: pos = 7; break;
      case 1: pos = 1; angle = -90; break;
      case 2: pos = 1; break;
      case 3: pos = 1; angle =  90; break;
      case 4: pos = 2; break;
      case 5: pos = 0; break;
      case 6: pos = 8; break;
      case 7: pos = 6; break;
      }	
      x = layout[0].label[i].x;
      y = layout[0].label[i].y;
      SetRotFont (layout[0].label[i].font, layout[0].label[i].size); 
      bDrawRotText (x, y, layout[0].label[i].text, pos, angle);
    }
  }
  SetRotFont (fontname, size);
}

void bDrawPtext (Layout *layout) {

  int i, x, y, size;
  double angle;
  char *fontname;

  fontname = GetRotFont (&size);
  for (i = 0; i < layout[0].Nptext; i++) {
    if (strcmp (layout[0].ptext[i].text, "")) {
      angle = layout[0].ptext[i].angle;
      x = layout[0].ptext[i].x;
      y = layout[0].ptext[i].y;
      SetRotFont (layout[0].ptext[i].font, layout[0].ptext[i].size);
      bDrawRotText (x, y, layout[0].ptext[i].text, 5, angle);
    }
  }
  SetRotFont (fontname, size);
}

/*
            
 4____2___5 
  |       | 
  |       | 
 1|       |3
  |       |
  |       |
  ---------
  6   0   7

*/


