public class

Font

extends Object
implements IFont
java.lang.Object
   ↳ org.andengine.opengl.font.Font
Known Direct Subclasses

Class Overview

(c) 2010 Nicolas Gramlich (c) 2011 Zynga Inc.

Summary

Constants
int LETTER_TEXTURE_PADDING
Fields
protected final Canvas mCanvas
protected final Paint.FontMetrics mFontMetrics
protected final Paint mPaint
protected final Rect mTextBounds
protected final float[] mTextWidthContainer
Public Constructors
Font(FontManager pFontManager, ITexture pTexture, Typeface pTypeface, float pSize, boolean pAntiAlias, Color pColor)
Font(FontManager pFontManager, ITexture pTexture, Typeface pTypeface, float pSize, boolean pAntiAlias, int pColorARGBPackedInt)
Public Methods
float getAscent()
float getDescent()
float getLeading()
synchronized Letter getLetter(char pCharacter)
float getLineHeight()
ITexture getTexture()
synchronized void invalidateLetters()
void load()
void prepareLetters(char... pCharacters)
void unload()
synchronized void update(GLState pGLState)
Protected Methods
void drawLetter(String pCharacterAsString, float pLeft, float pTop)
Bitmap getLetterBitmap(Letter pLetter)
void updateTextBounds(String pCharacterAsString)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.andengine.opengl.font.IFont

Constants

protected static final int LETTER_TEXTURE_PADDING

Constant Value: 1 (0x00000001)

Fields

protected final Canvas mCanvas

protected final Paint.FontMetrics mFontMetrics

protected final Paint mPaint

protected final Rect mTextBounds

protected final float[] mTextWidthContainer

Public Constructors

public Font (FontManager pFontManager, ITexture pTexture, Typeface pTypeface, float pSize, boolean pAntiAlias, Color pColor)

public Font (FontManager pFontManager, ITexture pTexture, Typeface pTypeface, float pSize, boolean pAntiAlias, int pColorARGBPackedInt)

Public Methods

public float getAscent ()

Returns
  • the distance from the baseline to the top, which is usually negative.

public float getDescent ()

Returns
  • the distance from the baseline to the bottom, which is usually positive.

public float getLeading ()

Returns
  • the gap between the lines.

public synchronized Letter getLetter (char pCharacter)

Throws
FontException

public float getLineHeight ()

public ITexture getTexture ()

public synchronized void invalidateLetters ()

public void load ()

public void prepareLetters (char... pCharacters)

Throws
FontException

public void unload ()

public synchronized void update (GLState pGLState)

Protected Methods

protected void drawLetter (String pCharacterAsString, float pLeft, float pTop)

protected Bitmap getLetterBitmap (Letter pLetter)

Throws
FontException

protected void updateTextBounds (String pCharacterAsString)