docs.unity.cn
    Show / Hide Table of Contents

    Class FontData

    Inheritance
    Object
    FontData
    Namespace: UnityEngine.UI
    Syntax
    [Serializable]
    public class FontData : ISerializationCallbackReceiver

    Properties

    alignByGeometry

    Use the extents of glyph geometry to perform horizontal alignment rather than glyph metrics.

    Declaration
    public bool alignByGeometry { get; set; }
    Property Value
    Type Description
    Boolean
    Remarks

    This can result in better fitting left and right alignment, but may result in incorrect positioning when attempting to overlay multiple fonts (such as a specialized outline font) on top of each other.

    alignment

    How is the text aligned for this generated Text object.

    Declaration
    public TextAnchor alignment { get; set; }
    Property Value
    Type Description
    TextAnchor

    bestFit

    Is best fit used for this generated Text object.

    Declaration
    public bool bestFit { get; set; }
    Property Value
    Type Description
    Boolean

    defaultFontData

    Get a font data with sensible defaults.

    Declaration
    public static FontData defaultFontData { get; }
    Property Value
    Type Description
    FontData

    font

    The Font to use for this generated Text object.

    Declaration
    public Font font { get; set; }
    Property Value
    Type Description
    Font

    fontSize

    The Font size to use for this generated Text object.

    Declaration
    public int fontSize { get; set; }
    Property Value
    Type Description
    Int32

    fontStyle

    The font style to use for this generated Text object.

    Declaration
    public FontStyle fontStyle { get; set; }
    Property Value
    Type Description
    FontStyle

    horizontalOverflow

    The horizontal overflow policy for this generated Text object.

    Declaration
    public HorizontalWrapMode horizontalOverflow { get; set; }
    Property Value
    Type Description
    HorizontalWrapMode

    lineSpacing

    The line spaceing for this generated Text object.

    Declaration
    public float lineSpacing { get; set; }
    Property Value
    Type Description
    Single

    maxSize

    The max size for this generated Text object.

    Declaration
    public int maxSize { get; set; }
    Property Value
    Type Description
    Int32

    minSize

    The min size for this generated Text object.

    Declaration
    public int minSize { get; set; }
    Property Value
    Type Description
    Int32

    richText

    Should rich text be used for this generated Text object.

    Declaration
    public bool richText { get; set; }
    Property Value
    Type Description
    Boolean

    verticalOverflow

    The vertical overflow policy for this generated Text object.

    Declaration
    public VerticalWrapMode verticalOverflow { get; set; }
    Property Value
    Type Description
    VerticalWrapMode

    Explicit Interface Implementations

    ISerializationCallbackReceiver.OnAfterDeserialize()

    Declaration
    void ISerializationCallbackReceiver.OnAfterDeserialize()
    Implements
    ISerializationCallbackReceiver.OnAfterDeserialize()

    ISerializationCallbackReceiver.OnBeforeSerialize()

    Declaration
    void ISerializationCallbackReceiver.OnBeforeSerialize()
    Implements
    ISerializationCallbackReceiver.OnBeforeSerialize()
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on 12 June 2023