From 91fa07eeabb1c256410385947e6a76f1e45c8b48 Mon Sep 17 00:00:00 2001 From: megacz Date: Fri, 30 Jan 2004 07:44:09 +0000 Subject: [PATCH] 2004/01/11 00:49:54 darcs-hash:20040130074409-2ba56-d232b54e38b5052bad7891b8c541fd30c7bf56d6.gz --- src/org/xwt/plat/AWT.java | 17 +++++++++++++++-- src/org/xwt/plat/Java2.java | 3 +-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/org/xwt/plat/AWT.java b/src/org/xwt/plat/AWT.java index b03c65f..1138f26 100644 --- a/src/org/xwt/plat/AWT.java +++ b/src/org/xwt/plat/AWT.java @@ -117,17 +117,28 @@ public class AWT extends JVM { protected org.xwt.Font.Glyph _createGlyph(org.xwt.Font f, char c) { return new AWTGlyph(f, c); } protected static class AWTGlyph extends org.xwt.Font.Glyph { private Image i = null; + private static ColorModel cmodel = new DirectColorModel(32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000); + + // this doesn't work on Win32 because the JVM is broken + /* static final ColorModel cmodel = new ColorModel(8) { public int getRed(int p) { return 0; } public int getGreen(int p) { return 0; } public int getBlue(int p) { return 0; } public int getAlpha(int p) { return p & 0xFF; } }; + */ public AWTGlyph(org.xwt.Font f, char c) { super(f, c); } Image getImage() { if (i == null && isLoaded) { - i = Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(width, height, cmodel, data, 0, width)); + + int[] data2 = new int[data.length]; + for(int i=0; i