docs.unity3d.com
    Show / Hide Table of Contents

    Style Sheets

    Use style sheets to create custom text styles that you can apply to text using the <style> rich text tag.

    A custom style can include opening and closing rich text tags, as well as leading and trailing text.

    For example, you might want headings in your text to be big, red, bold, with an asterisk to either side and a line break at the end.

    Instead of typing this for every heading:

    <font-weight=700><size=2em><color=#FF0000>*Heading*</color></size></font-weight><br>

    You can create a style, called H1 that includes all of that formatting:

    You can then format all of your headings with a single <style> tag:

    <style="H1">Heading</style>

    The default style sheet

    The default style sheet is the style sheet that every TextMesh Pro object in your

    TextMesh Pro ships with a default style sheet stored in the TextMesh Pro > Resources > Style Sheets folder, but you can set any style sheet to be the default.

    To change the default style sheet, set the Default Style Sheet > Default Style Sheet option in the TextMesh Pro settings.

    Per-object style sheets

    Creating custom style sheets

    To create a new style sheet, choose Assets > Create > TextMesh Pro > Style Sheet from the menu.

    This adds a new TextMesh Pro style sheet to the Project. Open it in the Inspector to add custom styles.

    Adding new styles

    Removing styles

    Back to top
    Terms of use
    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