org.jrabbit.base.graphics.font.renderer
Interface FontRenderer

All Superinterfaces:
Createable, DataController, Destroyable
All Known Implementing Classes:
AcceleratedFontRenderer, AngelCodeRenderer, Font, UnicodeRenderer

public interface FontRenderer
extends DataController

jRabbit's Fonts aren't really intended to be "customizable," but are instead "pluggable" - they have some core functionality which is dependent upon an object which can itself be customized. Basically, everything a Font does is based on its FontRenderer. To change how the Font works, change the Renderer. A FontRenderer is intended to take care of all the OpenGL data and calculations for the Font. A Font simply tells its renderer what to do and interprets the results.

Author:
Chris Molini

Method Summary
 float lineHeight()
          Determines how tall each line of text this renderer draws is.
 void render(float x, float y, java.lang.String text)
          Renders a String of text at the specified x and y coordinates relative to the current OpenGL Modelview matrix.
 float widthOf(java.lang.String text)
          Computes how wide a String will be when rendered.
 
Methods inherited from interface org.jrabbit.base.data.DataController
valid
 
Methods inherited from interface org.jrabbit.base.data.Createable
create
 
Methods inherited from interface org.jrabbit.base.data.Destroyable
destroy
 

Method Detail

render

void render(float x,
            float y,
            java.lang.String text)
Renders a String of text at the specified x and y coordinates relative to the current OpenGL Modelview matrix. The specified x and y values should correspond to the top-left of the rendered String.

Parameters:
x - The x coordinate of the top-left of the first character.
y - The y coordinate of the top-left of the first character.
text - The text to display.

widthOf

float widthOf(java.lang.String text)
Computes how wide a String will be when rendered.

Parameters:
text - The text to measure.
Returns:
How wide the supplied String is when drawn by this renderer.

lineHeight

float lineHeight()
Determines how tall each line of text this renderer draws is.

Returns:
The height of a standard line of text.