- static final Hashtable glyphsToBeCached = new Hashtable();
- static final Hashtable glyphsToBeDisplayed = new Hashtable();
- private static Cache fontCache = new Cache(100);
- public static Font getFont(Stream stream, int pointsize) {
- Font ret = (Font)fontCache.get(stream, new Integer(pointsize));
- if (ret == null) fontCache.put(stream, new Integer(pointsize), ret = new Font(stream, pointsize));
+ 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);
+ Font ret = null;
+ if (m != null) ret = (Font)m.get(new Integer(pointsize));
+ else fonts.put(stream, m = new Basket.Hash());
+ if (ret == null) m.put(new Integer(pointsize), ret = new Font(stream, pointsize));