* 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
\r
private Rectangle getGlyphBounds (GlyphVector vector, int index, int codePoint) {\r
Rectangle bounds;\r
+ bounds = vector.getGlyphPixelBounds(index, GlyphPage.renderContext, 0, 0);\r
if (nativeRendering) {\r
- if (codePoint == '\n')\r
+ if (bounds.width == 0 || bounds.height == 0)\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
+ }\r
if (codePoint == ' ') bounds.width = spaceWidth;\r
return bounds;\r
}\r
package com.badlogic.gdx;\r
\r
import java.io.InputStream;\r
+import java.nio.ByteBuffer;\r
\r
import com.badlogic.gdx.files.FileHandle;\r
import com.badlogic.gdx.graphics.BitmapFont;\r
import com.badlogic.gdx.graphics.glutils.ShaderProgram;\r
import com.badlogic.gdx.graphics.glutils.VertexArray;\r
import com.badlogic.gdx.graphics.glutils.VertexBufferObject;\r
+import com.badlogic.gdx.graphics.Texture.TextureFilter;\r
+import com.badlogic.gdx.graphics.Texture.TextureWrap;\r
import com.badlogic.gdx.utils.GdxRuntimeException;\r
\r
/**\r
Texture.TextureFilter magFilter, Texture.TextureWrap uWrap,\r
Texture.TextureWrap vWrap);\r
\r
+ public Texture newTexture (ByteBuffer buffer, Format format, int width, int height, TextureFilter minFilter,\r
+ TextureFilter magFilter, TextureWrap uWrap, TextureWrap vWrap);\r
+\r
/**\r
* @return the {@link GraphicsType} of this Graphics instance\r
*/\r