X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fgraphics%2FFont.java;h=70451a36ed0f2adca6f05501612e4aa9d47676ba;hp=99c9bdc4e422ea76c6059bb7e249fec485202085;hb=HEAD;hpb=890000a10a0ccdc49f62946bddf1c0b840495a94 diff --git a/src/org/ibex/graphics/Font.java b/src/org/ibex/graphics/Font.java index 99c9bdc..70451a3 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); @@ -66,35 +63,42 @@ public class Font { * Rasterize the glyphs of text. * @returns (width<<32)|height */ - public long rasterizeGlyphs(String text, PixelBuffer pb, int textcolor, int x, int y, int cx1, int cy1, int cx2, int cy2) { - return rasterizeGlyphs(text, pb, textcolor, x, y, cx1, cy1, cx2, cy2, 0); } - public long rasterizeGlyphs(String text, PixelBuffer pb, int textcolor, int x, int y, - int cx1, int cy1, int cx2, int cy2, int bg) { + public String rasterizeGlyphs(String text) { + StringBuffer path = new StringBuffer(text.length() * 50); + for(int i=0; i