Text formatting
Use consistent text formatting to help users distinguish between such features as code blocks, user interface (UI) elements, and hyperlinks.
tip
For instructions on implementing this guidance with Markdown, refer to Confluence: Formatting documentation.
Choose between regular, bold, or monospaced 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 an 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 monospaced 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 window names, 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:"
Incorrect | Correct |
---|---|
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. |
Monospaced font
caution
Monospaced font doesn't always render properly in titles or headings. To prevent confusion about whether a term is a common word or code element name, avoid using method names or other code element names in titles and headings.
Use monospaced font for anything that the user might need to type, such as code, or that might be defined by the user, such as variables and names. The following contexts all use monospaced font:
- Code, including code blocks and in-line code snippets. Use a code block to present any code that's more than a single line.
- Terminal commands.
- API names, signatures, and declarations. Write all API names in monospaced font, 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.
- GameObject, assets, and variable names inside the Unity Editor.
- Files, folders, directories and paths on the user's system. For more information, refer to Files, folders, and directories
- Specific user inputs, such as values for properties.
Incorrect | Correct |
---|---|
In the install directory for your Unity version, navigate to the Data\il2cpp directory on Windows, or the Contents/Frameworks/il2cpp directory on macOS. | In the install directory for your Unity version, navigate to the Data\il2cpp directory on Windows, or the Contents/Frameworks/il2cpp directory on macOS. |
Find the Il2CppSetOptionsAttribute.cs source file and copy the source file into your project’s Assets directory. | Find the Il2CppSetOptionsAttribute.cs source file and copy the source file into your project’s Assets directory. |
Use the -force-free command line argument to run the Editor as if there is a free Unity license on the machine. | Use the -force-free command line argument to run the Editor as if there is a free Unity license on the machine. |
Select the new GameObject and rename it ExampleGameObject. | Select the new GameObject and rename it ExampleGameObject . |
In the Rigidbody component, set Mass to 10. | In the Rigidbody component, set Mass to 10 . |
Italic text
Don't use italic text. Italicized text can make letters harder to read, particularly on smaller displays.
Underlined text
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
Don't use quotation marks in user-facing technical documentation.
In non-user-facing documentation, use quotation marks in the following contexts:
- To indicate that a word or phrase is being discussed rather than used in the sentence.
- To mark the beginning and end of a title or direct quotation from another source. To avoid potential copyright issues with quotations, whenever possible, summarize the content and link to the original source instead.
For example, in the Style Guide, quotation marks are used to indicate that a word or phrase is being discussed rather than used in the sentence.