Enum Class DrawFont

java.lang.Object
java.lang.Enum<DrawFont>
com.botwithus.bot.api.draw.DrawFont
All Implemented Interfaces:
Serializable, Comparable<DrawFont>, Constable

public enum DrawFont extends Enum<DrawFont>
The text styles the producer can draw a caption in.

A style name, not a size. The producer owns the size table deliberately, so the set of font objects it holds is a compile-time constant rather than something a script can grow. There is no way to ask for "14pt".

Mirrors overlay::FontStyle in the producer. An unknown name is rejected on the wire with unknown font (want normal, small, large or heading) — which this host cannot provoke, because the name is only ever produced from this enum.

  • Enum Constant Details

    • NORMAL

      public static final DrawFont NORMAL
      The default.
    • SMALL

      public static final DrawFont SMALL
    • LARGE

      public static final DrawFont LARGE
    • HEADING

      public static final DrawFont HEADING
  • Method Details

    • values

      public static DrawFont[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DrawFont valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • wireName

      public String wireName()
      The lower-case token this style is spelled as in the font field.
    • fromWireName

      public static DrawFont fromWireName(String name)
      The style a producer reply spelled, defaulting to NORMAL for a name this build does not know — the producer is versioned separately and may grow a style, and a decoder must not throw when it does.