Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
epoxy
GitHub Repository: epoxy/proj11
Path: blob/master/SLICK_HOME/src/org/newdawn/slick/Font.java
1456 views
1
package org.newdawn.slick;
2
3
4
/**
5
* The proprites of any font implementation
6
*
7
* @author Kevin Glass
8
*/
9
public interface Font {
10
/**
11
* Get the width of the given string
12
*
13
* @param str The string to obtain the rendered with of
14
* @return The width of the given string
15
*/
16
public abstract int getWidth(String str);
17
18
/**
19
* Get the height of the given string
20
*
21
* @param str The string to obtain the rendered with of
22
* @return The width of the given string
23
*/
24
public abstract int getHeight(String str);
25
26
/**
27
* Get the maximum height of any line drawn by this font
28
*
29
* @return The maxium height of any line drawn by this font
30
*/
31
public int getLineHeight();
32
33
/**
34
* Draw a string to the screen
35
*
36
* @param x The x location at which to draw the string
37
* @param y The y location at which to draw the string
38
* @param text The text to be displayed
39
*/
40
public abstract void drawString(float x, float y, String text);
41
42
/**
43
* Draw a string to the screen
44
*
45
* @param x The x location at which to draw the string
46
* @param y The y location at which to draw the string
47
* @param text The text to be displayed
48
* @param col The colour to draw with
49
*/
50
public abstract void drawString(float x, float y, String text, Color col);
51
52
53
/**
54
* Draw part of a string to the screen. Note that this will
55
* still position the text as though it's part of the bigger string.
56
*
57
* @param x The x location at which to draw the string
58
* @param y The y location at which to draw the string
59
* @param text The text to be displayed
60
* @param col The colour to draw with
61
* @param startIndex The index of the first character to draw
62
* @param endIndex The index of the last character from the string to draw
63
*/
64
public abstract void drawString(float x, float y, String text, Color col, int startIndex, int endIndex);
65
}
66