TextStudioGlyphFieldContract
public static class TextStudioGlyphFieldContractExplicit material contract for optional high-fidelity glyph fields. Multi Distance uses alpha for the Euclidean distance and the median RGB value for sharp corner distance.
Fields
Section titled “Fields”
FormatProperty
Section titled “FormatProperty”public const string FormatProperty = "_TextStudioFieldFormat"Returns
System.String
PixelsPerEmProperty
Section titled “PixelsPerEmProperty”public const string PixelsPerEmProperty = "_TextStudioFieldPixelsPerEm"Returns
System.String
SafeDistanceProperty
Section titled “SafeDistanceProperty”public const string SafeDistanceProperty = "_TextStudioFieldSafeDistance"Returns
System.String
Methods
Section titled “Methods”
ResolveFormat(Material)
Section titled “ResolveFormat(Material)”public static TextStudioGlyphFieldFormat ResolveFormat(Material material)Reads the declared material field format, falling back to single-distance fields when no format property is available.
Parameters
| Name | Type |
|---|---|
material |
UnityEngine.Material |
Returns
TextStudio.TextStudioGlyphFieldFormat
ResolvePixelsPerEm(Material, float)
Section titled “ResolvePixelsPerEm(Material, float)”public static float ResolvePixelsPerEm(Material material, float fallback)Returns a positive material-declared field density, otherwise the fallback clamped to a nonnegative value.
Parameters
| Name | Type |
|---|---|
material |
UnityEngine.Material |
fallback |
System.Single |
Returns
System.Single
ResolveSafeDistanceEm(Material, float)
Section titled “ResolveSafeDistanceEm(Material, float)”public static float ResolveSafeDistanceEm(Material material, float fallback)Returns a positive material-declared safe distance in em units, otherwise the fallback clamped to a nonnegative value.
Parameters
| Name | Type |
|---|---|
material |
UnityEngine.Material |
fallback |
System.Single |
Returns
System.Single