Skip to content

TextStudioGlyphFieldContract

ClassTextStudioTextStudio
public static class TextStudioGlyphFieldContract

Explicit 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.

public const string FormatProperty = "_TextStudioFieldFormat"

Returns

System.String

public const string PixelsPerEmProperty = "_TextStudioFieldPixelsPerEm"

Returns

System.String

public const string SafeDistanceProperty = "_TextStudioFieldSafeDistance"

Returns

System.String

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

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

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