docs.unity3d.com
    Show / Hide Table of Contents

    Struct FontDefinition

    Describes a VisualElement font.

    Namespace: UnityEngine.UIElements
    Syntax
    public struct FontDefinition : IEquatable<FontDefinition>

    Properties

    font

    Font to use to display text. You cannot set this and fontAsset at the same time.

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

    fontAsset

    SDF font to use to display text. You cannot set this and font at the same time.

    Declaration
    public FontAsset fontAsset { get; set; }
    Property Value
    Type Description
    FontAsset

    Methods

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    Boolean

    Equals(FontDefinition)

    Declaration
    public bool Equals(FontDefinition other)
    Parameters
    Type Name Description
    FontDefinition other
    Returns
    Type Description
    Boolean

    FromFont(Font)

    Create a FontDefinition from .

    Declaration
    public static FontDefinition FromFont(Font f)
    Parameters
    Type Name Description
    Font f

    The font to use to display text.

    Returns
    Type Description
    FontDefinition

    A new FontDefinition object.

    FromSDFFont(FontAsset)

    Create a FontDefinition from .

    Declaration
    public static FontDefinition FromSDFFont(FontAsset f)
    Parameters
    Type Name Description
    FontAsset f

    The SDF font to use to display text.

    Returns
    Type Description
    FontDefinition

    A new FontDefinition object.

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    Operators

    Equality(FontDefinition, FontDefinition)

    Declaration
    public static bool operator ==(FontDefinition left, FontDefinition right)
    Parameters
    Type Name Description
    FontDefinition left
    FontDefinition right
    Returns
    Type Description
    Boolean

    Inequality(FontDefinition, FontDefinition)

    Declaration
    public static bool operator !=(FontDefinition left, FontDefinition right)
    Parameters
    Type Name Description
    FontDefinition left
    FontDefinition right
    Returns
    Type Description
    Boolean
    In This Article
    • Properties
      • font
      • fontAsset
    • Methods
      • Equals(Object)
      • Equals(FontDefinition)
      • FromFont(Font)
      • FromSDFFont(FontAsset)
      • GetHashCode()
      • ToString()
    • Operators
      • Equality(FontDefinition, FontDefinition)
      • Inequality(FontDefinition, FontDefinition)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023