- Home /
Font effects
What is the best way to render text with font effects in Unity? Like the following image:
What I would like to know is:
What can be done run-time (I think some effects must be possible using shader effects)
What can be done in a post-processing step (This could include the SaveFontTexture script)
What are the limitations (ASCII support? ISO_8859-1 support? Unicode support? Multiple font sizes?)
Answer by jonas-echterhoff · Aug 01, 2011 at 12:37 PM
What you can do at runtime is mostly limited by your creativity and skill in writing shaders. Basically just create a custom Font material using the font texture from the font, but your own shader. You should then be able to use that material with GUITexts and TextMeshes.
For offline processing, it's easiest to just copy the font texture created by Unity (either using the script you linked to, or by simply taking a screenshot of the inspector if the texture is small enough to show unscaled), and edit that texture in Photoshop. Make a custom material using your texture, and use that. Just make sure that the characters in the texture all stay in the same position and don't get larger. This option only works on static fonts, you have to pick an option other then "Dynamic" in the font importer, as dynamic fonts expect Unity to rewrite the font texture as needed.
For most flexibility, you can also create a custom font with your own font texture, but that means you have to manually set up the texture coordinates for each character, which means it is a lot of work to get right.
Apparently the SaveFontTexture method won't work in Unity 4 though...?
Unity 4 has this functionality built-in. Click on the gear menu in the font importer inspector, and select "Create Editable Copy", which creates a copy of the font asset with a png file for the texture and a mat file for the material, which you can then proceed to edit as you like.
Answer by j00hi · Mar 12, 2013 at 09:16 AM
I just tried the Plugin "Font Setter-Packer" from the Asset Store here: https://www.assetstore.unity3d.com/#/content/6594 and it is really great, does a perfect Job, you can import custom fonts very easily, the Tool is enormously helpful. Importing a custom font (created with e.g. Photoshop) can be done really fast. Just follow the video tutorials here: http://www.youtube.com/playlist?list=PL3Mj-QGBidI3EvVRJEaw0zLovfSX9kZdf