Record Class GuiFontFace
java.lang.Object
java.lang.Record
com.render.api.gui.GuiFontFace
- Record Components:
source- typed font-byte sourcecollectionIndex- zero-based face index for TTC resourcesweightRange- supported CSS weight rangestretchRange- supported CSS stretch range, where1is normalslant- declared normal, italic, or oblique face styleobliqueAngleRange- supported oblique-angle range in degreesdefaultAxes- 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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordInclusive numeric range.static enum -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGuiFontFace(GuiFontSource source, int collectionIndex, GuiFontFace.Range weightRange, GuiFontFace.Range stretchRange, GuiFontFace.Slant slant, GuiFontFace.Range obliqueAngleRange, Map<String, Float> defaultAxes) Creates an instance of aGuiFontFacerecord class.GuiFontFace(net.minecraft.resources.Identifier asset, int collectionIndex, GuiFontFace.Range weightRange, GuiFontFace.Range stretchRange, GuiFontFace.Slant slant, GuiFontFace.Range obliqueAngleRange, Map<String, Float> defaultAxes) Source-compatible constructor for packaged resource faces. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.resources.Identifierasset()Returns the packaged asset identifier, ornullfor an external source.intReturns the value of thecollectionIndexrecord component.collectionIndex(int index) Returns the value of thedefaultAxesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theobliqueAngleRangerecord component.obliqueRange(float minimumDegrees, float maximumDegrees) static GuiFontFaceof(GuiFontSource source) Creates a face declaration for a typed source.static GuiFontFaceof(net.minecraft.resources.Identifier asset) static GuiFontFaceCreates an asynchronously loaded remote-font face.slant()Returns the value of theslantrecord component.slant(GuiFontFace.Slant value) source()Returns the value of thesourcerecord component.Returns the value of thestretchRangerecord component.stretchRange(float minimum, float maximum) static GuiFontFaceCreates a lazily loaded system-font face.final StringtoString()Returns a string representation of this record class.Returns the value of theweightRangerecord component.weightRange(float minimum, float maximum)
-
Field Details
-
MAX_RESOURCE_BYTES
public static final int MAX_RESOURCE_BYTES- See Also:
-
-
Constructor Details
-
GuiFontFace
public GuiFontFace(GuiFontSource source, int collectionIndex, GuiFontFace.Range weightRange, GuiFontFace.Range stretchRange, GuiFontFace.Slant slant, GuiFontFace.Range obliqueAngleRange, Map<String, Float> defaultAxes) Creates an instance of aGuiFontFacerecord class.- Parameters:
source- the value for thesourcerecord componentcollectionIndex- the value for thecollectionIndexrecord componentweightRange- the value for theweightRangerecord componentstretchRange- the value for thestretchRangerecord componentslant- the value for theslantrecord componentobliqueAngleRange- the value for theobliqueAngleRangerecord componentdefaultAxes- the value for thedefaultAxesrecord component
-
GuiFontFace
public GuiFontFace(net.minecraft.resources.Identifier asset, int collectionIndex, GuiFontFace.Range weightRange, GuiFontFace.Range stretchRange, GuiFontFace.Slant slant, GuiFontFace.Range obliqueAngleRange, Map<String, Float> defaultAxes) Source-compatible constructor for packaged resource faces.
-
-
Method Details
-
of
-
of
Creates a face declaration for a typed source.- Parameters:
source- font source- Returns:
- face declaration
-
system
Creates a lazily loaded system-font face.- Parameters:
path- local font path- Returns:
- face declaration
-
remote
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, ornullfor an external source.- Returns:
- packaged asset identifier
-
collectionIndex
-
weightRange
-
stretchRange
-
slant
-
obliqueRange
-
axes
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
source
-
collectionIndex
public int collectionIndex()Returns the value of thecollectionIndexrecord component.- Returns:
- the value of the
collectionIndexrecord component
-
weightRange
Returns the value of theweightRangerecord component.- Returns:
- the value of the
weightRangerecord component
-
stretchRange
Returns the value of thestretchRangerecord component.- Returns:
- the value of the
stretchRangerecord component
-
slant
-
obliqueAngleRange
Returns the value of theobliqueAngleRangerecord component.- Returns:
- the value of the
obliqueAngleRangerecord component
-
defaultAxes
Returns the value of thedefaultAxesrecord component.- Returns:
- the value of the
defaultAxesrecord component
-