* Loads a single glyph to the backing texture, if it fits.\r
*/\r
private void renderGlyph (Glyph glyph, int width, int height) {\r
+ System.out.println(glyph.getCodePoint());\r
// Draw the glyph to the scratch image using Java2D.\r
scratchGraphics.setComposite(AlphaComposite.Clear);\r
scratchGraphics.fillRect(0, 0, MAX_GLYPH_SIZE, MAX_GLYPH_SIZE);\r
extraY += getLineHeight();\r
lines++;\r
totalHeight = 0;\r
- } else if (nativeRendering)\r
- offsetX += bounds.width;\r
+ } else if (nativeRendering) offsetX += bounds.width;\r
}\r
if (lastBind != null) GL11.glEnd();\r
\r
\r
private Rectangle getGlyphBounds (GlyphVector vector, int index, int codePoint) {\r
Rectangle bounds;\r
- if (nativeRendering)\r
- bounds = metrics.getStringBounds("" + (char)codePoint, GlyphPage.scratchGraphics).getBounds();\r
- else\r
+ if (nativeRendering) {\r
+ if (codePoint == '\n')\r
+ bounds = new Rectangle();\r
+ else\r
+ bounds = metrics.getStringBounds("" + (char)codePoint, GlyphPage.scratchGraphics).getBounds();\r
+ } else\r
bounds = vector.getGlyphPixelBounds(index, GlyphPage.renderContext, 0, 0);\r
if (codePoint == ' ') bounds.width = spaceWidth;\r
return bounds;\r