APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.badlogic.gdx.tools.hiero.unicodefont

public Class GlyphPage

extends Object
Class Inheritance
Imports
java.awt.AlphaComposite, .Graphics2D, .RenderingHints, java.awt.font.FontRenderContext, java.awt.image.BufferedImage, .WritableRaster, java.math.BigInteger, java.nio.Buffer, .ByteBuffer, .ByteOrder, .IntBuffer, java.security.MessageDigest, .NoSuchAlgorithmException, java.util.ArrayList, .Iterator, .List, org.lwjgl.opengl.GL11, .GL12, com.badlogic.gdx.Gdx, com.badlogic.gdx.graphics.Pixmap, .Pixmap.Format, .Texture, com.badlogic.gdx.graphics.g2d.BitmapFont, .BitmapFont.BitmapFontData, com.badlogic.gdx.tools.hiero.unicodefont.UnicodeFont.RenderType, com.badlogic.gdx.tools.hiero.unicodefont.effects.ColorEffect, .Effect, com.badlogic.gdx.utils.Array

Stores a number of glyphs on a single texture.
Author
Nathan Sweet

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final List<String>
public static final int
private final List<Glyph>
private final int
private final int
public static FontRenderContext
pack-priv Array<GlyphPage.Row>
private static final ByteBuffer
pack-priv static Graphics2D
private static final BufferedImage
private static final IntBuffer
private final Texture
private final UnicodeFont

Constructor Summary

AccessConstructor and Description
pack-priv
GlyphPage(UnicodeFont unicodeFont, int
The width of the backing texture.
pageWidth
,
int
The height of the backing texture.
pageHeight
)

Method Summary

Modifier and TypeMethod and Description
public List<Glyph>
getGlyphs()

Returns the glyphs stored on this page.

public Texture
getTexture()

Returns the backing texture for this page.

pack-priv int

Returns:

The number of glyphs that were actually loaded.
loadGlyphs
(List<E>
The glyphs to load.
glyphs
,
int
This is the maximum number of glyphs to load from the list. Set to -1 to attempt to load all the glyphs.
maxGlyphsToLoad
)

Loads glyphs to the backing texture and sets the image on each loaded glyph.

private boolean
renderGlyph(Glyph glyph, int pageX, int pageY, int width, int height)

Loads a single glyph to the backing texture, if it fits.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

hashesback to summary
private final List<String> hashes
MAX_GLYPH_SIZEback to summary
public static final int MAX_GLYPH_SIZE
pageGlyphsback to summary
private final List<Glyph> pageGlyphs
pageHeightback to summary
private final int pageHeight
pageWidthback to summary
private final int pageWidth
renderContextback to summary
public static FontRenderContext renderContext
rowsback to summary
pack-priv Array<GlyphPage.Row> rows
scratchByteBufferback to summary
private static final ByteBuffer scratchByteBuffer
scratchGraphicsback to summary
pack-priv static Graphics2D scratchGraphics
scratchImageback to summary
private static final BufferedImage scratchImage
scratchIntBufferback to summary
private static final IntBuffer scratchIntBuffer
textureback to summary
private final Texture texture
unicodeFontback to summary
private final UnicodeFont unicodeFont

Constructor Detail

GlyphPageback to summary
pack-priv GlyphPage(UnicodeFont unicodeFont, int pageWidth, int pageHeight)
Parameters
pageWidth:int

The width of the backing texture.

pageHeight:int

The height of the backing texture.

Method Detail

getGlyphsback to summary
public List<Glyph> getGlyphs()

Returns the glyphs stored on this page.

getTextureback to summary
public Texture getTexture()

Returns the backing texture for this page.

loadGlyphsback to summary
pack-priv int loadGlyphs(List<E> glyphs, int maxGlyphsToLoad)

Loads glyphs to the backing texture and sets the image on each loaded glyph. Loaded glyphs are removed from the list. If this page already has glyphs and maxGlyphsToLoad is -1, then this method will return 0 if all the new glyphs don't fit. This reduces texture binds when drawing since glyphs loaded at once are typically displayed together.

Parameters
glyphs:List<E>

The glyphs to load.

maxGlyphsToLoad:int

This is the maximum number of glyphs to load from the list. Set to -1 to attempt to load all the glyphs.

Returns:int

The number of glyphs that were actually loaded.

renderGlyphback to summary
private boolean renderGlyph(Glyph glyph, int pageX, int pageY, int width, int height)

Loads a single glyph to the backing texture, if it fits.

com.badlogic.gdx.tools.hiero.unicodefont back to summary

pack-priv Class GlyphPage.Row

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv int
x

pack-priv int
y

Constructor Summary

AccessConstructor and Description
pack-priv
Row()

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

heightback to summary
pack-priv int height
xback to summary
pack-priv int x
yback to summary
pack-priv int y

Constructor Detail

Rowback to summary
pack-priv Row()