Skip to main content

Text formatting

Use consistent text formatting to help users distinguish between such features as code blocks, user interface (UI) elements, and hyperlinks.

Choose between regular, bold, or monospace font​

Many terms at Unity have multiple contexts, including the UI and the API. It's important to use the appropriate font for the context to avoid confusion. Use the following guidelines to help you decide which font to use in different situations:

  • When you discuss a idea in a general sense, use the generic term with no formatting.
  • When you discuss a term in the context of the Unity UI, use bold font.
  • When you discuss a term in the context of the API, use monospace font.
Example of combined font contexts
To modify the properties of a Light component attached to a GameObject, use the controls in the Light component in the GameObject's Inspector window. Alternatively, you can change the properties in a script using the Light class properties and methods.

Bold text​

Use bold for the following items:

  • Exact references to interactive controls and labels in the Unity UI, such as button labels, menu items, tab names, and items in inspectors. Bold only the text that appears in the UI, not the type of UI control. For example, write "Add Component button" and not "Add Component button."
    • In navigation paths, separate items with a greater-than symbol (>) and don't bold the symbol. For more information about writing navigation paths, refer to User Interactions.
  • Keyboard shortcuts and inputs that form part of an instruction.
  • Leaders for information callouts in publishing platforms that don't have information boxes. Write the leader in bold, followed by a colon in regular font. For example, "Note:" and "Tip:"
* Any named object that appears in the Project window or Hierarchy window, such as GameObjects, assets, and files. * To emphasize a term when you define it. If the term is mentioned before it is officially defined, don't bold the instance where it is not defined. * Titles of learning content, steps in tutorials, and external sources. * All text for which the Style Guide indicates a monospace font, until the Learn platform supports an inline monospace font. Refer also to [Monospace font](#monospace-font).
IncorrectCorrect
In the main menu, go to File and then select Build Settings.In the main menu, go to File > Build Settings.
In the Sprite Renderer component, adjust the Color setting.In the Sprite Renderer component, adjust the Color setting.
Open the Mask Interaction dropdown menu and select None.Open the Mask Interaction dropdown menu and select None.
You can make effects like these with Particle Systems. Particle Systems are...You can make effects like these with Particle Systems. Particle Systems are...
As you learned in "What is post-processing?", post-processing takes the image already captured by a camera and adds effects to it.As you learned in What is post-processing?, post-processing takes the image already captured by a camera and adds effects to it.

Monospace font​

important

Until the Learn platform supports a monospace inline font, substitute bold.

Use monospace font for all code that appears in your text, including terminal commands, variables, and API signatures and declarations. Write all API names in monospace, including classes, methods, structs, and enums. When you refer to an API in text, link to the corresponding documentation at the first use on each page. Use a code block to present code that's more than a single line.

Example monospace usage
Update is the most commonly used function to implement any kind of game script. Not every MonoBehaviour script needs Update.

Italic text​

Don't use italic text. Italicized text can make letters harder to read, particularly on smaller displays.

Underlined text​

important

On the Learn platform, it's necessary to add the underline format to hyperlinks.

Don't add underlining to regular text. Underlines appear on hyperlinks only.

Strikethrough text​

Don't use strikethrough text. Strikethrough text isn't accessible to screen readers, which read out the content as regular text.

Quotation marks​

Use quotation marks to indicate a name or text that the reader will type. Don't use quotation marks for numbers. If punctuation follows, place it outside the quotation marks.

Otherwise, use quotation marks for quotations as usual. In this case, place punctuation that is part of the quote inside the quotation marks.

Don't use quotation marks for emphasis, to refer to a word, to cast doubt (scare quotes), or to imply figurative language.

IncorrectCorrect
Name the cube Box.Name the cube "Box".
A "burst" is an event that spawns particles.A burst is an event that spawns particles.
Input and output variables need to have their β€œintent” indicated via semantics.Semantics indicate the intended use of input and output variables.