Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Does UI Builder support Unicode character sequences?

Discussion in 'UI Toolkit' started by shiena, Mar 6, 2021.

  1. shiena

    shiena

    Joined:
    May 19, 2017
    Posts:
    44
    The following Unicode character sequence labels are displayed differently for each package combination.

    Code (CSharp):
    1. <ui:UXML
    2.         xmlns:ui="UnityEngine.UIElements"
    3.         xmlns:uie="UnityEditor.UIElements"
    4.         xsi="http://www.w3.org/2001/XMLSchema-instance"
    5.         engine="UnityEngine.UIElements"
    6.         editor="UnityEditor.UIElements"
    7.         noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd"
    8.         editor-extension-mode="False">
    9.     <ui:Label text="\u0182" style="font-size: 100%; -unity-text-align: middle-center; width: 100%; height: 100%;" />
    10. </ui:UXML>
    • Unity2020.2.7f1 + UIBuilder 1.0.0-preview.12
    • Unity2021.1.0b10 (with build-in UIBuilder)
    • Unity2021.2.0ab (with build-in UIBuilder and UIToolkit)



    • Unity2020.2.7f1 + UIBuilder 1.0.0-preview.12 + UIToolkit 1.0.0-preview.14
    • Unity2021.1.0b10 (with build-in UIBuilder) + UIToolkit 1.0.0-preview.14


    I want the input field of UIBuilder to display the Unicode character sequence and the preview to display the character.
     
  2. shiena

    shiena

    Joined:
    May 19, 2017
    Posts:
    44
    I want to use google material design icon font easily.
     
  3. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    365
    We have our icon font as a fallback font of the font asset in the TextSettings. This works fine in playmode but this does not show in the ui builder since here that is not used.

    What I did during developement: I set an uss icon-class and put the font there like @shiena shows in the screenshot.
    When finished I removed the font from the class