The Text Mesh component generates 3D geometry that displays text strings.
Note: This is a legacy component that has limited functionality. For information on more recent, full-featured ways of displaying text, see Creating user interfaces (UI).
You can create a new Text Mesh from Component > Mesh > Text Mesh.
Text Meshes can be used for rendering road signs, graffiti etc. The Text Mesh places text in the 3D scene. To make generic 2D text for GUIs, use a GUI Text component instead.
请按照以下步骤使用自定义字体创建文本网格:
Import a font by dragging a TrueType Font - a .ttf file - from the Explorer (Windows) or Finder (OS X) into the Project View.
Select the imported font in the Project View.
Choose GameObject > Create Other > 3D Text.
You have now created a text mesh with your custom TrueType Font. You can scale the text and move it around using the Scene View’sTransform controls.
You can download free TrueType Fonts from 1001freefonts.com (download the Windows fonts since they contain TrueType Fonts).
If you are scripting the Text property, you can add line breaks by inserting the escape character “\n” in your strings.
You can use simple markup to style text meshes. See the Styled Text page for more details.
Fonts in Unity render the font glyphs to a texture map before any further rendering. If the font size is set too small, these font textures will appear blocky. Since TextMesh assets are rendered using quads, it’s possible that if the size of the TextMesh and font texture differ, the TextMesh might display incorrectly.