public final Res res;
public int max_ascent;
public int max_descent;
- boolean latinCharsPreloaded = false; ///< true if a request to preload ASCII 32-127 has begun
+ boolean latinCharsPreloaded = true; ///< true if a request to preload ASCII 32-127 has begun
Glyph[] glyphs = new Glyph[65535];
public static class Glyph {
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;
- } else if (!encounteredUnrenderedGlyph) {
+ } else {
if (pb != null && g.p != null)
pb.drawPictureAlphaOnly(g.p, x + width, y + g.font.max_ascent - g.baseline, cx1, cy1, cx2, cy2, textcolor);
width += g.advance;
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 || encounteredUnrenderedGlyph) Scheduler.add(glyphRenderingTask);
latinCharsPreloaded = true;
- return encounteredUnrenderedGlyph ? -1 : (((long)width << 16) | (long)height);
+ 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);