for(int i=0; i<text.length(); i++) {
final char c = text.charAt(i);
Glyph g = glyphs[c];
- if (g == null) glyphsToBeRendered.prepend(g = new Glyph(c, this)); // prepend so they are high priority
+ if (g == null) glyphsToBeRendered.prepend(g = glyphs[c] = new Glyph(c, this)); // prepend so they are high priority
if (g.p == null) {
glyphsToBeRendered.prepend(g);
encounteredUnrenderedGlyph = true;
height = java.lang.Math.max(height, max_ascent + max_descent);
}
}
-
+
if (encounteredUnrenderedGlyph && callback != null) Scheduler.add(new Scheduler.Task() { public void perform() {
for(int i=0; i<text.length(); i++) {
Glyph g = glyphs[text.charAt(i)];
}
callback.perform();
}});
-
- if (!latinCharsPreloaded) for(int i=32; i<128; i++) glyphsToBeRendered.append(glyphs[i] = new Glyph((char)i, this));
+ if (!latinCharsPreloaded) {
+ for(int i=48; i<57; i++) glyphsToBeRendered.append(glyphs[i] = new Glyph((char)i, this));
+ for(int i=32; i<47; i++) glyphsToBeRendered.append(glyphs[i] = new Glyph((char)i, this));
+ for(int i=57; i<128; i++) glyphsToBeRendered.append(glyphs[i] = new Glyph((char)i, this));
+ }
if (!latinCharsPreloaded || encounteredUnrenderedGlyph) Scheduler.add(glyphRenderingTask);
latinCharsPreloaded = true;
- return encounteredUnrenderedGlyph ? -1 : (((long)width << 16) | (long)height);
+ if (encounteredUnrenderedGlyph) return -1;
+ return ((((long)width) << 32) | (long)(height & 0xffffffffL));
}
- public int textwidth(String s) { return (int)(textsize(s) >>> 16L); }
+ public int textwidth(String s) { return (int)((textsize(s) >>> 32) & 0xffffffff); }
public int textheight(String s) { return (int)(textsize(s) & 0xffffffffL); }
public long textsize(String s) {
Long l = (Long)sizeCache.get(s);