Interface GuiFont


public interface GuiFont
A font text can be drawn and measured with.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    baseline(double scale)
     
    double
    capHeight(double scale)
    Together with baseline(double), where capitals sit in a line, which is what text is centered by to look centered.
    double
    height(double scale, boolean shadow)
     
    double
    width(String text, double scale, boolean shadow)
    Measures text.
  • Method Details

    • width

      double width(String text, double scale, boolean shadow)
      Measures text. Works outside frames too.
      Parameters:
      text - The text
      scale - Text scale
      shadow - Whether the text is drawn with a shadow
      Returns:
      Width in GUI-scaled pixels
    • height

      double height(double scale, boolean shadow)
      Parameters:
      scale - Text scale
      shadow - 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 with baseline(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