X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FFont.java;h=dc4f41e84080ce8be5073ed478ce1aacd527948b;hb=9c2602143956cd39ecf5ef4c9eb31f5f56b5bd66;hp=5124a7a7428ce4971bb9ffca65f9833c813fe0c6;hpb=ef61babe77a94eba181c95a52c0069a612276dff;p=org.ibex.core.git diff --git a/src/org/xwt/Font.java b/src/org/xwt/Font.java index 5124a7a..dc4f41e 100644 --- a/src/org/xwt/Font.java +++ b/src/org/xwt/Font.java @@ -9,12 +9,12 @@ import java.io.*; /** encapsulates a single font (a set of Glyphs) */ public class Font { - private Font(Res res, int pointsize) { this.res = res; this.pointsize = pointsize; } + private Font(Stream res, int pointsize) { this.res = res; this.pointsize = pointsize; } private static boolean glyphRenderingTaskIsScheduled = false; public final int pointsize; ///< the size of the font - public final Res res; ///< the resource from which this font was loaded + public final Stream res; ///< the resource from which this font was loaded public int max_ascent; ///< the maximum ascent, in pixels public int max_descent; ///< the maximum descent, in pixels boolean latinCharsPreloaded = false; ///< true if a request to preload ASCII 32-127 has begun @@ -39,7 +39,7 @@ public class Font { private static final Freetype freetype = new Freetype(); static final Queue glyphsToBeRendered = new Queue(255); private static Cache fontCache = new Cache(100); - public static Font getFont(Res res, int pointsize) { + public static Font getFont(Stream res, int pointsize) { Font ret = (Font)fontCache.get(res, new Integer(pointsize)); if (ret == null) fontCache.put(res, new Integer(pointsize), ret = new Font(res, pointsize)); return ret; @@ -120,7 +120,7 @@ public class Font { Glyph g = (Glyph)glyphsToBeRendered.remove(false); if (g == null) { glyphRenderingTaskIsScheduled = false; return; } if (g.isLoaded) { perform(); /* tailcall to the next glyph */ return; } - Log.info(Glyph.class, "rendering glyph " + g.c); + //Log.info(Glyph.class, "rendering glyph " + g.c); try { freetype.renderGlyph(g); } catch (IOException e) { Log.info(Freetype.class, e); } g.isLoaded = true; Scheduler.add(this); // keep ourselves in the queue until there are no glyphs to render