- // FIXME: try to use os acceleration
- public void fillTrapezoid(int x1, int x2, int y1, int x3, int x4, int y2, int argb) {
- g.setColor(new Color((argb & 0x00FF0000) >> 16, (argb & 0x0000FF00) >> 8, (argb & 0x000000FF)));
- if (x1 == x3 && x2 == x4) {
- g.fillRect(x1, y1, x4 - x1, y2 - y1);
- } else for(int y=y1; y<y2; y++) {
- int _x1 = (int)Math.floor((y - y1) * (x3 - x1) / (y2 - y1) + x1);
- int _y1 = (int)Math.floor(y);
- int _x2 = (int)Math.ceil((y - y1) * (x4 - x2) / (y2 - y1) + x2);
- int _y2 = (int)Math.floor(y) + 1;
- if (_x1 > _x2) { int _x0 = _x1; _x1 = _x2; _x2 = _x0; }
- g.fillRect(_x1, _y1, _x2 - _x1, _y2 - _y1);
- }
+ // this doens't seem to work on Windows
+ public void drawGlyph(org.ibex.graphics.Font.Glyph source, Affine a, Mesh h, int argb, int bg) {
+ //throw new Error("drawGlyph() not implemented");
+ /*
+ Image i = ((AWTGlyph)source).getImage();
+ if (((AWTGlyph)source).i2 == null)
+ ((AWTGlyph)source).i2 = new BufferedImage(i.getWidth(null), i.getHeight(null), BufferedImage.TYPE_INT_ARGB);
+ Image i2 = ((AWTGlyph)source).i2;
+ Graphics g2 = i2.getGraphics();
+ g2.setColor(new java.awt.Color((argb & 0x00FF0000) >> 16, (argb & 0x0000FF00) >> 8, (argb & 0x000000FF)));
+ g2.fillRect(0, 0, i2.getWidth(null), i2.getHeight(null));
+ g2.drawImage(i, 0, 0, null);
+ Graphics g = getGraphics();
+ g.setClip(cx1, cy1, cx2 - cx1, cy2 - cy1);
+ g.drawImage(i2, dx, dy, i2.getWidth(null), i2.getHeight(null), null);
+ g.setColor(new java.awt.Color((argb & 0x00FF0000) >> 16, (argb & 0x0000FF00) >> 8, (argb & 0x000000FF)));
+ g.fillRect(cx1, cy1, dx - cx1, cy2 - cy1);
+ g.fillRect(cx1, cy1, cx2 - cx1, dy - cy1);
+ g.fillRect(dx+i2.getWidth(null), cy1, cx2 - (dx+i2.getWidth(null)), cy2 - cy1);
+ g.fillRect(cx1, dy+i2.getHeight(null), cx2 - cx1, cy2 - (dy+i2.getHeight(null)));
+ g.setClip(0, 0, 1000, 1000);
+ */