Record Class GuiFontFace

java.lang.Object
java.lang.Record
com.render.api.gui.GuiFontFace
Record Components:
source - typed font-byte source
collectionIndex - zero-based face index for TTC resources
weightRange - supported CSS weight range
stretchRange - supported CSS stretch range, where 1 is normal
slant - declared normal, italic, or oblique face style
obliqueAngleRange - supported oblique-angle range in degrees
defaultAxes - immutable default OpenType variation coordinates

public record GuiFontFace(GuiFontSource source, int collectionIndex, GuiFontFace.Range weightRange, GuiFontFace.Range stretchRange, GuiFontFace.Slant slant, GuiFontFace.Range obliqueAngleRange, Map<String,Float> defaultAxes) extends Record
One OpenType face in a GuiFontFamily.

Packaged resources are always available. System and remote sources are authorized by the owning view's GuiFontPolicy. Ranges are CSS-compatible and allow a variable face to satisfy more than one requested style.

  • Field Details

  • Constructor Details

  • Method Details

    • of

      public static GuiFontFace of(net.minecraft.resources.Identifier asset)
    • of

      public static GuiFontFace of(GuiFontSource source)
      Creates a face declaration for a typed source.
      Parameters:
      source - font source
      Returns:
      face declaration
    • system

      public static GuiFontFace system(Path path)
      Creates a lazily loaded system-font face.
      Parameters:
      path - local font path
      Returns:
      face declaration
    • remote

      public static GuiFontFace remote(URI uri)
      Creates an asynchronously loaded remote-font face.
      Parameters:
      uri - remote font URI
      Returns:
      face declaration
    • asset

      public net.minecraft.resources.Identifier asset()
      Returns the packaged asset identifier, or null for an external source.
      Returns:
      packaged asset identifier
    • collectionIndex

      public GuiFontFace collectionIndex(int index)
    • weightRange

      public GuiFontFace weightRange(float minimum, float maximum)
    • stretchRange

      public GuiFontFace stretchRange(float minimum, float maximum)
    • slant

      public GuiFontFace slant(GuiFontFace.Slant value)
    • obliqueRange

      public GuiFontFace obliqueRange(float minimumDegrees, float maximumDegrees)
    • axes

      public GuiFontFace axes(Map<String,Float> axes)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • source

      public GuiFontSource source()
      Returns the value of the source record component.
      Returns:
      the value of the source record component
    • collectionIndex

      public int collectionIndex()
      Returns the value of the collectionIndex record component.
      Returns:
      the value of the collectionIndex record component
    • weightRange

      public GuiFontFace.Range weightRange()
      Returns the value of the weightRange record component.
      Returns:
      the value of the weightRange record component
    • stretchRange

      public GuiFontFace.Range stretchRange()
      Returns the value of the stretchRange record component.
      Returns:
      the value of the stretchRange record component
    • slant

      public GuiFontFace.Slant slant()
      Returns the value of the slant record component.
      Returns:
      the value of the slant record component
    • obliqueAngleRange

      public GuiFontFace.Range obliqueAngleRange()
      Returns the value of the obliqueAngleRange record component.
      Returns:
      the value of the obliqueAngleRange record component
    • defaultAxes

      public Map<String,Float> defaultAxes()
      Returns the value of the defaultAxes record component.
      Returns:
      the value of the defaultAxes record component