Versatile Java game engine with pluggable backends (this was used in Rogue, I think)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
1.2 KiB

package mightypork.gamecore.graphics.fonts;
import mightypork.utils.math.color.Color;
import mightypork.utils.math.constraints.vect.Vect;
/**
* Interface bor drawable font.
*
* @author Ondřej Hruška (MightyPork)
*/
public interface IFont {
/**
* Draw without scaling at (0, 0) in given color.
*
* @param text text to draw
* @param color draw color
*/
void draw(String text, Color color);
/**
* Get suize needed to render give string
*
* @param text string to check
* @return coord (width, height)
*/
Vect getNeededSpace(String text);
/**
* @return font height
*/
int getLineHeight();
/**
* @param text texted text
* @return space needed
*/
int getWidth(String text);
/**
* @return specified font size
*/
int getFontSize();
/**
* Set what vertical ratio of the font size is blank and should be cut off
* when rendering
*
* @param top top ratio (0-1)
* @param bottom bottom ratio (0-1)
*/
void setDiscardRatio(double top, double bottom);
/**
* Get top discard ratio (blank unused space)
*
* @return ratio
*/
double getTopDiscardRatio();
/**
* Get bottom discard ratio (blank unused space)
*
* @return ratio
*/
double getBottomDiscardRatio();
}