Class TextService | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class TextService

    Inheritance
    System.Object
    TextService
    Namespace: Unity.Tiny.Text
    Syntax
    public static class TextService

    Methods

    AddGlyph(EntityManager, ref Entity, UInt32, Single, Single, Single, Single, Single, Rect)

    Adds a glyph to a BitmapFont

    Declaration
    public static void AddGlyph(EntityManager mgr, ref Entity fontEntity, uint character, float bearingX, float bearingY, float advance, float width, float height, Rect characterRegion)
    Parameters
    Type Name Description
    EntityManager mgr
    Entity fontEntity
    System.UInt32 character
    System.Single bearingX
    System.Single bearingY
    System.Single advance
    System.Single width
    System.Single height
    Rect characterRegion

    CreateBitmapFont(EntityManager, ref Entity, Single, Single, Single)

    Creates a BitmapFont entity.

    Declaration
    public static Entity CreateBitmapFont(EntityManager mgr, ref Entity textureAtlasImg, float size, float ascent, float descent)
    Parameters
    Type Name Description
    EntityManager mgr
    Entity textureAtlasImg
    System.Single size
    System.Single ascent
    System.Single descent
    Returns
    Type Description
    Entity

    CreateNativeFont(EntityManager, FontName, String, Single)

    Creates a NativeFont entity.

    Declaration
    public static Entity CreateNativeFont(EntityManager mgr, FontName fontName, string ttfFileName, float worldUnitsToPt)
    Parameters
    Type Name Description
    EntityManager mgr
    FontName fontName
    System.String ttfFileName
    System.Single worldUnitsToPt
    Returns
    Type Description
    Entity

    CreateTextWithBitmapFont(EntityManager, ref Entity, String, Single, Color, BlendOp, float2)

    Creates a text to render with a BitmapFont.

    Declaration
    public static Entity CreateTextWithBitmapFont(EntityManager mgr, ref Entity fontEntity, string text, float size, Color color, BlendOp blending, float2 pivot)
    Parameters
    Type Name Description
    EntityManager mgr
    Entity fontEntity
    System.String text
    System.Single size
    Color color
    BlendOp blending
    float2 pivot
    Returns
    Type Description
    Entity

    CreateTextWithNativeFont(EntityManager, ref Entity, String, Single, Boolean, Int32, Color, BlendOp, float2)

    Creates text to render with a NativeFont.

    Declaration
    public static Entity CreateTextWithNativeFont(EntityManager mgr, ref Entity fontEntity, string text, float size, bool italic, int weight, Color color, BlendOp blending, float2 pivot)
    Parameters
    Type Name Description
    EntityManager mgr
    Entity fontEntity
    System.String text
    System.Single size
    System.Boolean italic
    System.Int32 weight
    Color color
    BlendOp blending
    float2 pivot
    Returns
    Type Description
    Entity

    GetCharacterInfo(DynamicBuffer<CharacterInfoBuffer>, UInt32, out CharacterInfo)

    Get CharacterInfo value of a UTF-32 code point. Will return a default value if not present.

    Declaration
    public static bool GetCharacterInfo(DynamicBuffer<CharacterInfoBuffer> data, uint character, out CharacterInfo outCharacterInfo)
    Parameters
    Type Name Description
    DynamicBuffer<CharacterInfoBuffer> data
    System.UInt32 character
    CharacterInfo outCharacterInfo
    Returns
    Type Description
    System.Boolean

    True if the character was found.

    GetFontFamilyName(FontName)

    Returns a string descriptor of a FontName.

    Declaration
    public static string GetFontFamilyName(FontName fontName)
    Parameters
    Type Name Description
    FontName fontName
    Returns
    Type Description
    System.String
    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