* @returns <code>(width<<32)|height</code>
*/
public long rasterizeGlyphs(String text, PixelBuffer pb, int textcolor, int x, int y, int cx1, int cy1, int cx2, int cy2) {
+ return rasterizeGlyphs(text, pb, textcolor, x, y, cx1, cy1, cx2, cy2, 0); }
+ public long rasterizeGlyphs(String text, PixelBuffer pb, int textcolor, int x, int y,
+ int cx1, int cy1, int cx2, int cy2, int bg) {
int width = 0, height = 0;
if (!latinCharsPreloaded) { // preload the Latin-1 charset with low priority (we'll probably want it)
for(int i=48; i<57; i++) if (glyphs[i]==null) glyphsToBeCached.put(glyphs[i]=Platform.createGlyph(this, (char)i),"");
Glyph g = glyphs[c];
if (g == null) glyphs[c] = g = Platform.createGlyph(this, c);
g.render();
- if (pb != null) pb.drawGlyph(g, x + width, y + g.font.max_ascent - g.baseline, cx1, cy1, cx2, cy2, textcolor);
+ if (pb != null) pb.drawGlyph(g,
+ x + width,
+ y + g.font.max_ascent - g.baseline,
+ x+width,
+ cy1,
+ x+width+g.advance,
+ cy2,
+ textcolor, bg);
width += g.advance;
height = java.lang.Math.max(height, max_ascent + max_descent);
}