Package com.github.tommyettinger.textra
Enum Class Font.DistanceFieldType
- All Implemented Interfaces:
Serializable,Comparable<Font.DistanceFieldType>,Constable
- Enclosing class:
- Font
Defines what types of distance field font this can use and render.
STANDARD has no distance field.
SDF is the signed distance field technique Hiero is compatible with, and uses only an alpha channel.
MSDF is the multi-channel signed distance field technique, which is sharper but uses the RGB channels.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionUsed by Multi-channel Signed Distance Field fonts, which are harder to create but can be more crisp than SDF fonts, with hard corners where the corners were hard in the original font.Used by Signed Distance Field fonts that are compatible withDistanceFieldFont, and may be created by Hiero with its Distance Field effect.Used by normal fonts with no distance field effect. -
Method Summary
Modifier and TypeMethodDescriptionstatic Font.DistanceFieldTypeReturns the enum constant of this class with the specified name.static Font.DistanceFieldType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
STANDARD
Used by normal fonts with no distance field effect. If the font has a large image that is downscaled, you may want to callFont.setTextureFilter(). -
SDF
Used by Signed Distance Field fonts that are compatible withDistanceFieldFont, and may be created by Hiero with its Distance Field effect. You may want to set theFont.distanceFieldCrispnessfield to a higher or lower value depending on the range used to create the font in Hiero; this can take experimentation. -
MSDF
Used by Multi-channel Signed Distance Field fonts, which are harder to create but can be more crisp than SDF fonts, with hard corners where the corners were hard in the original font. If you want to create your own MSDF font, you can use the Glamer font generator tool, which puts a lot of padding for each glyph to ensure it renders evenly, or you can use one of several other MSDF font generators, which may have an uneven baseline and look shaky when rendered for some fonts. You may want to set theFont.distanceFieldCrispnessfield to a higher or lower value based on preference.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-