X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fgraphics%2FFont.java;h=8e29b22d600181246ab7bf9000f74e32a68319af;hp=1f8f35c0eb1a344f81490252cb7f44ad143ebede;hb=870d6acd4d14fe474454fe4e07d01233a490c49f;hpb=3859918938f035c60996037e0eb90719a3d70282 diff --git a/src/org/ibex/graphics/Font.java b/src/org/ibex/graphics/Font.java index 1f8f35c..8e29b22 100644 --- a/src/org/ibex/graphics/Font.java +++ b/src/org/ibex/graphics/Font.java @@ -68,6 +68,9 @@ public class Font { * @returns (width<<32)|height */ 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),""); @@ -84,7 +87,14 @@ public class Font { 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); }