font = new Font(display, fd.name, (int)(fd.height * x / size.x), fd.style);
font = new Font(display, fd.getName(), fd.getHeight() * x / size.x, fd.getStyle());
  private Image getStateImage(Color background, String state) {  	Image image = (Image) imageHash.get(state);  	if (image == null)   	{  	  System.out.println("Creating image " + state);      ImageData stateImageData = basicSkinable.getImageData(state);      if (stateImageData != null) {        ImageData mergedImageData = imageMerger.merge(background, stateImageData);        image = new Image(display, mergedImageData);      }      else {        /* We need to generate an image for the text */        GC gc = new GC(table);              Point size = gc.stringExtent(state);        Font font = gc.getFont();        int x = 80;        int y = 20;        if(size.x > x) {          // Shrink to fit! The downloading messages          // are too big on Mac OS X at least.          FontData fd = gc.getFont().getFontData()[0];          font = new Font(display, fd.name, (int)(fd.height * x / size.x), fd.style);          gc.setFont(font);          size = gc.stringExtent(state);        }        gc.dispose();        image = new Image(display, x, y);             gc = new GC(image);        gc.setFont(font);        gc.drawText(state, (x - size.x) / 2, (y - size.y) / 2, true);        gc.dispose();      }      imageHash.put(state, image);  	}    return image;  }