2004/01/13 19:27:16
[org.ibex.core.git] / src / org / xwt / Font.java
index deb3c07..2d9fcd7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2003 Adam Megacz, see the COPYING file for licensing [GPL]
+// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
 package org.xwt;
 import org.xwt.translators.*;
 import org.xwt.util.*;
@@ -66,7 +66,10 @@ public class Font {
         for(int i=0; i<text.length(); i++) {
             final char c = text.charAt(i);
             Glyph g = glyphs[c];
-            if (g == null) glyphs[c] = g = Platform.createGlyph(this, c);    // prepend so they are high priority
+            if (g == null) {
+                g = Platform.createGlyph(this, c);    // prepend so they are high priority
+                glyphs[c] = g;
+            }
             if (!g.isLoaded) {
                 glyphsToBeRendered.prepend(g);              // even if it's already in the queue, boost its priority
                 encounteredUnrenderedGlyph = true;
@@ -120,9 +123,8 @@ 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
         glyphRenderingTaskIsScheduled = true;
     } };