sub_arctic.output
Interface text_renderer

All Known Implementing Classes:
simple_text_renderer

public abstract interface text_renderer

This interface describes objects which can draw a piece of text given a font and string. This is used to encapsulate vairous kinds of text drawing effects that a style might use (such as shadowed text). An object implementing this interface will normally encapsulate font and color information associated with a style within itself.


Method Summary
 int baseline()
          The baseline location associated with this renderer.
 void draw_text(drawable on_surface, int at_x, int at_y, java.lang.String txt)
          Render text onto the given drawable object at the given location.
 int h(java.lang.String txt)
          Height that the image of a given string drawn would take up.
 int leading()
          The amount of spacing to be placed between lines of text rendered with this renderer.
 int w(java.lang.String txt)
          Width that the image of a given string drawn would take up.
 

Method Detail

draw_text

public void draw_text(drawable on_surface,
                      int at_x,
                      int at_y,
                      java.lang.String txt)
Render text onto the given drawable object at the given location.
Parameters:
drawable - on_surface the drawing surface where we draw the result.
int - at_x x coordinate to draw at.
int - at_y y coordinate to draw at.
String - txt the text to draw.

w

public int w(java.lang.String txt)
Width that the image of a given string drawn would take up.
Parameters:
String - txt the string that will be drawn.
Returns:
int the width of the resulting image.

h

public int h(java.lang.String txt)
Height that the image of a given string drawn would take up.
Parameters:
String - txt the string that will be drawn.
Returns:
int the height of the resulting image.

baseline

public int baseline()
The baseline location associated with this renderer. This is the offset from the top of the image that the text baseline will appear at.
Returns:
int the baseline value.

leading

public int leading()
The amount of spacing to be placed between lines of text rendered with this renderer.
Returns:
int the leading (vertical spacing) value.