Basic tool to convert Unity fonts to use Multichannel Signed Distance Field fonts
Multichannel SDF font rendering provides much sharper text rendering that maintains its sharpness without pixelization no matter how large the text is.
This just takes Unity fonts and converts them to MSDF fonts using MSDFGen. At the moment this is a hack with a few hours of work and will probably be extended into a more useful thing in the future if people care enough.
This tool is made for static fonts that are baked out in the editor. It was mostly made targeted at VRChat worlds because Text Mesh Pro is fairly broken in VRChat. The main advantage that multi channel SDFs have is that they can maintain corners. Normal SDFs will usually get rounded corners on text. The MSDFGen github has a good example comparting to regular SDFs https://github.com/Chlumsky/msdfgen.
Default Unity Text Rendering
MSDF Text Rendering
- Install the package from the releases page
- Find a font that you like and use it on UI Text or Text Meshes
- Select the font asset and change the font size to somewhere between 30 and 60 and change the Character from Default to ASCII Default Set and click the Apply button. This step is important, if you do not change the character, the atlas generator will not know what to generate! If you need to support non-latin languages, you will need to change the Character to UTF and use a font that supports the extra characters. At some point I might make the script look at what characters are used in the scene to find the necessary characters.
- Open the atlas generator under the Window drop down Merlin > MSDF Font Generator
- Drag the font asset into the Font Asset slot in the generator and click Generate Atlas
- Once the atlas generation has finished, the new font atlas will be selected in your project files.
- Make a new material for your text. If you are putting this on a Text Mesh, select the
Merlin/MSDF Text Mesh Fontshader. If it is UIText use the
Merlin/UI/MSDF UI Fontshader.
- Drag the generated atlas texture into the MSDF Texture slot on the material.
- Apply the new material to your UI Text or Text Meshes.
- You should now have MSDF text on your text now. If you see artifacts that look like melting, go back to step 3 and increase the font size until the artifacts go away.