From: adam Date: Sun, 23 Jan 2005 21:14:43 +0000 (+0000) Subject: fix Font breakage resulting from careless removal of Queue X-Git-Tag: 01-July-2005~20 X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=commitdiff_plain;h=d848b6fbc24b4a11715253052b11d4ebe165555c fix Font breakage resulting from careless removal of Queue darcs-hash:20050123211443-5007d-f42ac8a99e8be40ab138a91a90014767e3292d2c.gz --- diff --git a/src/org/ibex/graphics/Font.java b/src/org/ibex/graphics/Font.java index 99c9bdc..9d012e4 100644 --- a/src/org/ibex/graphics/Font.java +++ b/src/org/ibex/graphics/Font.java @@ -17,8 +17,6 @@ public class Font { private Font(JS stream, int pointsize) { this.stream = stream; this.pointsize = pointsize; } - private static boolean glyphRenderingTaskIsScheduled = false; - public final int pointsize; ///< the size of the font public final JS stream; ///< the stream from which this font was loaded public int max_ascent; ///< the maximum ascent, in pixels @@ -46,9 +44,8 @@ public class Font { // Statics ////////////////////////////////////////////////////////////////////// - static final Hashtable glyphsToBeCached = new Hashtable(); - static final Hashtable glyphsToBeDisplayed = new Hashtable(); - // HACK: replace with Cache + static final Queue toBeRasterized = new Queue(300); + static final Queue toBeDisplayed = new Queue(300); private static Basket.Map fonts = new Basket.Hash(); public static Font getFont(JS stream, int pointsize) { Basket.Map m = (Basket.Map)fonts.get(stream); @@ -72,13 +69,9 @@ public class Font { int cx1, int cy1, int cx2, int cy2, int bg) { int width = 0, height = 0; if (!latinCharsPreloaded) { // preload the Latin-1 charset with low priority (we'll probably want it) - for(int i=48; i<57; i++) if (glyphs[i]==null) glyphsToBeCached.put(glyphs[i]=Platform.createGlyph(this, (char)i),""); - for(int i=32; i<47; i++) if (glyphs[i]==null) glyphsToBeCached.put(glyphs[i]=Platform.createGlyph(this, (char)i),""); - for(int i=57; i<128; i++) if (glyphs[i]==null) glyphsToBeCached.put(glyphs[i]=Platform.createGlyph(this, (char)i),""); - if (!glyphRenderingTaskIsScheduled) { - Platform.Scheduler.add(glyphRenderingTask); - glyphRenderingTaskIsScheduled = true; - } + for(int i=48; i<57; i++) if(glyphs[i]==null) toBeRasterized.append(glyphs[i]=Platform.createGlyph(this, (char)i)); + for(int i=32; i<47; i++) if(glyphs[i]==null) toBeRasterized.append(glyphs[i]=Platform.createGlyph(this, (char)i)); + for(int i=57; i<128; i++) if(glyphs[i]==null) toBeRasterized.append(glyphs[i]=Platform.createGlyph(this, (char)i)); latinCharsPreloaded = true; } for(int i=0; i