Interface GuiFont
public interface GuiFont
A font text can be drawn and measured with.
-
Method Summary
Modifier and TypeMethodDescriptiondoublebaseline(double scale) doublecapHeight(double scale) Together withbaseline(double), where capitals sit in a line, which is what text is centered by to look centered.doubleheight(double scale, boolean shadow) doubleMeasures text.
-
Method Details
-
width
Measures text. Works outside frames too.- Parameters:
text- The textscale- Text scaleshadow- Whether the text is drawn with a shadow- Returns:
- Width in GUI-scaled pixels
-
height
double height(double scale, boolean shadow) - Parameters:
scale- Text scaleshadow- Whether the text is drawn with a shadow- Returns:
- Line height in GUI-scaled pixels
-
baseline
double baseline(double scale) - Parameters:
scale- Text scale- Returns:
- How far below the top of a line its baseline is, in GUI-scaled pixels
-
capHeight
double capHeight(double scale) Together withbaseline(double), where capitals sit in a line, which is what text is centered by to look centered.- Parameters:
scale- Text scale- Returns:
- How far above the baseline capitals reach, in GUI-scaled pixels
-