- Home /
Custom Font works in editor but not in build
Using a customised .ttf file I created a Text Mesh Pro font which works perfectly fine in the editor, but when I run a build of the project all the text objects return to the default font?
Answer by ricky_lee_ · Sep 29, 2021 at 05:31 PM
I'm already using TextMeshPro - Text (UI) components, I guess TextMesh seems now to be slightly different since that thread was made.
Though I did find a solution I'll post for anyone who this might help in future. I did 2 simple things so I'm not sure if one or both was the actual fix. Hope this helps!
SOLUTION
First of all I noticed in PlayerSettings>TextMeshPro>Settings the field for a DefaultFontAsset. This was set to the font 'Liberation' which is what my text was reverting to after building, so I swapped it out for my custom font.
Then I looked for where the 'Liberation' font assets were located in my Assets, and put my custom font assets in the same locations. I had two my custom font assets like this:
custom (Font) placed in: Assets/TextMeshPro/Fonts/
custom (TMP_Font Asset) placed in: Assets/TextMeshPro/Resources/Fonts&Materials/
Answer by Coolnumber11 · Sep 29, 2021 at 02:41 PM
I don't know but this thread might help
https://forum.unity.com/threads/textmeshpro-text-doesnt-show-up-in-built-game.538121/
Your answer
Follow this Question
Related Questions
TextMeshProUGUI Font Disappearing on Low FPS,Unity TextMeshProUGUI Font Disappearing 0 Answers
How to fix TextMeshPro breaking lines and escaping random characters? 0 Answers
How do I make Unity to print accentuated letters? 2 Answers
Programatically changing Text Mesh Pro font 1 Answer
Text map problem with 3d text 1 Answer